diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 9e4f6a457d9..e15827f6e76 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -143,7 +143,8 @@ public class GameView implements Serializable { } } } else { - logger.error("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule()); + // can happen if a player times out while ability is on the stack + logger.debug("Stack Object for stack ability not found: " + stackObject.getStackAbility().getRule()); } } else { // Spell diff --git a/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java new file mode 100644 index 00000000000..3922ab3d508 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers1.java @@ -0,0 +1,66 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BalduvianWarMakers1 extends CardImpl { + + public BalduvianWarMakers1(UUID ownerId) { + super(ownerId, 97, "Balduvian War-Makers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Barbarian"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public BalduvianWarMakers1(final BalduvianWarMakers1 card) { + super(card); + } + + @Override + public BalduvianWarMakers1 copy() { + return new BalduvianWarMakers1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java new file mode 100644 index 00000000000..175ba8a2141 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/BalduvianWarMakers2.java @@ -0,0 +1,51 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BalduvianWarMakers2 extends BalduvianWarMakers1 { + + public BalduvianWarMakers2(UUID ownerId) { + super(ownerId); + this.cardNumber = 98; + } + + public BalduvianWarMakers2(final BalduvianWarMakers2 card) { + super(card); + } + + @Override + public BalduvianWarMakers2 copy() { + return new BalduvianWarMakers2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java new file mode 100644 index 00000000000..9c5d4381512 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers1.java @@ -0,0 +1,71 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByOneEffect; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GorillaBerserkers1 extends CardImpl { + + public GorillaBerserkers1(UUID ownerId) { + super(ownerId, 75, "Gorilla Berserkers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Ape"); + this.subtype.add("Berserker"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + // Gorilla Berserkers can't be blocked except by three or more creatures. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(3))); + } + + public GorillaBerserkers1(final GorillaBerserkers1 card) { + super(card); + } + + @Override + public GorillaBerserkers1 copy() { + return new GorillaBerserkers1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java new file mode 100644 index 00000000000..1991e685628 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/GorillaBerserkers2.java @@ -0,0 +1,51 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GorillaBerserkers2 extends GorillaBerserkers1 { + + public GorillaBerserkers2(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + } + + public GorillaBerserkers2(final GorillaBerserkers2 card) { + super(card); + } + + @Override + public GorillaBerserkers2 copy() { + return new GorillaBerserkers2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java new file mode 100644 index 00000000000..893647e1340 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms1.java @@ -0,0 +1,69 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class InsidiousBookworms1 extends CardImpl { + + public InsidiousBookworms1(UUID ownerId) { + super(ownerId, 12, "Insidious Bookworms", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Worm"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Insidious Bookworms dies, you may pay {1}{B}. If you do, target player discards a card at random. + Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new DiscardTargetEffect(1, true), new ManaCostsImpl("{1}{B}"))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public InsidiousBookworms1(final InsidiousBookworms1 card) { + super(card); + } + + @Override + public InsidiousBookworms1 copy() { + return new InsidiousBookworms1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java new file mode 100644 index 00000000000..6b8167641ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/InsidiousBookworms2.java @@ -0,0 +1,51 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class InsidiousBookworms2 extends InsidiousBookworms1 { + + public InsidiousBookworms2(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + } + + public InsidiousBookworms2(final InsidiousBookworms2 card) { + super(card); + } + + @Override + public InsidiousBookworms2 copy() { + return new InsidiousBookworms2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.java b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.java new file mode 100644 index 00000000000..6c260c65c1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard1.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.alliances; + +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.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard1 extends CardImpl { + + public LimDulsHighGuard1(UUID ownerId) { + super(ownerId, 17, "Lim-Dul's High Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {1}{B}: Regenerate Lim-Dul's High Guard. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}"))); + } + + public LimDulsHighGuard1(final LimDulsHighGuard1 card) { + super(card); + } + + @Override + public LimDulsHighGuard1 copy() { + return new LimDulsHighGuard1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java new file mode 100644 index 00000000000..f3eeba47ccf --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/LimDulsHighGuard2.java @@ -0,0 +1,51 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard2 extends LimDulsHighGuard1 { + + public LimDulsHighGuard2(UUID ownerId) { + super(ownerId); + this.cardNumber = 18; + } + + public LimDulsHighGuard2(final LimDulsHighGuard2 card) { + super(card); + } + + @Override + public LimDulsHighGuard2 copy() { + return new LimDulsHighGuard2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java b/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java index a7ba4876f7b..36a4e5d6da8 100644 --- a/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java +++ b/Mage.Sets/src/mage/sets/alliances/PhyrexianDevourer.java @@ -27,8 +27,6 @@ */ package mage.sets.alliances; -import java.util.ArrayList; -import java.util.List; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; @@ -100,10 +98,7 @@ class PhyrexianDevourerStateTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(getSourceId()); - if(permanent != null && permanent.getPower().getValue() >= 7){ - return true; - } - return false; + return permanent != null && permanent.getPower().getValue() >= 7; } @Override @@ -134,9 +129,9 @@ class PhyrexianDevourerEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = null; - for (Cost cost: source.getCosts()) { + for (Cost cost : source.getCosts()) { if (cost instanceof ExileTopCardLibraryCost) { - card = ((ExileTopCardLibraryCost)cost).getCard(); + card = ((ExileTopCardLibraryCost) cost).getCard(); } } if (card != null) { @@ -170,7 +165,7 @@ class ExileTopCardLibraryCost extends CostImpl { if (controller != null) { card = controller.getLibrary().getFromTop(game); if (card != null) { - paid = controller.moveCardToExileWithInfo(card, null, "", sourceId, game, Zone.LIBRARY, true); + paid = controller.moveCards(card, null, Zone.EXILED, ability, game); } } return paid; diff --git a/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java b/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java new file mode 100644 index 00000000000..c9fc32a7e9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/RitualOfTheMachine.java @@ -0,0 +1,52 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RitualOfTheMachine extends mage.sets.masterseditionii.RitualOfTheMachine { + + public RitualOfTheMachine(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "ALL"; + } + + public RitualOfTheMachine(final RitualOfTheMachine card) { + super(card); + } + + @Override + public RitualOfTheMachine copy() { + return new RitualOfTheMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java b/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java new file mode 100644 index 00000000000..dbb63d09e49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/VisceridArmor1.java @@ -0,0 +1,52 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VisceridArmor1 extends mage.sets.masterseditionii.VisceridArmor { + + public VisceridArmor1(UUID ownerId) { + super(ownerId); + this.cardNumber = 60; + this.expansionSetCode = "ALL"; + } + + public VisceridArmor1(final VisceridArmor1 card) { + super(card); + } + + @Override + public VisceridArmor1 copy() { + return new VisceridArmor1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java b/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java new file mode 100644 index 00000000000..18ce8c47e5d --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/VisceridArmor2.java @@ -0,0 +1,52 @@ +/* + * 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.alliances; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class VisceridArmor2 extends mage.sets.masterseditionii.VisceridArmor { + + public VisceridArmor2(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "ALL"; + } + + public VisceridArmor2(final VisceridArmor2 card) { + super(card); + } + + @Override + public VisceridArmor2 copy() { + return new VisceridArmor2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java new file mode 100644 index 00000000000..c215b3b8332 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients1.java @@ -0,0 +1,54 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients1 extends mage.sets.masterseditionii.YavimayaAncients { + + public YavimayaAncients1(UUID ownerId) { + super(ownerId); + this.cardNumber = 91; + this.expansionSetCode = "ALL"; + this.rarity = Rarity.COMMON; + } + + public YavimayaAncients1(final YavimayaAncients1 card) { + super(card); + } + + @Override + public YavimayaAncients1 copy() { + return new YavimayaAncients1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java new file mode 100644 index 00000000000..a3df8b2b283 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAncients2.java @@ -0,0 +1,54 @@ +/* + * 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.alliances; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients2 extends mage.sets.masterseditionii.YavimayaAncients { + + public YavimayaAncients2(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "ALL"; + this.rarity = Rarity.COMMON; + } + + public YavimayaAncients2(final YavimayaAncients2 card) { + super(card); + } + + @Override + public YavimayaAncients2 copy() { + return new YavimayaAncients2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java index 1d2a88c9abc..4d902ed4b3b 100644 --- a/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java +++ b/Mage.Sets/src/mage/sets/antiquities/GateToPhyrexia.java @@ -91,4 +91,9 @@ class GateToPhyrexiaAbility extends LimitedTimesPerTurnActivatedAbility { } return super.canActivate(playerId, game); } + + @Override + public String getRule() { + return "Sacrifice a creature: Destroy target artifact. Activate this ability only during your upkeep and only once each turn."; + } } diff --git a/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java b/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java index 4edae4f5649..c6168855cc6 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DwarvenLandslide.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -62,6 +63,7 @@ public class DwarvenLandslide extends CardImpl { this.addAbility(new KickerAbility(kickerCosts)); // Destroy target land. If Dwarven Landslide was kicked, destroy another target land. getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target land. If {this} was kicked, destroy another target land")); + getSpellAbility().addTarget(new TargetLandPermanent()); } public DwarvenLandslide(final DwarvenLandslide card) { @@ -70,7 +72,9 @@ public class DwarvenLandslide extends CardImpl { @Override public void adjustTargets(Ability ability, Game game) { - ability.addTarget(new TargetLandPermanent(KickedCondition.getInstance().apply(game, ability) ? 2 : 1)); + if (KickedCondition.getInstance().apply(game, ability)) { + getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)"))); + } } @Override diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java b/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java index 49d08482134..42c785000e2 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Cloudshift.java @@ -27,15 +27,15 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author noxx @@ -46,10 +46,11 @@ public class Cloudshift extends CardImpl { super(ownerId, 12, "Cloudshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{W}"); this.expansionSetCode = "AVR"; - // Exile target creature you control, then return that card to the battlefield under your control. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); - this.getSpellAbility().addEffect(new ExileTargetForSourceEffect()); + Effect effect = new ExileTargetForSourceEffect(); + effect.setApplyEffectsAfter(); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true)); } diff --git a/Mage.Sets/src/mage/sets/commander2013/HullBreach.java b/Mage.Sets/src/mage/sets/commander2013/HullBreach.java index c47d23d6667..d6a51a65743 100644 --- a/Mage.Sets/src/mage/sets/commander2013/HullBreach.java +++ b/Mage.Sets/src/mage/sets/commander2013/HullBreach.java @@ -50,7 +50,6 @@ public class HullBreach extends CardImpl { super(ownerId, 193, "Hull Breach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}{G}"); this.expansionSetCode = "C13"; - // Choose one - Destroy target artifact; this.getSpellAbility().addEffect(new DestroyTargetEffect()); Target target = new TargetArtifactPermanent(); @@ -63,18 +62,14 @@ public class HullBreach extends CardImpl { this.getSpellAbility().addMode(mode); // or destroy target artifact and target enchantment. mode = new Mode(); - mode.getEffects().add(new DestroyTargetEffect()); - target = new TargetArtifactPermanent(); - mode.getTargets().add(target); Effect effect = new DestroyTargetEffect(); effect.setTargetPointer(new SecondTargetPointer()); - effect.setText("and target enchantment"); + effect.setText("destroy target artifact and target enchantment"); mode.getEffects().add(effect); - target = new TargetPermanent(new FilterEnchantmentPermanent()); - mode.getTargets().add(target); + mode.getTargets().add(new TargetArtifactPermanent()); + mode.getTargets().add(new TargetPermanent(new FilterEnchantmentPermanent())); this.getSpellAbility().addMode(mode); - } public HullBreach(final HullBreach card) { diff --git a/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java b/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java index 53cecb0c1c1..a32f7140ef4 100644 --- a/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java +++ b/Mage.Sets/src/mage/sets/commander2013/TemptWithReflections.java @@ -40,12 +40,9 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.EmptyToken; -import mage.game.permanent.token.Token; import mage.players.Player; import mage.players.PlayerList; import mage.target.common.TargetControlledCreaturePermanent; -import mage.util.CardUtil; /** * @@ -57,7 +54,6 @@ public class TemptWithReflections extends CardImpl { super(ownerId, 60, "Tempt with Reflections", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); this.expansionSetCode = "C13"; - // Tempting offer - Choose target creature you control. Put a token onto the battlefield that's a copy of that creature. Each opponent may put a token onto the battlefield that's a copy of that creature. For each opponent who does, put a token onto the battlefield that's a copy of that creature. this.getSpellAbility().addEffect(new TemptWithReflectionsEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); @@ -115,16 +111,16 @@ class TemptWithReflectionsEffect extends OneShotEffect { player = playerList.getNext(game); } while (!player.getId().equals(game.getActivePlayerId())); - for (UUID playerId: playersSaidYes) { + for (UUID playerId : playersSaidYes) { effect = new PutTokenOntoBattlefieldCopyTargetEffect(playerId); effect.setTargetPointer(getTargetPointer()); - effect.apply(game, source); + effect.apply(game, source); } if (playersSaidYes.size() > 0) { effect = new PutTokenOntoBattlefieldCopyTargetEffect(); effect.setTargetPointer(getTargetPointer()); - effect.apply(game, source); + effect.apply(game, source); } return true; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java b/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java index 416209d7782..34aacc41a2a 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/ProgenitorMimic.java @@ -53,7 +53,7 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.EmptyToken; import mage.util.CardUtil; -import mage.util.functions.ApplyToPermanent; +import mage.util.functions.AbilityApplier; /** * @@ -61,6 +61,12 @@ import mage.util.functions.ApplyToPermanent; */ public class ProgenitorMimic extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("no Token"); + + static { + filter.add(Predicates.not(new TokenPredicate())); + } + public ProgenitorMimic(UUID ownerId) { super(ownerId, 92, "Progenitor Mimic", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{U}"); this.expansionSetCode = "DGM"; @@ -72,11 +78,17 @@ public class ProgenitorMimic extends CardImpl { // You may have Progenitor Mimic enter the battlefield as a copy of any creature on the battlefield // except it gains "At the beginning of your upkeep, if this creature isn't a token, // put a token onto the battlefield that's a copy of this creature." + AbilityApplier applier = new AbilityApplier( + new ConditionalTriggeredAbility( + new BeginningOfUpkeepTriggeredAbility(new ProgenitorMimicCopyEffect(), TargetController.YOU, false), + new SourceMatchesFilterCondition(filter), + "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.") + ); this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, - new EntersBattlefieldEffect(new CopyPermanentEffect(new ProgenitorMimicApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\"", - true))); + new EntersBattlefieldEffect(new CopyPermanentEffect(applier), + "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\"", + true))); } public ProgenitorMimic(final ProgenitorMimic card) { @@ -89,24 +101,6 @@ public class ProgenitorMimic extends CardImpl { } } -class ProgenitorMimicApplyToPermanent extends ApplyToPermanent { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("no Token"); - static { - filter.add(Predicates.not(new TokenPredicate())); - } - - @Override - public Boolean apply(Game game, Permanent permanent) { - Ability ability = new ConditionalTriggeredAbility( - new BeginningOfUpkeepTriggeredAbility(new ProgenitorMimicCopyEffect(), TargetController.YOU, false), - new SourceMatchesFilterCondition(filter), - "At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature."); - permanent.addAbility(ability, game); - return true; - } -} - class ProgenitorMimicCopyEffect extends OneShotEffect { public ProgenitorMimicCopyEffect() { @@ -144,14 +138,14 @@ class ProgenitorMimicCopyEffect extends OneShotEffect { // if it was no copy of copy take the target itself copyFromPermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); } - - if (copyFromPermanent != null) { - EmptyToken token = new EmptyToken(); + + if (copyFromPermanent != null) { + EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); Permanent newPermanentToken = game.getPermanent(token.getLastAddedToken()); if (newPermanentToken != null) { - game.copyPermanent(copyFromPermanent, newPermanentToken, source, null); + game.copyPermanent(copyFromPermanent, newPermanentToken, source, null); return true; } } diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java new file mode 100644 index 00000000000..dbbff9b4d93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout1.java @@ -0,0 +1,52 @@ +/* + * 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.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout1 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout1(UUID ownerId) { + super(ownerId); + this.cardNumber = 157; + this.expansionSetCode = "FEM"; + } + + public IcatianScout1(final IcatianScout1 card) { + super(card); + } + + @Override + public IcatianScout1 copy() { + return new IcatianScout1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java new file mode 100644 index 00000000000..325181c2609 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout2.java @@ -0,0 +1,52 @@ +/* + * 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.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout2 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout2(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "FEM"; + } + + public IcatianScout2(final IcatianScout2 card) { + super(card); + } + + @Override + public IcatianScout2 copy() { + return new IcatianScout2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java new file mode 100644 index 00000000000..0fe56bc4118 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout3.java @@ -0,0 +1,52 @@ +/* + * 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.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout3 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout3(UUID ownerId) { + super(ownerId); + this.cardNumber = 159; + this.expansionSetCode = "FEM"; + } + + public IcatianScout3(final IcatianScout3 card) { + super(card); + } + + @Override + public IcatianScout3 copy() { + return new IcatianScout3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java new file mode 100644 index 00000000000..06810fad545 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianScout4.java @@ -0,0 +1,52 @@ +/* + * 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.fallenempires; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout4 extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout4(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "FEM"; + } + + public IcatianScout4(final IcatianScout4 card) { + super(card); + } + + @Override + public IcatianScout4 copy() { + return new IcatianScout4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java new file mode 100644 index 00000000000..b0436a20e5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/BrothersOfFire.java @@ -0,0 +1,52 @@ +/* + * 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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 214; + this.expansionSetCode = "5ED"; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java b/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java new file mode 100644 index 00000000000..2007c7018b8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CrawGiant.java @@ -0,0 +1,52 @@ +/* + * 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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends mage.sets.legends.CrawGiant { + + public CrawGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 147; + this.expansionSetCode = "5ED"; + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java b/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java new file mode 100644 index 00000000000..63b53cec3fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/IcatianScout.java @@ -0,0 +1,52 @@ +/* + * 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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class IcatianScout extends mage.sets.masterseditionii.IcatianScout { + + public IcatianScout(UUID ownerId) { + super(ownerId); + this.cardNumber = 313; + this.expansionSetCode = "5ED"; + } + + public IcatianScout(final IcatianScout card) { + super(card); + } + + @Override + public IcatianScout copy() { + return new IcatianScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Recall.java b/Mage.Sets/src/mage/sets/fifthedition/Recall.java index 605470d167b..f1af05b0fa4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Recall.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Recall.java @@ -73,7 +73,7 @@ class RecallEffect extends OneShotEffect { public RecallEffect() { super(Outcome.ReturnToHand); - this.staticText = "Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. "; + this.staticText = "Discard X cards, then return a card from your graveyard to your hand for each card discarded this way"; } public RecallEffect(final RecallEffect effect) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java index bfe1f16d8a4..32971790008 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java +++ b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java @@ -53,10 +53,10 @@ import mage.watchers.common.BlockedAttackerWatcher; /** * * @author jeffwadsworth - * + * 5/1/2009 The ability grants you control of all creatures that are blocking it as the ability resolves. This will include * any creatures that were put onto the battlefield blocking it. -5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures +5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures * are no longer in combat, they cannot be blocking The Wretched, which means you won't be able to gain control of them. 5/1/2009 If The Wretched itself regenerated during combat, then it will have been removed from combat. Since it is no longer * in combat, there cannot be any creatures blocking it, which means you won't be able to gain control of any creatures. @@ -64,7 +64,7 @@ import mage.watchers.common.BlockedAttackerWatcher; * combat damage step). For example, if it's blocked by a 7/7 creature and is destroyed, its ability won't trigger at all. 10/1/2009 If The Wretched leaves the battlefield, you no longer control it, so the duration of its control-change effect ends. 10/1/2009 If you lose control of The Wretched before its ability resolves, you won't gain control of the creatures blocking it at all. -10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that +10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that * they remain on the battlefield. */ @@ -96,6 +96,7 @@ class TheWretchedEffect extends OneShotEffect { TheWretchedEffect() { super(Outcome.Benefit); + staticText = "gain control of all creatures blocking {this} for as long as you control {this}"; } TheWretchedEffect(final TheWretchedEffect effect) { @@ -114,7 +115,7 @@ class TheWretchedEffect extends OneShotEffect { if (!new SourceOnBattlefieldControlUnchangedCondition().apply(game, source)) { return false; } - + for (CombatGroup combatGroup :game.getCombat().getGroups()) { if (combatGroup.getAttackers().contains(source.getSourceId())) { for(UUID creatureId: combatGroup.getBlockers()) { @@ -123,7 +124,7 @@ class TheWretchedEffect extends OneShotEffect { ContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom, source.getControllerId()), new SourceOnBattlefieldControlUnchangedCondition(), ""); effect.setTargetPointer(new FixedTarget(blocker.getId())); game.addEffect(effect, source); - + } } } diff --git a/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java b/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java new file mode 100644 index 00000000000..f482b988c14 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WolverinePack.java @@ -0,0 +1,54 @@ +/* + * 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.fifthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolverinePack extends mage.sets.legends.WolverinePack { + + public WolverinePack(UUID ownerId) { + super(ownerId); + this.cardNumber = 206; + this.expansionSetCode = "5ED"; + this.rarity = Rarity.UNCOMMON; + } + + public WolverinePack(final WolverinePack card) { + super(card); + } + + @Override + public WolverinePack copy() { + return new WolverinePack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java new file mode 100644 index 00000000000..b7b8b28f26f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/BrothersOfFire.java @@ -0,0 +1,75 @@ +/* + * 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.fourthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends CardImpl { + + public BrothersOfFire(UUID ownerId) { + super(ownerId, 197, "Brothers of Fire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{R}{R}: Brothers of Fire deals 1 damage to target creature or player and 1 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}{R}")); + Effect effect = new DamageControllerEffect(1); + effect.setText("and 1 damage to you"); + ability.addEffect(effect); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java index 3ff72547630..318db51af82 100644 --- a/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java +++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarAugur.java @@ -33,7 +33,10 @@ import mage.abilities.Ability; import mage.abilities.condition.common.IsStepCondition; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -59,12 +62,16 @@ public class LlanowarAugur extends CardImpl { // Sacrifice Llanowar Augur: Target creature gets +3/+3 and gains trample until end of turn. // Activate this ability only during your upkeep. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new BoostTargetEffect(3, 3, Duration.EndOfTurn), - new SacrificeSourceCost(), + Effect effect = new BoostTargetEffect(3, 3, Duration.EndOfTurn); + effect.setText("Target creature gets +3/+3"); + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + effect, + new SacrificeSourceCost(), new IsStepCondition(PhaseStep.UPKEEP), null - ); + ); + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, "and gains trample until end of turn"); + ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/iceage/TorGiant.java b/Mage.Sets/src/mage/sets/iceage/TorGiant.java index 406c02c838d..17f4c54c3de 100644 --- a/Mage.Sets/src/mage/sets/iceage/TorGiant.java +++ b/Mage.Sets/src/mage/sets/iceage/TorGiant.java @@ -40,7 +40,7 @@ import mage.cards.CardImpl; public class TorGiant extends CardImpl { public TorGiant(UUID ownerId) { - super(ownerId, 76, "Tor Giant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + super(ownerId, 220, "Tor Giant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.expansionSetCode = "ICE"; this.subtype.add("Giant"); diff --git a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java index 3d0174773d9..069e6abedf2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java +++ b/Mage.Sets/src/mage/sets/innistrad/CacklingCounterpart.java @@ -28,13 +28,13 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TimingRule; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -46,7 +46,6 @@ public class CacklingCounterpart extends CardImpl { super(ownerId, 46, "Cackling Counterpart", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); this.expansionSetCode = "ISD"; - // Put a token onto the battlefield that's a copy of target creature you control. this.getSpellAbility().addEffect(new PutTokenOntoBattlefieldCopyTargetEffect()); this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); @@ -64,5 +63,3 @@ public class CacklingCounterpart extends CardImpl { return new CacklingCounterpart(this); } } - - diff --git a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java index e6cb8e4ccdc..3cf16f8fbe3 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java +++ b/Mage.Sets/src/mage/sets/innistrad/EvilTwin.java @@ -28,10 +28,8 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -41,6 +39,9 @@ import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.ObjectSourcePlayer; import mage.filter.predicate.ObjectSourcePlayerPredicate; @@ -55,8 +56,6 @@ import mage.util.functions.ApplyToPermanent; */ public class EvilTwin extends CardImpl { - - public EvilTwin(UUID ownerId) { super(ownerId, 212, "Evil Twin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{B}"); this.expansionSetCode = "ISD"; @@ -69,8 +68,8 @@ public class EvilTwin extends CardImpl { this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, new EntersBattlefieldEffect(new CopyPermanentEffect(new EvilTwinApplyToPermanent()), - "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\"", - true))); + "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\"", + true))); } public EvilTwin(final EvilTwin card) { @@ -99,6 +98,16 @@ class EvilTwinApplyToPermanent extends ApplyToPermanent { permanent.addAbility(ability, game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{U}{B}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + mageObject.getAbilities().add(ability); + return true; + } + } class EvilTwinPredicate implements ObjectSourcePlayerPredicate> { diff --git a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java index 1d0444e8c57..a567c980624 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java +++ b/Mage.Sets/src/mage/sets/innistrad/SilentDeparture.java @@ -28,13 +28,12 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TimingRule; import mage.target.common.TargetCreaturePermanent; @@ -48,7 +47,6 @@ public class SilentDeparture extends CardImpl { super(ownerId, 75, "Silent Departure", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}"); this.expansionSetCode = "ISD"; - // Return target creature to its owner's hand. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); diff --git a/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java b/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java index d34f3ea38dc..24bb9763d6a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java +++ b/Mage.Sets/src/mage/sets/innistrad/TravelPreparations.java @@ -28,13 +28,14 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TimingRule; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; import mage.counters.CounterType; import mage.target.common.TargetCreaturePermanent; @@ -48,10 +49,12 @@ public class TravelPreparations extends CardImpl { super(ownerId, 206, "Travel Preparations", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{G}"); this.expansionSetCode = "ISD"; - // Put a +1/+1 counter on each of up to two target creatures. - this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setText("Put a +1/+1 counter on each of up to two target creatures"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + // Flashback {1}{W} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{1}{W}"), TimingRule.SORCERY)); } diff --git a/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java b/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java index db32455cf27..9d1f8fefc0e 100644 --- a/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java +++ b/Mage.Sets/src/mage/sets/invasion/PlagueSpores.java @@ -43,7 +43,7 @@ import mage.target.common.TargetLandPermanent; /** * * @author LoneFox - + * */ public class PlagueSpores extends CardImpl { @@ -58,7 +58,7 @@ public class PlagueSpores extends CardImpl { this.expansionSetCode = "INV"; // Destroy target nonblack creature and target land. They can't be regenerated. - Effect effect = new DestroyTargetEffect(true); + Effect effect = new DestroyTargetEffect(true, true); effect.setText("Destroy target nonblack creature and target land. They can't be regenerated."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java b/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java index 48dbb0da2ce..578166c9807 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/SpitefulBlow.java @@ -33,10 +33,8 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetLandPermanent; -import mage.target.targetpointer.SecondTargetPointer; /** * @@ -48,16 +46,12 @@ public class SpitefulBlow extends CardImpl { super(ownerId, 83, "Spiteful Blow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}"); this.expansionSetCode = "JOU"; - // Destroy target creature and target land. - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - Effect effect = new DestroyTargetEffect(); - effect.setText("and target land"); - effect.setTargetPointer(new SecondTargetPointer()); + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("Destroy target creature and target land"); this.getSpellAbility().addEffect(effect); - Target target = new TargetLandPermanent(); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetLandPermanent()); } public SpitefulBlow(final SpitefulBlow card) { diff --git a/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java b/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java new file mode 100644 index 00000000000..92fd344f643 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AErathiBerserker.java @@ -0,0 +1,63 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AErathiBerserker extends CardImpl { + + public AErathiBerserker(UUID ownerId) { + super(ownerId, 131, "AErathi Berserker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Human"); + this.subtype.add("Berserker"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Rampage 3 + this.addAbility(new RampageAbility(3)); + } + + public AErathiBerserker(final AErathiBerserker card) { + super(card); + } + + @Override + public AErathiBerserker copy() { + return new AErathiBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/Chromium.java b/Mage.Sets/src/mage/sets/legends/Chromium.java new file mode 100644 index 00000000000..e051d10c0a6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/Chromium.java @@ -0,0 +1,52 @@ +/* + * 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.legends; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Chromium extends mage.sets.masterseditioniii.Chromium { + + public Chromium(UUID ownerId) { + super(ownerId); + this.cardNumber = 264; + this.expansionSetCode = "LEG"; + } + + public Chromium(final Chromium card) { + super(card); + } + + @Override + public Chromium copy() { + return new Chromium(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/CrawGiant.java b/Mage.Sets/src/mage/sets/legends/CrawGiant.java new file mode 100644 index 00000000000..93af4402d66 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CrawGiant.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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends CardImpl { + + public CrawGiant(UUID ownerId) { + super(ownerId, 94, "Craw Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}{G}{G}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Giant"); + this.power = new MageInt(6); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/FrostGiant.java b/Mage.Sets/src/mage/sets/legends/FrostGiant.java new file mode 100644 index 00000000000..a4d8b1a1be2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/FrostGiant.java @@ -0,0 +1,62 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class FrostGiant extends CardImpl { + + public FrostGiant(UUID ownerId) { + super(ownerId, 146, "Frost Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Giant"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public FrostGiant(final FrostGiant card) { + super(card); + } + + @Override + public FrostGiant copy() { + return new FrostGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java b/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java new file mode 100644 index 00000000000..e08fbc96149 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HundingGjornersen.java @@ -0,0 +1,64 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HundingGjornersen extends CardImpl { + + public HundingGjornersen(UUID ownerId) { + super(ownerId, 271, "Hunding Gjornersen", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{U}{U}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public HundingGjornersen(final HundingGjornersen card) { + super(card); + } + + @Override + public HundingGjornersen copy() { + return new HundingGjornersen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java b/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java index 2e3b6a2615a..81e37f4aebb 100644 --- a/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java +++ b/Mage.Sets/src/mage/sets/legends/IvoryGuardians.java @@ -54,13 +54,13 @@ import mage.game.Game; * @author jeffwadsworth */ public class IvoryGuardians extends CardImpl { - - private static final FilterCard filter = new FilterCard(); - + + private static final FilterCard filter = new FilterCard("red"); + static { filter.add(new ColorPredicate(ObjectColor.RED)); } - + private static final String rule = "Creatures named {this} get +1/+1 as long as an opponent controls a nontoken red permanent"; public IvoryGuardians(UUID ownerId) { @@ -73,10 +73,10 @@ public class IvoryGuardians extends CardImpl { // Protection from red this.addAbility(new ProtectionAbility(filter)); - + // Creatures named Ivory Guardians get +1/+1 as long as an opponent controls a nontoken red permanent. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield), new IvoryGuardiansCondition(), rule))); - + } public IvoryGuardians(final IvoryGuardians card) { @@ -103,4 +103,4 @@ class IvoryGuardiansCondition implements Condition { } return conditionApplies; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/legends/LadyEvangela.java b/Mage.Sets/src/mage/sets/legends/LadyEvangela.java index c317c54c82b..30743d13b59 100644 --- a/Mage.Sets/src/mage/sets/legends/LadyEvangela.java +++ b/Mage.Sets/src/mage/sets/legends/LadyEvangela.java @@ -61,7 +61,6 @@ public class LadyEvangela extends CardImpl { Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true); effect.setText("Prevent all combat damage that would be dealt by target creature this turn."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}{B}")); - ability.addEffect(effect); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java b/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java new file mode 100644 index 00000000000..8cd84f424e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/MarhaultElsdragon.java @@ -0,0 +1,64 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MarhaultElsdragon extends CardImpl { + + public MarhaultElsdragon(UUID ownerId) { + super(ownerId, 284, "Marhault Elsdragon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}"); + this.expansionSetCode = "LEG"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(6); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public MarhaultElsdragon(final MarhaultElsdragon card) { + super(card); + } + + @Override + public MarhaultElsdragon copy() { + return new MarhaultElsdragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/WolverinePack.java b/Mage.Sets/src/mage/sets/legends/WolverinePack.java new file mode 100644 index 00000000000..843ba42bbba --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/WolverinePack.java @@ -0,0 +1,62 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolverinePack extends CardImpl { + + public WolverinePack(UUID ownerId) { + super(ownerId, 128, "Wolverine Pack", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Wolverine"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Rampage 2 + this.addAbility(new RampageAbility(2)); + } + + public WolverinePack(final WolverinePack card) { + super(card); + } + + @Override + public WolverinePack copy() { + return new WolverinePack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java index 2018a4e7f69..ec4ca9b5e08 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/CopyArtifact.java @@ -28,7 +28,7 @@ package mage.sets.limitedalpha; import java.util.UUID; - +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.EntersBattlefieldEffect; @@ -50,7 +50,7 @@ import mage.util.functions.ApplyToPermanent; /** * * @author KholdFuzion - + * */ public class CopyArtifact extends CardImpl { @@ -58,7 +58,6 @@ public class CopyArtifact extends CardImpl { super(ownerId, 54, "Copy Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "LEA"; - // You may have Copy Artifact enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( new CopyArtifactEffect(), @@ -79,6 +78,25 @@ public class CopyArtifact extends CardImpl { class CopyArtifactEffect extends OneShotEffect { + ApplyToPermanent applier = new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getCardType().contains(CardType.ENCHANTMENT)) { + permanent.getCardType().add(CardType.ENCHANTMENT); + } + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getCardType().contains(CardType.ENCHANTMENT)) { + mageObject.getCardType().add(CardType.ENCHANTMENT); + } + return true; + } + + }; + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { @@ -104,16 +122,7 @@ class CopyArtifactEffect extends OneShotEffect { player.choose(Outcome.Copy, target, source.getSourceId(), game); Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getCardType().contains(CardType.ENCHANTMENT)) { - permanent.getCardType().add(CardType.ENCHANTMENT); - } - return true; - } - }); - + game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier); return true; } } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java new file mode 100644 index 00000000000..44e51b615b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * 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.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "LEA"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java new file mode 100644 index 00000000000..821fa3fb5cd --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * 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.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 157; + this.expansionSetCode = "LEB"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java index 3fef0ff88fb..54d717c7b30 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java +++ b/Mage.Sets/src/mage/sets/magic2012/PhantasmalImage.java @@ -29,6 +29,7 @@ package mage.sets.magic2012; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BecomesTargetTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -115,6 +116,18 @@ class PhantasmalImageCopyEffect extends OneShotEffect { //permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSubtype().contains("Illusion")) { + mageObject.getSubtype().add("Illusion"); + } + // Add directly because the created permanent is only used to copy from, so there is no need to add the ability to e.g. TriggeredAbilities + mageObject.getAbilities().add(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect())); + //permanent.addAbility(new BecomesTargetTriggeredAbility(new SacrificeSourceEffect()), game); + return true; + } + }); return true; diff --git a/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java b/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java index c1e14cdf255..6196ee8db79 100644 --- a/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java +++ b/Mage.Sets/src/mage/sets/magic2015/MercurialPretender.java @@ -47,7 +47,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.TargetPermanent; -import mage.util.functions.ApplyToPermanent; +import mage.util.functions.AbilityApplier; /** * @@ -82,6 +82,7 @@ public class MercurialPretender extends CardImpl { return new MercurialPretender(this); } } + class MercurialPretenderCopyEffect extends OneShotEffect { public MercurialPretenderCopyEffect() { @@ -103,16 +104,10 @@ class MercurialPretenderCopyEffect extends OneShotEffect { player.choose(Outcome.Copy, target, source.getSourceId(), game); Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget()); if (copyFromPermanent != null) { - game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { + game.copyPermanent(copyFromPermanent, sourcePermanent, source, // {2}{U}{U}: Return this creature to its owner's hand. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}{U}")); - permanent.addAbility(ability, game); - return true; - } - }); - + new AbilityApplier(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}{U}"))) + ); return true; } } diff --git a/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java b/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java new file mode 100644 index 00000000000..2d485e3c98b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/BrothersOfFire.java @@ -0,0 +1,52 @@ +/* + * 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.mastersedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 89; + this.expansionSetCode = "MED"; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java new file mode 100644 index 00000000000..c0b301e1e18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/GraniteGargoyle.java @@ -0,0 +1,54 @@ +/* + * 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.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "MED"; + this.rarity = Rarity.UNCOMMON; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java b/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java new file mode 100644 index 00000000000..bc644954181 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/IcatianScout.java @@ -0,0 +1,76 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IcatianScout extends CardImpl { + + public IcatianScout(UUID ownerId) { + super(ownerId, 17, "Icatian Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {1}, {tap}: Target creature gains first strike until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect( + FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public IcatianScout(final IcatianScout card) { + super(card); + } + + @Override + public IcatianScout copy() { + return new IcatianScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java b/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java new file mode 100644 index 00000000000..5fa1e9b10f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/LimDulsHighGuard.java @@ -0,0 +1,54 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LimDulsHighGuard extends mage.sets.alliances.LimDulsHighGuard1 { + + public LimDulsHighGuard(UUID ownerId) { + super(ownerId); + this.cardNumber = 103; + this.expansionSetCode = "ME2"; + this.rarity = Rarity.UNCOMMON; + } + + public LimDulsHighGuard(final LimDulsHighGuard card) { + super(card); + } + + @Override + public LimDulsHighGuard copy() { + return new LimDulsHighGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java b/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java new file mode 100644 index 00000000000..82c21f61ecf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/RitualOfTheMachine.java @@ -0,0 +1,78 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class RitualOfTheMachine extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact, nonblack creature"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public RitualOfTheMachine(UUID ownerId) { + super(ownerId, 109, "Ritual of the Machine", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "ME2"; + + // As an additional cost to cast Ritual of the Machine, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")))); + // Gain control of target nonartifact, nonblack creature. + this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfGame)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public RitualOfTheMachine(final RitualOfTheMachine card) { + super(card); + } + + @Override + public RitualOfTheMachine copy() { + return new RitualOfTheMachine(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.java b/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.java new file mode 100644 index 00000000000..f4b9c4d6210 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/VisceridArmor.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.masterseditionii; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class VisceridArmor extends CardImpl { + + public VisceridArmor(UUID ownerId) { + super(ownerId, 72, "Viscerid Armor", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // {1}{U}: Return Viscerid Armor to its owner's hand. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{1}{U}"))); + } + + public VisceridArmor(final VisceridArmor card) { + super(card); + } + + @Override + public VisceridArmor copy() { + return new VisceridArmor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java b/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java new file mode 100644 index 00000000000..a9c4568dc8a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/YavimayaAncients.java @@ -0,0 +1,66 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class YavimayaAncients extends CardImpl { + + public YavimayaAncients(UUID ownerId) { + super(ownerId, 190, "Yavimaya Ancients", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Treefolk"); + this.power = new MageInt(2); + this.toughness = new MageInt(7); + + // {G}: Yavimaya Ancients gets +1/-2 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, -2, Duration.EndOfTurn), new ManaCostsImpl("{G}"))); + } + + public YavimayaAncients(final YavimayaAncients card) { + super(card); + } + + @Override + public YavimayaAncients copy() { + return new YavimayaAncients(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java b/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java new file mode 100644 index 00000000000..cc0e032a460 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Chromium.java @@ -0,0 +1,74 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class Chromium extends CardImpl { + + public Chromium(UUID ownerId) { + super(ownerId, 147, "Chromium", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}{U}{U}{B}{B}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Rampage 2 + this.addAbility(new RampageAbility(2)); + // At the beginning of your upkeep, sacrifice Chromium unless you pay {W}{U}{B}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect( + new ManaCostsImpl("{W}{U}{B}")), TargetController.YOU, false)); + } + + public Chromium(final Chromium card) { + super(card); + } + + @Override + public Chromium copy() { + return new Chromium(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java b/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java new file mode 100644 index 00000000000..3775baa11b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FrostGiant.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FrostGiant extends mage.sets.legends.FrostGiant { + + public FrostGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 101; + this.expansionSetCode = "ME3"; + } + + public FrostGiant(final FrostGiant card) { + super(card); + } + + @Override + public FrostGiant copy() { + return new FrostGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java b/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java new file mode 100644 index 00000000000..a124aaa1bef --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/HundingGjornersen.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class HundingGjornersen extends mage.sets.legends.HundingGjornersen { + + public HundingGjornersen(UUID ownerId) { + super(ownerId); + this.cardNumber = 152; + this.expansionSetCode = "ME3"; + } + + public HundingGjornersen(final HundingGjornersen card) { + super(card); + } + + @Override + public HundingGjornersen copy() { + return new HundingGjornersen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java b/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java index 225d0176d3e..19390b22d4c 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java +++ b/Mage.Sets/src/mage/sets/masterseditioniii/KoboldDrillSergeant.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; @@ -47,7 +48,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; * @author ilcartographer */ public class KoboldDrillSergeant extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Kobold creatures"); static { @@ -62,9 +63,11 @@ public class KoboldDrillSergeant extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(2); - // Other Kobold creatures you control get +0/+1 and have trample. + // Other Kobold creatures you control get +0/+1 and have trample. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, filter, true)); - ability.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true)); + Effect effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true); + effect.setText("and have trample"); + ability.addEffect(effect); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java b/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java new file mode 100644 index 00000000000..3269d81cd5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/MarhaultElsdragon.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class MarhaultElsdragon extends mage.sets.legends.MarhaultElsdragon { + + public MarhaultElsdragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 161; + this.expansionSetCode = "ME3"; + } + + public MarhaultElsdragon(final MarhaultElsdragon card) { + super(card); + } + + @Override + public MarhaultElsdragon copy() { + return new MarhaultElsdragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/Brushwagg.java b/Mage.Sets/src/mage/sets/mirage/Brushwagg.java new file mode 100644 index 00000000000..9881a68a2a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/Brushwagg.java @@ -0,0 +1,64 @@ +/* + * 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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Brushwagg extends CardImpl { + + public Brushwagg(UUID ownerId) { + super(ownerId, 106, "Brushwagg", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Brushwagg"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Brushwagg blocks or becomes blocked, it gets -2/+2 until end of turn. + this.addAbility(new BlocksOrBecomesBlockedTriggeredAbility(new BoostSourceEffect(-2, 2, Duration.EndOfTurn), false)); + } + + public Brushwagg(final Brushwagg card) { + super(card); + } + + @Override + public Brushwagg copy() { + return new Brushwagg(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java b/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java new file mode 100644 index 00000000000..e51cb4f7ecb --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/HorribleHordes.java @@ -0,0 +1,62 @@ +/* + * 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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.RampageAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HorribleHordes extends CardImpl { + + public HorribleHordes(UUID ownerId) { + super(ownerId, 269, "Horrible Hordes", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Rampage 1 + this.addAbility(new RampageAbility(1)); + } + + public HorribleHordes(final HorribleHordes card) { + super(card); + } + + @Override + public HorribleHordes copy() { + return new HorribleHordes(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java b/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java new file mode 100644 index 00000000000..08d85b6ecf7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/MerfolkSeer.java @@ -0,0 +1,66 @@ +/* + * 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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MerfolkSeer extends CardImpl { + + public MerfolkSeer(UUID ownerId) { + super(ownerId, 76, "Merfolk Seer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Merfolk Seer dies, you may pay {1}{U}. If you do, draw a card. + this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{U}")))); + } + + public MerfolkSeer(final MerfolkSeer card) { + super(card); + } + + @Override + public MerfolkSeer copy() { + return new MerfolkSeer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/TeekasDragon.java b/Mage.Sets/src/mage/sets/mirage/TeekasDragon.java new file mode 100644 index 00000000000..80f95a882b0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/TeekasDragon.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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.RampageAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TeekasDragon extends CardImpl { + + public TeekasDragon(UUID ownerId) { + super(ownerId, 285, "Teeka's Dragon", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{9}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // trample + this.addAbility(TrampleAbility.getInstance()); + // rampage 4 + this.addAbility(new RampageAbility(4)); + } + + public TeekasDragon(final TeekasDragon card) { + super(card); + } + + @Override + public TeekasDragon copy() { + return new TeekasDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java index 3f02879da63..083bee110ab 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java @@ -29,6 +29,7 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -110,6 +111,15 @@ class CryptoplasmEffect extends OneShotEffect { permanent.addAbility(upkeepAbility, source.getSourceId(), game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); + upkeepAbility.addTarget(new TargetCreaturePermanent()); + mageObject.getAbilities().add(upkeepAbility); + return true; + } + }); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java index 92bf8694157..47338c04dea 100644 --- a/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java +++ b/Mage.Sets/src/mage/sets/morningtide/GrimoireThief.java @@ -52,7 +52,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.FilterPlayer; import mage.game.ExileZone; import mage.game.Game; import mage.game.stack.Spell; diff --git a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java index c7bacdd92a1..a16e1c7aadf 100644 --- a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java +++ b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java @@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class KinsbaileCavalier extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Knight"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Knight creatures"); static { filter.add(new SubtypePredicate("Knight")); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index 681c7882c45..25a6c37427b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -25,20 +25,20 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -51,7 +51,7 @@ import mage.util.functions.ApplyToPermanent; * @author Loki */ public class PhyrexianMetamorph extends CardImpl { - + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { @@ -59,8 +59,8 @@ public class PhyrexianMetamorph extends CardImpl { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); } - - public PhyrexianMetamorph (UUID ownerId) { + + public PhyrexianMetamorph(UUID ownerId) { super(ownerId, 42, "Phyrexian Metamorph", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{UP}"); this.expansionSetCode = "NPH"; this.subtype.add("Shapeshifter"); @@ -71,13 +71,19 @@ public class PhyrexianMetamorph extends CardImpl { ApplyToPermanent phyrexianMetamorphApplier = new ApplyToPermanent() { @Override public Boolean apply(Game game, Permanent permanent) { - if (!permanent.getCardType().contains(CardType.ARTIFACT)) { - permanent.getCardType().add(CardType.ARTIFACT); + return apply(game, (MageObject) permanent); + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getCardType().contains(CardType.ARTIFACT)) { + mageObject.getCardType().add(CardType.ARTIFACT); } return true; } + }; - + // {UP} ( can be paid with either {U} or 2 life.) // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types. Effect effect = new CopyPermanentEffect(filter, phyrexianMetamorphApplier); @@ -86,7 +92,7 @@ public class PhyrexianMetamorph extends CardImpl { this.addAbility(ability); } - public PhyrexianMetamorph (final PhyrexianMetamorph card) { + public PhyrexianMetamorph(final PhyrexianMetamorph card) { super(card); } diff --git a/Mage.Sets/src/mage/sets/odyssey/Decimate.java b/Mage.Sets/src/mage/sets/odyssey/Decimate.java index a5f40f11349..e4c7b92ee7f 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Decimate.java +++ b/Mage.Sets/src/mage/sets/odyssey/Decimate.java @@ -48,9 +48,8 @@ public class Decimate extends CardImpl { super(ownerId, 287, "Decimate", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{R}{G}"); this.expansionSetCode = "ODY"; - // Destroy target artifact, target creature, target enchantment, and target land. - Effect effect = new DestroyTargetEffect(); + Effect effect = new DestroyTargetEffect(false, true); effect.setText("Destroy target artifact, target creature, target enchantment, and target land."); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java b/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java index b73609a114a..9bfd48af8f8 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java +++ b/Mage.Sets/src/mage/sets/planarchaos/BoomBust.java @@ -25,32 +25,25 @@ * 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.constants.CardType; -import mage.constants.Rarity; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.SplitCard; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; -/** - * - * @author LevelX2 - */ - - public class BoomBust extends SplitCard { private static final FilterLandPermanent filter1 = new FilterLandPermanent("land you control"); private static final FilterLandPermanent filter2 = new FilterLandPermanent("land you don't control"); + static { filter1.add(new ControllerPredicate(TargetController.YOU)); filter2.add(new ControllerPredicate(TargetController.NOT_YOU)); @@ -62,7 +55,7 @@ public class BoomBust extends SplitCard { // Boom // Destroy target land you control and target land you don't control. - Effect effect = new DestroyTargetEffect(); + Effect effect = new DestroyTargetEffect(false, true); effect.setText("Destroy target land you control and target land you don't control"); getLeftHalfCard().getSpellAbility().addEffect(effect); getLeftHalfCard().getSpellAbility().addTarget(new TargetPermanent(filter1)); diff --git a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java index f0a0c1e585d..e16d11cbd58 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java +++ b/Mage.Sets/src/mage/sets/planechase2012/SakashimasStudent.java @@ -28,16 +28,17 @@ package mage.sets.planechase2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; +import mage.MageObject; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.abilities.keyword.NinjutsuAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.util.functions.ApplyToPermanent; @@ -60,7 +61,7 @@ public class SakashimasStudent extends CardImpl { // Ninjutsu {1}{U} this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,new EntersBattlefieldEffect( + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( new CopyPermanentEffect(new SakashimasStudentApplyToPermanent()), "You may have {this} enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types", true))); @@ -86,4 +87,13 @@ class SakashimasStudentApplyToPermanent extends ApplyToPermanent { } return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSubtype().contains("Ninja")) { + mageObject.getSubtype().add("Ninja"); + } + return true; + } + } diff --git a/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java new file mode 100644 index 00000000000..3191c635ce3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/GraniteGargoyle.java @@ -0,0 +1,69 @@ +/* + * 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.revisededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends CardImpl { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId, 155, "Granite Gargoyle", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Gargoyle"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {R}: Granite Gargoyle gets +0/+1 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(0, 1, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java index 9053aa1522e..c8bdbd5ed3b 100644 --- a/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java +++ b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class SorceressQueen extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature other than {this}"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature other than {this}"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java index 69e7612cb17..0256675d651 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PestilenceDemon.java @@ -25,13 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -39,7 +35,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; @@ -51,7 +49,7 @@ import mage.players.Player; */ public class PestilenceDemon extends CardImpl { - public PestilenceDemon (UUID ownerId) { + public PestilenceDemon(UUID ownerId) { super(ownerId, 124, "Pestilence Demon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}"); this.expansionSetCode = "ROE"; this.subtype.add("Demon"); @@ -62,7 +60,7 @@ public class PestilenceDemon extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PestilenceDemonEffect(), new ManaCostsImpl("{B}"))); } - public PestilenceDemon (final PestilenceDemon card) { + public PestilenceDemon(final PestilenceDemon card) { super(card); } @@ -74,6 +72,7 @@ public class PestilenceDemon extends CardImpl { } class PestilenceDemonEffect extends OneShotEffect { + PestilenceDemonEffect() { super(Outcome.Damage); staticText = "{this} deals 1 damage to each creature and each player"; @@ -94,7 +93,7 @@ class PestilenceDemonEffect extends OneShotEffect { for (UUID playerId : game.getPlayerList()) { Player p = game.getPlayer(playerId); if (p != null) { - p.damage(1, source.getSourceId(), game, true, false); + p.damage(1, source.getSourceId(), game, false, true); } } return true; @@ -105,4 +104,4 @@ class PestilenceDemonEffect extends OneShotEffect { return new PestilenceDemonEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java index 5e769b0a006..b902d364f2d 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SakashimaTheImpostor.java @@ -29,6 +29,7 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -119,6 +120,21 @@ class SakashimaTheImpostorCopyEffect extends OneShotEffect { ), game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + if (!mageObject.getSupertype().contains("Legendary")) { + mageObject.getSubtype().add("Legendary"); + } + mageObject.setName("Sakashima the Impostor"); + // {2}{U}{U}: Return Sakashima the Impostor to its owner's hand at the beginning of the next end step + mageObject.getAbilities().add(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToHandSourceEffect(true)), false), + new ManaCostsImpl("{2}{U}{U}") + )); + return true; + } + }); return true; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java b/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java index fc6cd8c6cef..9ab3c91bb7e 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LureboundScarecrow.java @@ -35,7 +35,6 @@ import mage.abilities.StateTriggeredAbility; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeSourceEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.choices.ChoiceColor; import mage.constants.CardType; @@ -127,20 +126,16 @@ class LureboundScarecrowTriggeredAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE || event.getType() == GameEvent.EventType.LOST_CONTROL - || event.getType() == GameEvent.EventType.COLOR_CHANGED - || event.getType() == GameEvent.EventType.SPELL_CAST) { - Card card = game.getCard(this.getSourceId()); - if (card != null) { - ObjectColor color = (ObjectColor) game.getState().getValue(card.getId() + "_color"); - if (color != null) { - for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { - if (perm.getColor(game).contains(color)) { - return false; - } + Permanent permanent = game.getPermanent(getSourceId()); + if (permanent != null) { + ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color"); + if (color != null) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) { + if (perm.getColor(game).contains(color)) { + return false; } - return true; } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java index 1b3d3fb54a6..b8307e5cc7b 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ImmortalCoil.java @@ -28,8 +28,6 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.StateTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -42,6 +40,11 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; @@ -58,7 +61,6 @@ public class ImmortalCoil extends CardImpl { super(ownerId, 79, "Immortal Coil", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}{B}{B}"); this.expansionSetCode = "ALA"; - // {tap}, Exile two cards from your graveyard: Draw a card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost()); ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2, new FilterCard("cards from your graveyard")))); @@ -98,10 +100,7 @@ class ImmortalCoilAbility extends StateTriggeredAbility { @Override public boolean checkTrigger(GameEvent event, Game game) { Player player = game.getPlayer(this.getControllerId()); - if(player != null && player.getGraveyard().size() == 0){ - return true; - } - return false; + return player != null && player.getGraveyard().size() == 0; } @Override @@ -130,7 +129,7 @@ class LoseGameEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + if (player != null) { player.lost(game); return true; } @@ -140,7 +139,6 @@ class LoseGameEffect extends OneShotEffect { class PreventAllDamageToControllerEffect extends PreventionEffectImpl { - public PreventAllDamageToControllerEffect() { super(Duration.WhileOnBattlefield); staticText = "If damage would be dealt to you, prevent that damage. Exile a card from your graveyard for each 1 damage prevented this way"; @@ -166,10 +164,10 @@ class PreventAllDamageToControllerEffect extends PreventionEffectImpl { if (!game.replaceEvent(preventEvent)) { int damage = event.getAmount(); Player player = game.getPlayer(source.getControllerId()); - if(player != null){ - TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(damage, player.getGraveyard().size()), new FilterCard()); + if (player != null) { + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(Math.min(damage, player.getGraveyard().size()), new FilterCard()); if (target.choose(Outcome.Exile, source.getControllerId(), source.getSourceId(), game)) { - for (UUID targetId: target.getTargets()) { + for (UUID targetId : target.getTargets()) { Card card = player.getGraveyard().get(targetId, game); if (card != null) { card.moveToZone(Zone.EXILED, source.getSourceId(), game, false); @@ -186,7 +184,7 @@ class PreventAllDamageToControllerEffect extends PreventionEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { if (super.applies(event, source, game)) { - if (event.getTargetId().equals(source.getControllerId())){ + if (event.getTargetId().equals(source.getControllerId())) { return true; } diff --git a/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java b/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java new file mode 100644 index 00000000000..b13f81ea003 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/BrothersOfFire.java @@ -0,0 +1,54 @@ +/* + * 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.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class BrothersOfFire extends mage.sets.fourthedition.BrothersOfFire { + + public BrothersOfFire(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.UNCOMMON; + } + + public BrothersOfFire(final BrothersOfFire card) { + super(card); + } + + @Override + public BrothersOfFire copy() { + return new BrothersOfFire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java b/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java index 87a97f0fdf8..928993b8dd2 100644 --- a/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java +++ b/Mage.Sets/src/mage/sets/theros/ArtisanOfForms.java @@ -29,6 +29,7 @@ package mage.sets.theros; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CopyPermanentEffect; @@ -77,6 +78,14 @@ public class ArtisanOfForms extends CardImpl { class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent { + @Override + public Boolean apply(Game game, MageObject mageObject) { + Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent()); + effect.setText("have {this} become a copy of target creature and gain this ability"); + mageObject.getAbilities().add(new HeroicAbility(effect, true)); + return true; + } + @Override public Boolean apply(Game game, Permanent permanent) { Effect effect = new CopyPermanentEffect(new ArtisanOfFormsApplyToPermanent()); @@ -84,4 +93,5 @@ class ArtisanOfFormsApplyToPermanent extends ApplyToPermanent { permanent.addAbility(new HeroicAbility(effect, true), game); return true; } + } diff --git a/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java b/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java new file mode 100644 index 00000000000..9887bfc3b09 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/CrawGiant.java @@ -0,0 +1,54 @@ +/* + * 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.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class CrawGiant extends mage.sets.legends.CrawGiant { + + public CrawGiant(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public CrawGiant(final CrawGiant card) { + super(card); + } + + @Override + public CrawGiant copy() { + return new CrawGiant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java b/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java new file mode 100644 index 00000000000..4e1f91ddda7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/LimDulTheNecromancer.java @@ -0,0 +1,183 @@ +/* + * 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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class LimDulTheNecromancer extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + private static final FilterPermanent filter2 = new FilterPermanent("Zombie"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + filter2.add(new SubtypePredicate("Zombie")); + } + + public LimDulTheNecromancer(UUID ownerId) { + super(ownerId, 114, "Lim-Dul the Necromancer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "TSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever a creature an opponent controls dies, you may pay {1}{B}. If you do, return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types. + this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new LimDulTheNecromancerEffect(), new ManaCostsImpl("{1}{B}")), true, filter, true)); + + // {1}{B}: Regenerate target Zombie. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{B}")); + ability2.addTarget(new TargetPermanent(filter2)); + this.addAbility(ability2); + + } + + public LimDulTheNecromancer(final LimDulTheNecromancer card) { + super(card); + } + + @Override + public LimDulTheNecromancer copy() { + return new LimDulTheNecromancer(this); + } +} + +class LimDulTheNecromancerEffect extends OneShotEffect { + + public LimDulTheNecromancerEffect() { + super(Outcome.PutCreatureInPlay); + staticText = " return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types"; + } + + public LimDulTheNecromancerEffect(final LimDulTheNecromancerEffect effect) { + super(effect); + } + + @Override + public LimDulTheNecromancerEffect copy() { + return new LimDulTheNecromancerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(targetPointer.getFirst(game, source)); + if (card != null) { + Zone currentZone = game.getState().getZone(card.getId()); + if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) { + Permanent creature = game.getPermanent(card.getId()); + ContinuousEffect effect = new LimDulTheNecromancerContiniousEffect(); + effect.setTargetPointer(new FixedTarget(creature.getId())); + game.addEffect(effect, source); + return true; + } + } + return false; + } + +} + +class LimDulTheNecromancerContiniousEffect extends ContinuousEffectImpl { + + public LimDulTheNecromancerContiniousEffect() { + super(Duration.Custom, Outcome.Neutral); + staticText = "If it's a creature, it's a Zombie in addition to its other creature types"; + } + + public LimDulTheNecromancerContiniousEffect(final LimDulTheNecromancerContiniousEffect effect) { + super(effect); + } + + @Override + public LimDulTheNecromancerContiniousEffect copy() { + return new LimDulTheNecromancerContiniousEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null + && permanent.getCardType().contains(CardType.CREATURE)) { + switch (layer) { + case TypeChangingEffects_4: + if (sublayer == SubLayer.NA) { + permanent.getSubtype().add("Zombie"); + } + break; + } + return true; + } else { + this.used = true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4; + } + +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java b/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java new file mode 100644 index 00000000000..dafb05335a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/GraniteGargoyle.java @@ -0,0 +1,52 @@ +/* + * 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.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class GraniteGargoyle extends mage.sets.revisededition.GraniteGargoyle { + + public GraniteGargoyle(UUID ownerId) { + super(ownerId); + this.cardNumber = 156; + this.expansionSetCode = "2ED"; + } + + public GraniteGargoyle(final GraniteGargoyle card) { + super(card); + } + + @Override + public GraniteGargoyle copy() { + return new GraniteGargoyle(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java index ba1a2326a2c..09cc3484c95 100644 --- a/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java +++ b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java @@ -29,6 +29,7 @@ package mage.sets.unlimitededition; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -115,6 +116,15 @@ class VesuvanDoppelgangerCopyEffect extends OneShotEffect { new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getColor(game).setColor(sourcePermanent.getColor(game)); + mageObject.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); + return true; + } + }); return true; } @@ -127,4 +137,4 @@ class VesuvanDoppelgangerCopyEffect extends OneShotEffect { public VesuvanDoppelgangerCopyEffect copy() { return new VesuvanDoppelgangerCopyEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java b/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java index 7c2e0602262..467c548ca54 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/DacksDuplicate.java @@ -29,6 +29,7 @@ package mage.sets.vintagemasters; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; @@ -86,4 +87,12 @@ class DacksDuplicateApplyToPermanent extends ApplyToPermanent { permanent.addAbility(HasteAbility.getInstance(), game); return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getAbilities().add(new DethroneAbility()); + mageObject.getAbilities().add(HasteAbility.getInstance()); + return true; + } + } diff --git a/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java b/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java index 13b7c9fcb93..ed5891a9222 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java +++ b/Mage.Sets/src/mage/sets/weatherlight/GoblinGrenadiers.java @@ -55,7 +55,7 @@ public class GoblinGrenadiers extends CardImpl { this.toughness = new MageInt(2); // Whenever Goblin Grenadiers attacks and isn't blocked, you may sacrifice it. If you do, destroy target creature and target land. - Effect effect = new DoIfCostPaid(new DestroyTargetEffect(), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature and target land?"); + Effect effect = new DoIfCostPaid(new DestroyTargetEffect(false, true), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature and target land?"); effect.setText("you may sacrifice it. If you do, destroy target creature and target land"); Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java b/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java index 150a3c4c73d..4f306bf163a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java +++ b/Mage.Sets/src/mage/sets/zendikar/RelicCrush.java @@ -29,15 +29,12 @@ package mage.sets.zendikar; import java.util.UUID; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterArtifactOrEnchantmentPermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; /** @@ -45,14 +42,16 @@ import mage.target.TargetPermanent; * @author jeffwadsworth */ public class RelicCrush extends CardImpl { - + public RelicCrush(UUID ownerId) { super(ownerId, 179, "Relic Crush", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{G}"); this.expansionSetCode = "ZEN"; // Destroy target artifact or enchantment and up to one other target artifact or enchantment. FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent(); - this.getSpellAbility().addEffect(new RelicCrushEffect()); + Effect effect = new DestroyTargetEffect(false, true); + effect.setText("Destroy target artifact or enchantment and up to one other target artifact or enchantment"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter, false)); } @@ -66,33 +65,3 @@ public class RelicCrush extends CardImpl { return new RelicCrush(this); } } - -class RelicCrushEffect extends OneShotEffect { - - public RelicCrushEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Destroy target artifact or enchantment and up to one other target artifact or enchantment"; - } - - public RelicCrushEffect(final RelicCrushEffect effect) { - super(effect); - } - - @Override - public RelicCrushEffect copy() { - return new RelicCrushEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent firstTarget = game.getPermanent(source.getFirstTarget()); - Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget()); - if (firstTarget != null) { - firstTarget.destroy(id, game, false); - } - if (secondTarget != null) { - return secondTarget.destroy(id, game, false); - } - return true; - } -} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java index 75a884fc286..e4304f68480 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/ArtisanOfFormsTest.java @@ -38,28 +38,28 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class ArtisanOfFormsTest extends CardTestPlayerBase { /** - * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a target creature. - * If Cackling Counterpart later resolves, it should copy the creature that Artisan of Forms copies, not - * the Artisan itself. + * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a + * target creature. If Cackling Counterpart later resolves, it should copy + * the creature that Artisan of Forms copies, not the Artisan itself. */ @Test public void testCopyTriggeredByCracklingCounterpart() { // Heroic - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability. - addCard(Zone.BATTLEFIELD, playerA, "Artisan of Forms"); + addCard(Zone.HAND, playerA, "Artisan of Forms"); // {1}{U} // {1}{U}{U} Put a token onto the battlefield that's a copy of target creature you control. addCard(Zone.HAND, playerA, "Cackling Counterpart"); - addCard(Zone.BATTLEFIELD, playerA, "Island",3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 5); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); - castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Artisan of Forms"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); addTarget(playerA, "Silvercoat Lion"); - setStopAt(1, PhaseStep.BEGIN_COMBAT); + setStopAt(1, PhaseStep.END_TURN); execute(); assertLife(playerA, 20); @@ -70,18 +70,18 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 1); // 1 + 2 Silvercoat Lion at the end assertPermanentCount(playerA, "Silvercoat Lion", 2); - - for (Permanent permanent :currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { + + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { if (permanent.getName().equals("Silvercoat Lion")) { Assert.assertEquals("Creature has to have Cast + Heroic ability", 2, permanent.getAbilities().size()); } } } - -/** - * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a target creature. - * If populate spell later resolves, it should copy the creature that Artisan of Forms copies, not - * the Artisan itself. + + /** + * Targeting a Artisan of Forms triggers it Heroic ability. So it can copy a + * target creature. If populate spell later resolves, it should copy the + * creature that Artisan of Forms copies, not the Artisan itself. */ @Test public void testCopyTriggeredByPopulate() { @@ -90,17 +90,17 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { addCard(Zone.BATTLEFIELD, playerA, "Artisan of Forms"); // {1}{U}{U} Put a token onto the battlefield that's a copy of target creature you control. addCard(Zone.HAND, playerA, "Cackling Counterpart"); - addCard(Zone.BATTLEFIELD, playerA, "Island",3); + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); addCard(Zone.HAND, playerA, "Eyes in the Skies"); - addCard(Zone.BATTLEFIELD, playerA, "Plains",4); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cackling Counterpart", "Artisan of Forms"); addTarget(playerA, "Silvercoat Lion"); - castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eyes in the Skies"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Eyes in the Skies"); addTarget(playerA, "Silvercoat Lion"); - + setStopAt(1, PhaseStep.END_TURN); execute(); @@ -113,12 +113,12 @@ public class ArtisanOfFormsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Bird", 1); // 3 Silvercoat Lion at the end assertPermanentCount(playerA, "Silvercoat Lion", 3); - - for (Permanent permanent :currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { + + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(playerA.getId())) { if (permanent.getName().equals("Silvercoat Lion")) { Assert.assertEquals("Creature has to have Cast + Heroic ability", 2, permanent.getAbilities().size()); } } - } - + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java index 341d497d74a..97b7f57c8d9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FelhideSpiritbinderTest.java @@ -94,4 +94,35 @@ public class FelhideSpiritbinderTest extends CardTestPlayerBase { assertLife(playerB, 20); } + + @Test + public void testCopyATokenCreature() { + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 3); + addCard(Zone.HAND, playerA, "Call of the Herd", 1); + + // Inspired - Whenever Felhide Spiritbinder becomes untapped, you may pay {1}{R}. + // If you do, put a token onto the battlefield that's a copy of another target creature + // except it's an enchantment in addition to its other types. It gains haste. Exile it at the beginning of the next end step. + addCard(Zone.BATTLEFIELD, playerB, "Felhide Spiritbinder", 1); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Call of the Herd"); + + attack(2, playerB, "Felhide Spiritbinder"); + + setStopAt(4, PhaseStep.PRECOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Elephant", 1); + assertPermanentCount(playerB, "Elephant", 1); + assertAbility(playerB, "Elephant", HasteAbility.getInstance(), true); + + Permanent copiedTokenElephant = getPermanent("Elephant", playerB); + Assert.assertEquals("Elephant has Enchantment card type", true, copiedTokenElephant.getCardType().contains(CardType.ENCHANTMENT)); + + assertLife(playerA, 17); + assertLife(playerB, 20); + + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java index 027a72d3c55..7b8b1dc02c6 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/FlameshadowConjuringTest.java @@ -82,28 +82,27 @@ public class FlameshadowConjuringTest extends CardTestPlayerBase { // Whenever a nontoken creature enters the battlefield under your control, you may pay {R}. If you do, put a token onto the battlefield that's a copy of that creature. // That token gains haste. Exile it at the beginning of the next end step. addCard(Zone.BATTLEFIELD, playerA, "Flameshadow Conjuring", 1); - // Sacrifice a creature: Nantuko Husk gets +2/+2 until end of turn. - addCard(Zone.BATTLEFIELD, playerA, "Nantuko Husk", 1); - // Deathtouch, lifelink // When Wurmcoil Engine dies, put a 3/3 colorless Wurm artifact creature token with deathtouch and a 3/3 colorless Wurm artifact creature token with lifelink onto the battlefield. addCard(Zone.HAND, playerA, "Wurmcoil Engine", 1); // 6/6 - {6} + addCard(Zone.BATTLEFIELD, playerB, "Plains", 3); + // Destroy target attacking creature. + addCard(Zone.HAND, playerB, "Kill Shot", 1); // {2}{U} + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wurmcoil Engine"); setChoice(playerA, "Yes"); attack(1, playerA, "Wurmcoil Engine"); - attack(1, playerA, "Nantuko Husk"); - activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice a creature"); - // addTarget(playerA, "Wurmcoil Engine[only copy]"); - setChoice(playerA, "Wurmcoil Engine[only copy]"); + castSpell(1, PhaseStep.END_COMBAT, playerB, "Kill Shot", "Wurmcoil Engine"); + setStopAt(1, PhaseStep.END_TURN); execute(); + assertGraveyardCount(playerB, "Kill Shot", 1); assertPermanentCount(playerA, "Wurmcoil Engine", 1); - assertPowerToughness(playerA, "Nantuko Husk", 4, 4); - assertLife(playerB, 12); + assertLife(playerB, 14); assertLife(playerA, 26); assertPermanentCount(playerA, "Wurm", 2); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java new file mode 100644 index 00000000000..8b62413c146 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/state/PhyrexianDevourerTest.java @@ -0,0 +1,71 @@ +/* + * 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 org.mage.test.cards.triggers.state; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class PhyrexianDevourerTest extends CardTestPlayerBase { + + /** + * Check that Phyrexian Devourer is sacrifriced as soon as the counters are + * added + * + */ + @Test + public void testBoostChecked() { + // When Phyrexian Devourer's power is 7 or greater, sacrifice it. + // Exile the top card of your library: Put X +1/+1 counters on Phyrexian Devourer, where X is the exiled card's converted mana cost. + addCard(Zone.BATTLEFIELD, playerA, "Phyrexian Devourer"); + addCard(Zone.LIBRARY, playerA, "Phyrexian Devourer"); + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Phyrexian Devourer", "Silvercoat Lion"); + + activateAbility(2, PhaseStep.DECLARE_BLOCKERS, playerA, "Exile the top card of your library"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertGraveyardCount(playerA, "Phyrexian Devourer", 1); + assertExileCount("Phyrexian Devourer", 1); + + assertPermanentCount(playerB, "Silvercoat Lion", 1); + + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java index aa0eda13c95..109b704982e 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/AnafenzaTest.java @@ -92,4 +92,51 @@ public class AnafenzaTest extends CardTestCommanderDuelBase { } + /** + * Token don't go to exile because they are no creature cards + */ + @Test + public void testAnafenzaExileInCombatOmnathToken() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Acidic Slime", 1); + + addCard(Zone.HAND, playerB, "Forest", 2); + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + addCard(Zone.BATTLEFIELD, playerB, "Omnath, Locus of Rage", 1); + + // Whenever Anafenza, the Foremost attacks, put a +1/+1 counter on another target tapped creature you control. + // If a creature card would be put into an opponent's graveyard from anywhere, exile it instead. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Anafenza, the Foremost"); + + playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); + playLand(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); + + attack(5, playerA, "Acidic Slime"); + block(5, playerB, "Elemental", "Acidic Slime"); + attack(5, playerA, "Anafenza, the Foremost"); + block(5, playerB, "Elemental", "Anafenza, the Foremost"); + addTarget(playerB, playerA); + + setStopAt(5, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertExileCount(playerA, 0); + assertExileCount(playerB, 0); + + assertPermanentCount(playerB, "Elemental", 1); + + assertGraveyardCount(playerA, "Acidic Slime", 1); + assertGraveyardCount(playerA, "Anafenza, the Foremost", 0); + assertCommandZoneCount(playerA, "Anafenza, the Foremost", 1); + + assertHandCount(playerA, 2); // turn 3 + 5 draw + assertHandCount(playerB, 2); // turn 2 + 4 draw + + assertLife(playerA, 37); + assertLife(playerB, 40); + } + } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java index 664d665ecfd..1114d2d0732 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java @@ -585,7 +585,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement actualCount++; } } - Assert.assertEquals("(Battlefield) Card counts are not equal (" + commandZoneObjectName + ")", count, actualCount); + Assert.assertEquals("(Command Zone) Card counts are not equal (" + commandZoneObjectName + ")", count, actualCount); } /** @@ -777,7 +777,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement */ public void assertHandCount(Player player, int count) throws AssertionError { int actual = currentGame.getPlayer(player.getId()).getHand().size(); - Assert.assertEquals("(Hand) Card counts are not equal ", count, actual); + Assert.assertEquals("(Hand " + player.getName() + ") Card counts are not equal ", count, actual); } /** diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index d9723850a2e..7006eeebdc2 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -237,6 +237,7 @@ public abstract class AbilityImpl implements Ability { */ if (effect.applyEffectsAfter()) { game.applyEffects(); + game.getState().getTriggers().checkStateTriggers(game); } } } diff --git a/Mage/src/mage/abilities/StateTriggeredAbility.java b/Mage/src/mage/abilities/StateTriggeredAbility.java index 1c8cfadfb37..45425d8b32c 100644 --- a/Mage/src/mage/abilities/StateTriggeredAbility.java +++ b/Mage/src/mage/abilities/StateTriggeredAbility.java @@ -1,16 +1,16 @@ /* * 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 @@ -20,12 +20,11 @@ * 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.abilities; import java.util.UUID; @@ -48,8 +47,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { super(ability); } - @Override - public final boolean checkEventType(GameEvent event, Game game) { + public boolean canTrigger(Game game) { //20100716 - 603.8 Boolean triggered = (Boolean) game.getState().getValue(getSourceId().toString() + "triggered"); if (triggered == null) { @@ -58,7 +56,11 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { return !triggered; } - + @Override + public final boolean checkEventType(GameEvent event, Game game) { + return false; + } + @Override public void trigger(Game game, UUID controllerId) { //20100716 - 603.8 @@ -71,7 +73,7 @@ public abstract class StateTriggeredAbility extends TriggeredAbilityImpl { //20100716 - 603.8 boolean result = super.resolve(game); game.getState().setValue(this.getSourceId().toString() + "triggered", Boolean.FALSE); - return result; + return result; } public void counter(Game game) { diff --git a/Mage/src/mage/abilities/TriggeredAbilities.java b/Mage/src/mage/abilities/TriggeredAbilities.java index 969e3cb78fa..599e44068c0 100644 --- a/Mage/src/mage/abilities/TriggeredAbilities.java +++ b/Mage/src/mage/abilities/TriggeredAbilities.java @@ -69,45 +69,57 @@ public class TriggeredAbilities extends ConcurrentHashMap it = this.values().iterator(); it.hasNext();) { + TriggeredAbility ability = it.next(); + if (ability instanceof StateTriggeredAbility && ((StateTriggeredAbility) ability).canTrigger(game)) { + checkTrigger(ability, null, game); + } + } + } + public void checkTriggers(GameEvent event, Game game) { for (Iterator it = this.values().iterator(); it.hasNext();) { TriggeredAbility ability = it.next(); - if (!ability.checkEventType(event, game)) { - continue; + if (ability.checkEventType(event, game)) { + checkTrigger(ability, event, game); } - // for effects like when leaves battlefield or destroyed use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring or Karmic Justice) - MageObject object = game.getObject(ability.getSourceId()); - if (ability.isInUseableZone(game, object, event)) { - if (!game.getContinuousEffects().preventedByRuleModification(event, ability, game, false)) { - if (object != null) { - boolean controllerSet = false; - if (!ability.getZone().equals(Zone.COMMAND) && event.getTargetId() != null && event.getTargetId().equals(ability.getSourceId()) - && (event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT))) { - // need to check if object was face down for dies and destroy events because the ability triggers in the new zone, zone counter -1 is used - Permanent permanent = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD, ability.getSourceObjectZoneChangeCounter() - 1); - if (permanent != null) { - if (!ability.getWorksFaceDown() && permanent.isFaceDown(game)) { - continue; - } - controllerSet = true; - ability.setControllerId(permanent.getControllerId()); - } - } - if (!controllerSet) { - if (object instanceof Permanent) { - ability.setControllerId(((Permanent) object).getControllerId()); - } else if (object instanceof Spell) { - // needed so that cast triggered abilities have to correct controller (e.g. Ulamog, the Infinite Gyre). - ability.setControllerId(((Spell) object).getControllerId()); - } else if (object instanceof Card) { - ability.setControllerId(((Card) object).getOwnerId()); - } - } - } + } + } - if (ability.checkTrigger(event, game)) { - ability.trigger(game, ability.getControllerId()); + private void checkTrigger(TriggeredAbility ability, GameEvent event, Game game) { + // for effects like when leaves battlefield or destroyed use ShortLKI to check if permanent was in the correct zone before (e.g. Oblivion Ring or Karmic Justice) + MageObject object = game.getObject(ability.getSourceId()); + if (ability.isInUseableZone(game, object, event)) { + if (event == null || !game.getContinuousEffects().preventedByRuleModification(event, ability, game, false)) { + if (object != null) { + boolean controllerSet = false; + if (!ability.getZone().equals(Zone.COMMAND) && event != null && event.getTargetId() != null && event.getTargetId().equals(ability.getSourceId()) + && (event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT))) { + // need to check if object was face down for dies and destroy events because the ability triggers in the new zone, zone counter -1 is used + Permanent permanent = (Permanent) game.getLastKnownInformation(ability.getSourceId(), Zone.BATTLEFIELD, ability.getSourceObjectZoneChangeCounter() - 1); + if (permanent != null) { + if (!ability.getWorksFaceDown() && permanent.isFaceDown(game)) { + return; + } + controllerSet = true; + ability.setControllerId(permanent.getControllerId()); + } } + if (!controllerSet) { + if (object instanceof Permanent) { + ability.setControllerId(((Permanent) object).getControllerId()); + } else if (object instanceof Spell) { + // needed so that cast triggered abilities have to correct controller (e.g. Ulamog, the Infinite Gyre). + ability.setControllerId(((Spell) object).getControllerId()); + } else if (object instanceof Card) { + ability.setControllerId(((Card) object).getOwnerId()); + } + } + } + + if (ability.checkTrigger(event, game)) { + ability.trigger(game, ability.getControllerId()); } } } diff --git a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java index 2e8aefd917d..494c05fa7bd 100644 --- a/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DiesThisOrAnotherCreatureTriggeredAbility.java @@ -28,9 +28,9 @@ package mage.abilities.common; import mage.MageObject; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -67,7 +67,7 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI public boolean checkEventType(GameEvent event, Game game) { return event.getType() == GameEvent.EventType.ZONE_CHANGE; } - + @Override public boolean isInUseableZone(Game game, MageObject source, GameEvent event) { Permanent sourcePermanent; @@ -81,24 +81,21 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI } return hasSourceObjectAbility(game, sourcePermanent, event); } - + @Override public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (game.getPermanent(sourceId) == null) { - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } + if (game.getPermanentOrLKIBattlefield(getSourceId()) == null) { + return false; } if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null) { - if (permanent.getId().equals(this.getSourceId())) { + if (zEvent.getTarget() != null) { + if (zEvent.getTarget().getId().equals(this.getSourceId())) { return true; } else { - if (filter.match(permanent, sourceId, controllerId, game)) { + if (filter.match(zEvent.getTarget(), sourceId, controllerId, game)) { return true; } } diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java index c4521407e84..751ecc86e4a 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java @@ -35,6 +35,7 @@ import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; +import mage.target.targetpointer.FirstTargetPointer; import mage.target.targetpointer.SecondTargetPointer; import mage.util.CardUtil; @@ -45,6 +46,7 @@ import mage.util.CardUtil; public class DestroyTargetEffect extends OneShotEffect { protected boolean noRegen; + protected boolean multitargetHandling; public DestroyTargetEffect() { this(false); @@ -56,13 +58,19 @@ public class DestroyTargetEffect extends OneShotEffect { } public DestroyTargetEffect(boolean noRegen) { + this(noRegen, false); + } + + public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) { super(Outcome.DestroyPermanent); this.noRegen = noRegen; + this.multitargetHandling = multitargetHandling; } public DestroyTargetEffect(final DestroyTargetEffect effect) { super(effect); this.noRegen = effect.noRegen; + this.multitargetHandling = effect.multitargetHandling; } @Override @@ -73,22 +81,23 @@ public class DestroyTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int affectedTargets = 0; -// if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns -// for (Target target : source.getTargets()) { -// for (UUID permanentId : target.getTargets()) { -// Permanent permanent = game.getPermanent(permanentId); -// if (permanent != null) { -// permanent.destroy(source.getSourceId(), game, noRegen); -// affectedTargets++; -// } -// } -// } -// } else - for (UUID permanentId : targetPointer.getTargets(game, source)) { - Permanent permanent = game.getPermanent(permanentId); - if (permanent != null) { - permanent.destroy(source.getSourceId(), game, noRegen); - affectedTargets++; + if (multitargetHandling && source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // Decimate + for (Target target : source.getTargets()) { + for (UUID permanentId : target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.destroy(source.getSourceId(), game, noRegen); + affectedTargets++; + } + } + } + } else { + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + permanent.destroy(source.getSourceId(), game, noRegen); + affectedTargets++; + } } } return affectedTargets > 0; diff --git a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java index 1d740f6f94c..ba01a9eef9d 100644 --- a/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/PutTokenOntoBattlefieldCopyTargetEffect.java @@ -33,19 +33,14 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.constants.CardType; -import mage.constants.Duration; import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.EmptyToken; -import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; import mage.util.functions.ApplyToPermanent; import mage.util.functions.EmptyApplyToPermanent; @@ -72,6 +67,13 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { this(playerId, null, false); } + /** + * + * @param playerId null the token is controlled/owned by the controller of + * the source ability + * @param additionalCardType the token gains tis card types in addition + * @param gainsHaste the token gains haste + */ public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId, CardType additionalCardType, boolean gainsHaste) { super(Outcome.PutCreatureInPlay); this.playerId = playerId; @@ -113,28 +115,19 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect { EmptyToken token = new EmptyToken(); CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer) + applier.apply(game, token); if (additionalCardType != null && !token.getCardType().contains(additionalCardType)) { token.getCardType().add(additionalCardType); } if (gainsHaste) { token.addAbility(HasteAbility.getInstance()); } + token.putOntoBattlefield(1, game, source.getSourceId(), playerId == null ? source.getControllerId() : playerId); for (UUID tokenId : token.getLastAddedTokenIds()) { // by cards like Doubling Season multiple tokens can be added to the battlefield Permanent tokenPermanent = game.getPermanent(tokenId); if (tokenPermanent != null) { addedTokenPermanents.add(tokenPermanent); - game.copyPermanent(copyFromPermanent, tokenPermanent, source, applier); - if (additionalCardType != null) { - ContinuousEffect effect = new AddCardTypeTargetEffect(additionalCardType, Duration.Custom); - effect.setTargetPointer(new FixedTarget(tokenPermanent, game)); - game.addEffect(effect, source); - } - if (gainsHaste) { - ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); - effect.setTargetPointer(new FixedTarget(tokenPermanent, game)); - game.addEffect(effect, source); - } } } return true; diff --git a/Mage/src/mage/abilities/keyword/RampageAbility.java b/Mage/src/mage/abilities/keyword/RampageAbility.java new file mode 100644 index 00000000000..f399d80f7c3 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/RampageAbility.java @@ -0,0 +1,106 @@ +/* + * 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.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.events.GameEvent; + +/** + * + * @author LoneFox + */ + +public class RampageAbility extends BecomesBlockedTriggeredAbility { + + private final String rule; + + public RampageAbility(int amount) { + super(null, false); + rule = "rampage " + amount; + RampageValue rv = new RampageValue(amount); + this.addEffect(new BoostSourceEffect(rv, rv, Duration.EndOfTurn)); + } + + public RampageAbility(final RampageAbility ability) { + super(ability); + this.rule = ability.rule; + } + + @Override + public RampageAbility copy() { + return new RampageAbility(this); + } + + @Override + public String getRule() { + return rule; + } +} + + +class RampageValue implements DynamicValue { + + private final int amount; + + public RampageValue(int amount) { + this.amount = amount; + } + + public RampageValue(final RampageValue value) { + this.amount = value.amount; + } + + @Override + public RampageValue copy() { + return new RampageValue(this); + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int count = 0; + for(CombatGroup combatGroup : game.getCombat().getGroups()) { + if(combatGroup.getAttackers().contains(sourceAbility.getSourceId())) { + int blockers = combatGroup.getBlockers().size(); + return blockers > 1 ? (blockers - 1) * amount : 0; + } + } + return 0; + } + + @Override + public String getMessage() { + return "Rampage " + amount; + } +} diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 115c36f9285..f7a2478a817 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -63,7 +63,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 41; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 34; + private static final long CARD_CONTENT_VERSION = 35; private final Random random = new Random(); private Dao cardDao; diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 92014988e09..f1d6cf8b25d 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -1464,6 +1464,7 @@ public abstract class GameImpl implements Game, Serializable { */ public boolean checkTriggered() { boolean played = false; + state.getTriggers().checkStateTriggers(this); for (UUID playerId : state.getPlayerList(state.getActivePlayerId())) { Player player = getPlayer(playerId); while (player.isInGame()) { // player can die or win caused by triggered abilities or leave the game diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java index 59d4727dbed..e60605b0892 100644 --- a/Mage/src/mage/game/permanent/token/Token.java +++ b/Mage/src/mage/game/permanent/token/Token.java @@ -137,7 +137,7 @@ public class Token extends MageObjectImpl { return false; } lastAddedTokenIds.clear(); - // TODO: Check this setCode handling because it makes no sens if token put into play with e.g. "Feldon of the third Path" + // TODO: Check this setCode handling because it makes no sense if token put into play with e.g. "Feldon of the third Path" Card source = game.getCard(sourceId); String setCode; if (this.getOriginalExpansionSetCode() != null && !this.getOriginalExpansionSetCode().isEmpty()) { diff --git a/Mage/src/mage/util/functions/AbilityApplier.java b/Mage/src/mage/util/functions/AbilityApplier.java new file mode 100644 index 00000000000..9697b3d644f --- /dev/null +++ b/Mage/src/mage/util/functions/AbilityApplier.java @@ -0,0 +1,59 @@ +/* + * 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.util.functions; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class AbilityApplier extends ApplyToPermanent { + + private final Ability ability; + + public AbilityApplier(Ability ability) { + this.ability = ability; + } + + @Override + public Boolean apply(Game game, Permanent permanent) { + permanent.addAbility(ability, game); + return true; + } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + mageObject.getAbilities().add(ability); + return true; + } + +} diff --git a/Mage/src/mage/util/functions/ApplyToMageObject.java b/Mage/src/mage/util/functions/ApplyToMageObject.java new file mode 100644 index 00000000000..0fc968079cb --- /dev/null +++ b/Mage/src/mage/util/functions/ApplyToMageObject.java @@ -0,0 +1,40 @@ +/* + * 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.util.functions; + +import mage.MageObject; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public abstract class ApplyToMageObject { + + public abstract Boolean apply(Game game, MageObject mageObject); +} diff --git a/Mage/src/mage/util/functions/ApplyToPermanent.java b/Mage/src/mage/util/functions/ApplyToPermanent.java index bd926f7a58f..6178a63f364 100644 --- a/Mage/src/mage/util/functions/ApplyToPermanent.java +++ b/Mage/src/mage/util/functions/ApplyToPermanent.java @@ -7,7 +7,7 @@ import mage.game.permanent.Permanent; /** * @author noxx */ -public abstract class ApplyToPermanent implements Serializable { +public abstract class ApplyToPermanent extends ApplyToMageObject implements Serializable { public abstract Boolean apply(Game game, Permanent permanent); } diff --git a/Mage/src/mage/util/functions/CardTypeApplier.java b/Mage/src/mage/util/functions/CardTypeApplier.java new file mode 100644 index 00000000000..dcb8eeb8c33 --- /dev/null +++ b/Mage/src/mage/util/functions/CardTypeApplier.java @@ -0,0 +1,36 @@ +/* + * 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.util.functions; + +/** + * + * @author LevelX2 + */ +public class CardTypeApplier { + +} diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index 0c1e2957d03..d7b5496320e 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -78,7 +78,7 @@ public class CopyTokenFunction implements Function { target.setOriginalExpansionSetCode(source.getExpansionSetCode()); target.setOriginalCardNumber(source.getCardNumber()); if (source instanceof Card) { - target.setCopySourceCard((Card) source); + target.setCopySourceCard(source); } } diff --git a/Mage/src/mage/util/functions/EmptyApplyToPermanent.java b/Mage/src/mage/util/functions/EmptyApplyToPermanent.java index 08ef79f6292..6deffcc5601 100644 --- a/Mage/src/mage/util/functions/EmptyApplyToPermanent.java +++ b/Mage/src/mage/util/functions/EmptyApplyToPermanent.java @@ -1,5 +1,6 @@ package mage.util.functions; +import mage.MageObject; import mage.game.Game; import mage.game.permanent.Permanent; @@ -8,8 +9,15 @@ import mage.game.permanent.Permanent; */ public class EmptyApplyToPermanent extends ApplyToPermanent { + @Override public Boolean apply(Game game, Permanent permanent) { // do nothing return true; } + + @Override + public Boolean apply(Game game, MageObject mageObject) { + return true; + } + }