From 2c8a5e692eb8925ac4c35edbf48e7af6b6aaec57 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 10 Aug 2015 09:57:58 +0300 Subject: [PATCH] Implement cards: Braids, Conjurer Adept; Magus of the Bazaar; Malach of the Dawn; Uktabi Drake; and Waning Wurm --- .../sets/planarchaos/BraidsConjurerAdept.java | 79 +++++++++++++++++++ .../sets/planarchaos/MagusOfTheBazaar.java | 65 +++++++++++++++ .../sets/planarchaos/MalachOfTheDawn.java | 68 ++++++++++++++++ .../mage/sets/planarchaos/UktabiDrake.java | 68 ++++++++++++++++ .../src/mage/sets/planarchaos/WaningWurm.java | 72 +++++++++++++++++ .../PutPermanentOnBattlefieldEffect.java | 24 +++++- 6 files changed, 373 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java diff --git a/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java b/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java new file mode 100644 index 00000000000..6938504723b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/BraidsConjurerAdept.java @@ -0,0 +1,79 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author LoneFox + */ +public class BraidsConjurerAdept extends CardImpl { + + private static final FilterCard filter = new FilterCard("artifact, creature, or land card") +; + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); + } + + public BraidsConjurerAdept(UUID ownerId) { + super(ownerId, 36, "Braids, Conjurer Adept", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "PLC"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of each player's upkeep, that player may put an artifact, creature, or land card from his or her hand onto the battlefield. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutPermanentOnBattlefieldEffect(filter, true), TargetController.ANY, false)); + } + + public BraidsConjurerAdept(final BraidsConjurerAdept card) { + super(card); + } + + @Override + public BraidsConjurerAdept copy() { + return new BraidsConjurerAdept(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java new file mode 100644 index 00000000000..fa9b7eaf222 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MagusOfTheBazaar.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DrawDiscardControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MagusOfTheBazaar extends CardImpl { + + public MagusOfTheBazaar(UUID ownerId) { + super(ownerId, 43, "Magus of the Bazaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(0); + this.toughness = new MageInt(1); + + // {tap}: Draw two cards, then discard three cards. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawDiscardControllerEffect(2, 3), new TapSourceCost())); } + + public MagusOfTheBazaar(final MagusOfTheBazaar card) { + super(card); + } + + @Override + public MagusOfTheBazaar copy() { + return new MagusOfTheBazaar(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java b/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java new file mode 100644 index 00000000000..6bbae42c676 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/MalachOfTheDawn.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MalachOfTheDawn extends CardImpl { + + public MalachOfTheDawn(UUID ownerId) { + super(ownerId, 24, "Malach of the Dawn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Angel"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {W}{W}{W}: Regenerate Malach of the Dawn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{W}{W}{W}"))); + } + + public MalachOfTheDawn(final MalachOfTheDawn card) { + super(card); + } + + @Override + public MalachOfTheDawn copy() { + return new MalachOfTheDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java b/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java new file mode 100644 index 00000000000..cd638634faf --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/UktabiDrake.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.EchoAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class UktabiDrake extends CardImpl { + + public UktabiDrake(UUID ownerId) { + super(ownerId, 141, "Uktabi Drake", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Echo {1}{G}{G} + this.addAbility(new EchoAbility("{1}{G}{G}")); + } + + public UktabiDrake(final UktabiDrake card) { + super(card); + } + + @Override + public UktabiDrake copy() { + return new UktabiDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java b/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java new file mode 100644 index 00000000000..7a37457f8dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/WaningWurm.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.VanishingSacrificeAbility; +import mage.abilities.keyword.VanishingUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + */ +public class WaningWurm extends CardImpl { + + public WaningWurm(UUID ownerId) { + super(ownerId, 83, "Waning Wurm", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Zombie"); + this.subtype.add("Wurm"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // Vanishing 2 + Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(2))); + ability.setRuleVisible(false); + this.addAbility(ability); + this.addAbility(new VanishingUpkeepAbility(2)); + this.addAbility(new VanishingSacrificeAbility()); + } + + public WaningWurm(final WaningWurm card) { + super(card); + } + + @Override + public WaningWurm copy() { + return new WaningWurm(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java b/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java index 09a89be1956..12a208ab190 100644 --- a/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutPermanentOnBattlefieldEffect.java @@ -18,19 +18,26 @@ import mage.target.common.TargetCardInHand; public class PutPermanentOnBattlefieldEffect extends OneShotEffect { private final FilterCard filter; + private final boolean useTargetController; public PutPermanentOnBattlefieldEffect() { - this(new FilterPermanentCard("a permanent card")); + this(new FilterPermanentCard("a permanent card"), false); } public PutPermanentOnBattlefieldEffect(FilterCard filter) { + this(filter, false); + } + + public PutPermanentOnBattlefieldEffect(FilterCard filter, boolean useTargetController) { super(Outcome.PutCardInPlay); this.filter = filter; + this.useTargetController = useTargetController; } public PutPermanentOnBattlefieldEffect(final PutPermanentOnBattlefieldEffect effect) { super(effect); this.filter = effect.filter.copy(); + this.useTargetController = effect.useTargetController; } @Override @@ -40,7 +47,13 @@ public class PutPermanentOnBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player player; + if(useTargetController) { + player = game.getPlayer(getTargetPointer().getFirst(game, source)); + } + else { + player = game.getPlayer(source.getControllerId()); + } String choiceText = "Put " + filter.getMessage() + " from your hand onto the battlefield?"; if (player == null || !player.chooseUse(Outcome.PutCardInPlay, choiceText, source, game)) { return false; @@ -63,6 +76,11 @@ public class PutPermanentOnBattlefieldEffect extends OneShotEffect { return staticText; } - return "you may put " + filter.getMessage() + " from your hand onto the battlefield"; + if(useTargetController) { + return "that player may put " + filter.getMessage() + " from his or her hand onto the battlefield"; + } + else { + return "you may put " + filter.getMessage() + " from your hand onto the battlefield"; + } } }