From c34dd275e164db8e493a470e8f76190c646ca19e Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 08:38:43 +0300 Subject: [PATCH 001/148] Implement some Portal cards: Fire Ambush, Fire Imp, Jungle Lion, Mercenary Knight, Ogre Arsonist, and Ravaging Horde --- .../sets/masterseditioniii/FireAmbush.java | 53 ++++++++++++++ .../sets/masterseditioniii/JungleLion.java | 53 ++++++++++++++ .../mage/sets/masterseditioniv/FireImp.java | 53 ++++++++++++++ .../mage/sets/mediainserts/OgreArsonist.java | 55 +++++++++++++++ Mage.Sets/src/mage/sets/portal/FireImp.java | 69 ++++++++++++++++++ .../src/mage/sets/portal/JungleLion.java | 63 +++++++++++++++++ .../src/mage/sets/portal/MercenaryKnight.java | 69 ++++++++++++++++++ .../sets/portalsecondage/OgreArsonist.java | 70 +++++++++++++++++++ .../sets/portalthreekingdoms/FireAmbush.java | 61 ++++++++++++++++ .../portalthreekingdoms/RavagingHorde.java | 70 +++++++++++++++++++ 10 files changed, 616 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java create mode 100644 Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java create mode 100644 Mage.Sets/src/mage/sets/portal/FireImp.java create mode 100644 Mage.Sets/src/mage/sets/portal/JungleLion.java create mode 100644 Mage.Sets/src/mage/sets/portal/MercenaryKnight.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java b/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java new file mode 100644 index 00000000000..20a2913cdb7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java @@ -0,0 +1,53 @@ +/* + * 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 FireAmbush extends mage.sets.portalthreekingdoms.FireAmbush { + + public FireAmbush(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "ME3"; + } + + public FireAmbush(final FireAmbush card) { + super(card); + } + + @Override + public FireAmbush copy() { + return new FireAmbush(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java b/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java new file mode 100644 index 00000000000..3dee958c18a --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java @@ -0,0 +1,53 @@ +/* + * 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 JungleLion extends mage.sets.portal.JungleLion { + + public JungleLion(UUID ownerId) { + super(ownerId); + this.cardNumber = 125; + this.expansionSetCode = "ME3"; + } + + public JungleLion(final JungleLion card) { + super(card); + } + + @Override + public JungleLion copy() { + return new JungleLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java b/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java new file mode 100644 index 00000000000..5a61e3c4634 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java @@ -0,0 +1,53 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class FireImp extends mage.sets.portal.FireImp { + + public FireImp(UUID ownerId) { + super(ownerId); + this.cardNumber = 113; + this.expansionSetCode = "ME4"; + } + + public FireImp(final FireImp card) { + super(card); + } + + @Override + public FireImp copy() { + return new FireImp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java b/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java new file mode 100644 index 00000000000..c832c8d75a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java @@ -0,0 +1,55 @@ +/* + * 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.mediainserts; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class OgreArsonist extends mage.sets.portalsecondage.OgreArsonist { + + public OgreArsonist(UUID ownerId) { + super(ownerId); + this.cardNumber = 63; + this.expansionSetCode = "MBP"; + this.rarity = Rarity.SPECIAL; + } + + public OgreArsonist(final OgreArsonist card) { + super(card); + } + + @Override + public OgreArsonist copy() { + return new OgreArsonist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FireImp.java b/Mage.Sets/src/mage/sets/portal/FireImp.java new file mode 100644 index 00000000000..790dc35e352 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FireImp.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.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class FireImp extends CardImpl { + + public FireImp(UUID ownerId) { + super(ownerId, 131, "Fire Imp", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "POR"; + this.subtype.add("Imp"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Fire Imp enters the battlefield, it deals 2 damage to target creature. + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FireImp(final FireImp card) { + super(card); + } + + @Override + public FireImp copy() { + return new FireImp(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/JungleLion.java b/Mage.Sets/src/mage/sets/portal/JungleLion.java new file mode 100644 index 00000000000..96cc8628217 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/JungleLion.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.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class JungleLion extends CardImpl { + + public JungleLion(UUID ownerId) { + super(ownerId, 96, "Jungle Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "POR"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Jungle Lion can't block. + this.addAbility(new CantBlockAbility()); + } + + public JungleLion(final JungleLion card) { + super(card); + } + + @Override + public JungleLion copy() { + return new JungleLion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/MercenaryKnight.java b/Mage.Sets/src/mage/sets/portal/MercenaryKnight.java new file mode 100644 index 00000000000..7aba7fa471e --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/MercenaryKnight.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.portal; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LoneFox + + */ +public class MercenaryKnight extends CardImpl { + + public MercenaryKnight(UUID ownerId) { + super(ownerId, 22, "Mercenary Knight", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "POR"; + this.subtype.add("Human"); + this.subtype.add("Mercenary"); + this.subtype.add("Knight"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Mercenary Knight enters the battlefield, sacrifice it unless you discard a creature card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard("a creature card")))))); + } + + public MercenaryKnight(final MercenaryKnight card) { + super(card); + } + + @Override + public MercenaryKnight copy() { + return new MercenaryKnight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java b/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java new file mode 100644 index 00000000000..cb8e78b43f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java @@ -0,0 +1,70 @@ +/* + * 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.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + + */ +public class OgreArsonist extends CardImpl { + + public OgreArsonist(UUID ownerId) { + super(ownerId, 110, "Ogre Arsonist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Ogre Arsonist enters the battlefield, destroy target land. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + + } + + public OgreArsonist(final OgreArsonist card) { + super(card); + } + + @Override + public OgreArsonist copy() { + return new OgreArsonist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java new file mode 100644 index 00000000000..336a88dc4ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java @@ -0,0 +1,61 @@ +/* + * 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.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + + */ +public class FireAmbush extends CardImpl { + + public FireAmbush(UUID ownerId) { + super(ownerId, 111, "Fire Ambush", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "PTK"; + + // Fire Ambush deals 3 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public FireAmbush(final FireAmbush card) { + super(card); + } + + @Override + public FireAmbush copy() { + return new FireAmbush(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java new file mode 100644 index 00000000000..33c5af074f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java @@ -0,0 +1,70 @@ +/* + * 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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.EchoAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + + */ +public class RavagingHorde extends CardImpl { + + public RavagingHorde(UUID ownerId) { + super(ownerId, 118, "Ravaging Horde", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Ravaging Horde enters the battlefield, destroy target land. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public RavagingHorde(final RavagingHorde card) { + super(card); + } + + @Override + public RavagingHorde copy() { + return new RavagingHorde(this); + } +} From 0008ac01cef1bfbdabb88a4a5802c6ca729d7446 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 08:40:48 +0300 Subject: [PATCH 002/148] Implement pump knights: Knight of Stromgald, Order of Leitbur, Order of the Ebon Hand, Order of the White Shield, and White Shield Crusader --- .../sets/coldsnap/WhiteShieldCrusader.java | 86 ++++++++++++++++++ .../sets/fallenempires/OrderOfLeitbur1.java | 53 +++++++++++ .../sets/fallenempires/OrderOfLeitbur2.java | 53 +++++++++++ .../sets/fallenempires/OrderOfLeitbur3.java | 53 +++++++++++ .../fallenempires/OrderOfTheEbonHand1.java | 53 +++++++++++ .../fallenempires/OrderOfTheEbonHand2.java | 53 +++++++++++ .../fallenempires/OrderOfTheEbonHand3.java | 53 +++++++++++ .../sets/fifthedition/KnightOfStromgald.java | 53 +++++++++++ .../fifthedition/OrderOfTheWhiteShield.java | 53 +++++++++++ .../mage/sets/iceage/KnightOfStromgald.java | 86 ++++++++++++++++++ .../sets/iceage/OrderOfTheWhiteShield.java | 86 ++++++++++++++++++ .../sets/mastersedition/OrderOfLeitbur.java | 87 +++++++++++++++++++ .../mastersedition/OrderOfTheEbonHand.java | 86 ++++++++++++++++++ .../masterseditionii/KnightOfStromgald.java | 53 +++++++++++ .../OrderOfTheWhiteShield.java | 53 +++++++++++ 15 files changed, 961 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java create mode 100644 Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java create mode 100644 Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java diff --git a/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java b/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java new file mode 100644 index 00000000000..72f0081f091 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java @@ -0,0 +1,86 @@ +/* + * 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.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class WhiteShieldCrusader extends CardImpl { + + private static final FilterCard filter = new FilterCard("Black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public WhiteShieldCrusader(UUID ownerId) { + super(ownerId, 24, "White Shield Crusader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + + // {W}: White Shield Crusader gains flying until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + + // {W}{W}: White Shield Crusader gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public WhiteShieldCrusader(final WhiteShieldCrusader card) { + super(card); + } + + @Override + public WhiteShieldCrusader copy() { + return new WhiteShieldCrusader(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java new file mode 100644 index 00000000000..194a0bd052c --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfLeitbur1 extends mage.sets.mastersedition.OrderOfLeitbur { + + public OrderOfLeitbur1(UUID ownerId) { + super(ownerId); + this.cardNumber = 163; + this.expansionSetCode = "FEM"; + } + + public OrderOfLeitbur1(final OrderOfLeitbur1 card) { + super(card); + } + + @Override + public OrderOfLeitbur1 copy() { + return new OrderOfLeitbur1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java new file mode 100644 index 00000000000..360fdfe329b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfLeitbur2 extends mage.sets.mastersedition.OrderOfLeitbur { + + public OrderOfLeitbur2(UUID ownerId) { + super(ownerId); + this.cardNumber = 164; + this.expansionSetCode = "FEM"; + } + + public OrderOfLeitbur2(final OrderOfLeitbur2 card) { + super(card); + } + + @Override + public OrderOfLeitbur2 copy() { + return new OrderOfLeitbur2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java new file mode 100644 index 00000000000..1f71602dbc4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfLeitbur3 extends mage.sets.mastersedition.OrderOfLeitbur { + + public OrderOfLeitbur3(UUID ownerId) { + super(ownerId); + this.cardNumber = 165; + this.expansionSetCode = "FEM"; + } + + public OrderOfLeitbur3(final OrderOfLeitbur3 card) { + super(card); + } + + @Override + public OrderOfLeitbur3 copy() { + return new OrderOfLeitbur3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java new file mode 100644 index 00000000000..221a35d91d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfTheEbonHand1 extends mage.sets.mastersedition.OrderOfTheEbonHand { + + public OrderOfTheEbonHand1(UUID ownerId) { + super(ownerId); + this.cardNumber = 25; + this.expansionSetCode = "FEM"; + } + + public OrderOfTheEbonHand1(final OrderOfTheEbonHand1 card) { + super(card); + } + + @Override + public OrderOfTheEbonHand1 copy() { + return new OrderOfTheEbonHand1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java new file mode 100644 index 00000000000..28270bc6488 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfTheEbonHand2 extends mage.sets.mastersedition.OrderOfTheEbonHand { + + public OrderOfTheEbonHand2(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "FEM"; + } + + public OrderOfTheEbonHand2(final OrderOfTheEbonHand2 card) { + super(card); + } + + @Override + public OrderOfTheEbonHand2 copy() { + return new OrderOfTheEbonHand2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java new file mode 100644 index 00000000000..85e25ae3f45 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfTheEbonHand3 extends mage.sets.mastersedition.OrderOfTheEbonHand { + + public OrderOfTheEbonHand3(UUID ownerId) { + super(ownerId); + this.cardNumber = 27; + this.expansionSetCode = "FEM"; + } + + public OrderOfTheEbonHand3(final OrderOfTheEbonHand3 card) { + super(card); + } + + @Override + public OrderOfTheEbonHand3 copy() { + return new OrderOfTheEbonHand3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java new file mode 100644 index 00000000000..af5cc58290f --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java @@ -0,0 +1,53 @@ +/* + * 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 KnightOfStromgald extends mage.sets.iceage.KnightOfStromgald { + + public KnightOfStromgald(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "5ED"; + } + + public KnightOfStromgald(final KnightOfStromgald card) { + super(card); + } + + @Override + public KnightOfStromgald copy() { + return new KnightOfStromgald(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java new file mode 100644 index 00000000000..b131da9beef --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java @@ -0,0 +1,53 @@ +/* + * 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 OrderOfTheWhiteShield extends mage.sets.iceage.OrderOfTheWhiteShield { + + public OrderOfTheWhiteShield(UUID ownerId) { + super(ownerId); + this.cardNumber = 325; + this.expansionSetCode = "5ED"; + } + + public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) { + super(card); + } + + @Override + public OrderOfTheWhiteShield copy() { + return new OrderOfTheWhiteShield(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java new file mode 100644 index 00000000000..c923743d0be --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java @@ -0,0 +1,86 @@ +/* + * 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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class KnightOfStromgald extends CardImpl { + + private static final FilterCard filter = new FilterCard("White"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public KnightOfStromgald(UUID ownerId) { + super(ownerId, 26, "Knight of Stromgald", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from white + this.addAbility(new ProtectionAbility(filter)); + + // {B}: Knight of Stromgald gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + + // {B}{B}: Knight of Stromgald gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{B}{B}"))); + } + + public KnightOfStromgald(final KnightOfStromgald card) { + super(card); + } + + @Override + public KnightOfStromgald copy() { + return new KnightOfStromgald(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java new file mode 100644 index 00000000000..dc31f84840d --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java @@ -0,0 +1,86 @@ +/* + * 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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class OrderOfTheWhiteShield extends CardImpl { + + private static final FilterCard filter = new FilterCard("Black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public OrderOfTheWhiteShield(UUID ownerId) { + super(ownerId, 270, "Order of the White Shield", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + + // {W}: Order of the White Shield gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + + // {W}{W}: Order of the White Shield gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) { + super(card); + } + + @Override + public OrderOfTheWhiteShield copy() { + return new OrderOfTheWhiteShield(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java b/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java new file mode 100644 index 00000000000..fae1e77830f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java @@ -0,0 +1,87 @@ +/* + * 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.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class OrderOfLeitbur extends CardImpl { + + private static final FilterCard filter = new FilterCard("Black"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public OrderOfLeitbur(UUID ownerId) { + super(ownerId, 22, "Order of Leitbur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{W}"); + this.expansionSetCode = "MED"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from black + this.addAbility(new ProtectionAbility(filter)); + + // {W}: Order of Leitbur gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}"))); + + // {W}{W}: Order of Leitbur gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public OrderOfLeitbur(final OrderOfLeitbur card) { + super(card); + } + + @Override + public OrderOfLeitbur copy() { + return new OrderOfLeitbur(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java b/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java new file mode 100644 index 00000000000..2bbbd28ddca --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java @@ -0,0 +1,86 @@ +/* + * 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.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; + +/** + * + * @author LoneFox + + */ +public class OrderOfTheEbonHand extends CardImpl { + + private static final FilterCard filter = new FilterCard("White"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + + public OrderOfTheEbonHand(UUID ownerId) { + super(ownerId, 78, "Order of the Ebon Hand", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "MED"; + this.subtype.add("Cleric"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Protection from white + this.addAbility(new ProtectionAbility(filter)); + + // {B}: Order of the Ebon Hand gains first strike until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}"))); + + // {B}{B}: Order of the Ebon Hand gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{B}{B}"))); + } + + public OrderOfTheEbonHand(final OrderOfTheEbonHand card) { + super(card); + } + + @Override + public OrderOfTheEbonHand copy() { + return new OrderOfTheEbonHand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java new file mode 100644 index 00000000000..221d23aee70 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java @@ -0,0 +1,53 @@ +/* + * 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; + +/** + * + * @author LoneFox + + */ +public class KnightOfStromgald extends mage.sets.iceage.KnightOfStromgald { + + public KnightOfStromgald(UUID ownerId) { + super(ownerId); + this.cardNumber = 99; + this.expansionSetCode = "ME2"; + } + + public KnightOfStromgald(final KnightOfStromgald card) { + super(card); + } + + @Override + public KnightOfStromgald copy() { + return new KnightOfStromgald(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java new file mode 100644 index 00000000000..0f056198a83 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java @@ -0,0 +1,53 @@ +/* + * 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; + +/** + * + * @author LoneFox + + */ +public class OrderOfTheWhiteShield extends mage.sets.iceage.OrderOfTheWhiteShield { + + public OrderOfTheWhiteShield(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "ME2"; + } + + public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) { + super(card); + } + + @Override + public OrderOfTheWhiteShield copy() { + return new OrderOfTheWhiteShield(this); + } +} From 658daa65e3d86a936682992564e2e18c3a680bc1 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 08:43:12 +0300 Subject: [PATCH 003/148] Fix typo --- .../deckeditor/collection/viewer/CollectionViewerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java index 69563a64746..fee877ac688 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java @@ -44,7 +44,7 @@ public class CollectionViewerPane extends MagePane { public CollectionViewerPane() { boolean initialized = false; - this.setTitle("Collection Viewier"); + this.setTitle("Collection Viewer"); if (Plugins.getInstance().isThemePluginLoaded()) { Map uiComponents = new HashMap(); JComponent container = Plugins.getInstance().updateTablePanel(uiComponents); From 90486afdbb53695a1da76909cdccbc4965174efe Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 09:17:05 +0300 Subject: [PATCH 004/148] If saving a thumbnail image fails, delete the resulting file. OpenJDK throws "javax.imageio.IIOException: Invalid argument to native writeImage", because it does not support transparency, and that results in zero-sized thumbnail files being created. --- .../mage/plugins/card/images/ImageCache.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java index 08cb77829f1..33cbb1a7dbe 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java @@ -27,11 +27,11 @@ import org.mage.plugins.card.utils.CardImageUtils; * This class stores ALL card images in a cache with soft values. this means * that the images may be garbage collected when they are not needed any more, but will * be kept as long as possible. - * + * * Key format: "####" - * + * * where param is: - * + * *
    *
  • #Normal: request for unrotated image
  • *
  • #Tapped: request for rotated image
  • @@ -56,7 +56,7 @@ public class ImageCache { @Override public BufferedImage apply(String key) { try { - + boolean usesVariousArt = false; if (key.endsWith("#usesVariousArt")) { usesVariousArt = true; @@ -111,7 +111,7 @@ public class ImageCache { } catch(Exception ex) { exists = false; } - } + } if (exists) { log.debug("loading thumbnail for " + key + ", path="+thumbnailPath); return loadImage(thumbnailFile); @@ -150,7 +150,7 @@ public class ImageCache { return null; } TFile file = getTFile(path); - return loadImage(file); + return loadImage(file); } public static BufferedImage getManifestImage() { @@ -159,7 +159,7 @@ public class ImageCache { String path = CardImageUtils.generateTokenImagePath(info); if (path == null) { return null; - } + } TFile file = getTFile(path); return loadImage(file); } @@ -219,7 +219,7 @@ public class ImageCache { private static BufferedImage getImage(String key) { try { BufferedImage image = imageCache.get(key); - return image; + return image; } catch (NullPointerException ex) { // unfortunately NullOutputException, thrown when apply() returns // null, is not public @@ -261,7 +261,7 @@ public class ImageCache { /** * Load image from file - * + * * @param file * file to load image from * @return {@link BufferedImage} @@ -298,6 +298,7 @@ public class ImageCache { } } catch (IOException e) { log.error(e,e); + imageFile.delete(); } return image; } @@ -382,7 +383,7 @@ public class ImageCache { return getFullSizeImage(original, scale); } - + public static TFile getTFile(String path) { try { TFile file = new TFile(path); @@ -390,6 +391,6 @@ public class ImageCache { } catch (NullPointerException ex) { log.warn("Imagefile does not exist: " + path); } - return null; + return null; } } From 0af411ff6c43af9936317ff202f4d029c4ea50ab Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 10:06:58 +0300 Subject: [PATCH 005/148] Implement cards: Orcish Cannoneers, Soldevi Simulacrum, Yavimaya Ants --- .../src/mage/sets/alliances/YavimayaAnts.java | 70 ++++++++++++++++++ .../mage/sets/iceage/OrcishCannoneers.java | 72 +++++++++++++++++++ .../mage/sets/iceage/SoldeviSimulacrum.java | 53 ++++++++++++++ .../sets/mastersedition/YavimayaAnts.java | 53 ++++++++++++++ .../masterseditionii/OrcishCannoneers.java | 53 ++++++++++++++ .../masterseditionii/SoldeviSimulacrum.java | 70 ++++++++++++++++++ 6 files changed, 371 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java create mode 100644 Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java create mode 100644 Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java new file mode 100644 index 00000000000..db233aee603 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java @@ -0,0 +1,70 @@ +/* + * 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.TrampleAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class YavimayaAnts extends CardImpl { + + public YavimayaAnts(UUID ownerId) { + super(ownerId, 93, "Yavimaya Ants", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Insect"); + this.power = new MageInt(5); + this.toughness = new MageInt(1); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Haste + this.addAbility(HasteAbility.getInstance()); + // Cumulative upkeep {G}{G} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{G}{G}"))); + } + + public YavimayaAnts(final YavimayaAnts card) { + super(card); + } + + @Override + public YavimayaAnts copy() { + return new YavimayaAnts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java new file mode 100644 index 00000000000..ef0cebf67d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.iceage; + +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.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 OrcishCannoneers extends CardImpl { + + public OrcishCannoneers(UUID ownerId) { + super(ownerId, 205, "Orcish Cannoneers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Orc"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // {tap}: Orcish Cannoneers deals 2 damage to target creature or player and 3 damage to you. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); + ability.addEffect(new DamageControllerEffect(3)); + this.addAbility(ability); + } + + public OrcishCannoneers(final OrcishCannoneers card) { + super(card); + } + + @Override + public OrcishCannoneers copy() { + return new OrcishCannoneers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java b/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java new file mode 100644 index 00000000000..a79829b58e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java @@ -0,0 +1,53 @@ +/* + * 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.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class SoldeviSimulacrum extends mage.sets.masterseditionii.SoldeviSimulacrum { + + public SoldeviSimulacrum(UUID ownerId) { + super(ownerId); + this.cardNumber = 314; + this.expansionSetCode = "ICE"; + } + + public SoldeviSimulacrum(final SoldeviSimulacrum card) { + super(card); + } + + @Override + public SoldeviSimulacrum copy() { + return new SoldeviSimulacrum(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java b/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java new file mode 100644 index 00000000000..d91f842e169 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java @@ -0,0 +1,53 @@ +/* + * 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 YavimayaAnts extends mage.sets.alliances.YavimayaAnts { + + public YavimayaAnts(UUID ownerId) { + super(ownerId); + this.cardNumber = 140; + this.expansionSetCode = "MED"; + } + + public YavimayaAnts(final YavimayaAnts card) { + super(card); + } + + @Override + public YavimayaAnts copy() { + return new YavimayaAnts(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java b/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java new file mode 100644 index 00000000000..ad2ace68f89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java @@ -0,0 +1,53 @@ +/* + * 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; + +/** + * + * @author LoneFox + + */ +public class OrcishCannoneers extends mage.sets.iceage.OrcishCannoneers { + + public OrcishCannoneers(UUID ownerId) { + super(ownerId); + this.cardNumber = 138; + this.expansionSetCode = "ME2"; + } + + public OrcishCannoneers(final OrcishCannoneers card) { + super(card); + } + + @Override + public OrcishCannoneers copy() { + return new OrcishCannoneers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java b/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java new file mode 100644 index 00000000000..9dd318919b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java @@ -0,0 +1,70 @@ +/* + * 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.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class SoldeviSimulacrum extends CardImpl { + + public SoldeviSimulacrum(UUID ownerId) { + super(ownerId, 222, "Soldevi Simulacrum", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(4); + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // {1}: Soldevi Simulacrum gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{1}"))); + } + + public SoldeviSimulacrum(final SoldeviSimulacrum card) { + super(card); + } + + @Override + public SoldeviSimulacrum copy() { + return new SoldeviSimulacrum(this); + } +} From 18cc8735d660d73db68860beccb2bf1eb2c781e3 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 11:08:55 +0300 Subject: [PATCH 006/148] Implement cards: Disrupt, Guided Strike, Spiketail Drakeling, Symbiosis --- Mage.Sets/src/mage/sets/invasion/Disrupt.java | 77 +++++++++++++++++++ .../src/mage/sets/judgment/GuidedStrike.java | 53 +++++++++++++ .../sets/timespiral/SpiketailDrakeling.java | 75 ++++++++++++++++++ .../src/mage/sets/urzassaga/Symbiosis.java | 62 +++++++++++++++ .../src/mage/sets/weatherlight/Disrupt.java | 55 +++++++++++++ .../mage/sets/weatherlight/GuidedStrike.java | 68 ++++++++++++++++ 6 files changed, 390 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/invasion/Disrupt.java create mode 100644 Mage.Sets/src/mage/sets/judgment/GuidedStrike.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java create mode 100644 Mage.Sets/src/mage/sets/weatherlight/Disrupt.java create mode 100644 Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java diff --git a/Mage.Sets/src/mage/sets/invasion/Disrupt.java b/Mage.Sets/src/mage/sets/invasion/Disrupt.java new file mode 100644 index 00000000000..8a4718a3498 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/Disrupt.java @@ -0,0 +1,77 @@ +/* + * 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.invasion; + +import java.util.UUID; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + + */ +public class Disrupt extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); + } + + public Disrupt(UUID ownerId) { + super(ownerId, 51, "Disrupt", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "INV"; + + // Counter target instant or sorcery spell unless its controller pays {1}. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1))); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Disrupt(final Disrupt card) { + super(card); + } + + @Override + public Disrupt copy() { + return new Disrupt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java b/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java new file mode 100644 index 00000000000..7545602758c --- /dev/null +++ b/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java @@ -0,0 +1,53 @@ +/* + * 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.judgment; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class GuidedStrike extends mage.sets.weatherlight.GuidedStrike { + + public GuidedStrike(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "JUD"; + } + + public GuidedStrike(final GuidedStrike card) { + super(card); + } + + @Override + public GuidedStrike copy() { + return new GuidedStrike(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java b/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java new file mode 100644 index 00000000000..68b414e1ef1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.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.timespiral; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetSpell; + +/** + * + * @author LoneFox + + */ +public class SpiketailDrakeling extends CardImpl { + + public SpiketailDrakeling(UUID ownerId) { + super(ownerId, 80, "Spiketail Drakeling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Drake"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Sacrifice Spiketail Drakeling: Counter target spell unless its controller pays {2}. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2)), new SacrificeSourceCost()); ability.addTarget(new TargetSpell()); + this.addAbility(ability); + + } + + public SpiketailDrakeling(final SpiketailDrakeling card) { + super(card); + } + + @Override + public SpiketailDrakeling copy() { + return new SpiketailDrakeling(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java b/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java new file mode 100644 index 00000000000..36f382eaba4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.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.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class Symbiosis extends CardImpl { + + public Symbiosis(UUID ownerId) { + super(ownerId, 275, "Symbiosis", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); + this.expansionSetCode = "USG"; + + // Two target creatures each get +2/+2 until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); + } + + public Symbiosis(final Symbiosis card) { + super(card); + } + + @Override + public Symbiosis copy() { + return new Symbiosis(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java b/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java new file mode 100644 index 00000000000..2e32076e0b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java @@ -0,0 +1,55 @@ +/* + * 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.weatherlight; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class Disrupt extends mage.sets.invasion.Disrupt { + + public Disrupt(UUID ownerId) { + super(ownerId); + this.cardNumber = 37; + this.expansionSetCode = "WTH"; + this.rarity = Rarity.COMMON; + } + + public Disrupt(final Disrupt card) { + super(card); + } + + @Override + public Disrupt copy() { + return new Disrupt(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java new file mode 100644 index 00000000000..ed0d7f126bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.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.weatherlight; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; + +/** + * + * @author LoneFox + + */ +public class GuidedStrike extends CardImpl { + + public GuidedStrike(UUID ownerId) { + super(ownerId, 132, "Guided Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "WTH"; + + // Target creature gets +1/+0 and gains first strike until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1)); + this.getSpellAbility().addEffect(new BoostTargetEffect(1, 0, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public GuidedStrike(final GuidedStrike card) { + super(card); + } + + @Override + public GuidedStrike copy() { + return new GuidedStrike(this); + } +} From da6209f21fdcaa08c76578d373ea83589baf3604 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 11:59:12 +0300 Subject: [PATCH 007/148] Add missing image variants for Goblin Grenade, Hymn to Tourach, Icatian Javelineers, and Night Soil --- .../mage/sets/commander2013/NightSoil.java | 2 +- .../elspethvskiora/IcatianJavelineers.java | 2 +- ...GoblinGrenade.java => GoblinGrenade1.java} | 10 ++-- .../sets/fallenempires/GoblinGrenade2.java | 54 ++++++++++++++++++ .../sets/fallenempires/GoblinGrenade3.java | 54 ++++++++++++++++++ ...HymnToTourach.java => HymnToTourach1.java} | 10 ++-- .../sets/fallenempires/HymnToTourach2.java | 56 +++++++++++++++++++ .../sets/fallenempires/HymnToTourach3.java | 56 +++++++++++++++++++ .../sets/fallenempires/HymnToTourach4.java | 56 +++++++++++++++++++ ...elineers.java => IcatianJavelineers1.java} | 10 ++-- .../fallenempires/IcatianJavelineers2.java | 52 +++++++++++++++++ .../fallenempires/IcatianJavelineers3.java | 52 +++++++++++++++++ .../{NightSoil.java => NightSoil1.java} | 10 ++-- .../mage/sets/fallenempires/NightSoil2.java | 52 +++++++++++++++++ .../mage/sets/fallenempires/NightSoil3.java | 52 +++++++++++++++++ .../sets/mastersedition/HymnToTourach.java | 2 +- .../masterseditionii/IcatianJavelineers.java | 2 +- .../mage/sets/masterseditionii/NightSoil.java | 2 +- .../sets/timeshifted/IcatianJavelineers.java | 2 +- .../sets/vintagemasters/HymnToTourach.java | 2 +- .../sets/wpngateway/IcatianJavelineers.java | 2 +- 21 files changed, 512 insertions(+), 28 deletions(-) rename Mage.Sets/src/mage/sets/fallenempires/{GoblinGrenade.java => GoblinGrenade1.java} (86%) create mode 100644 Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.java rename Mage.Sets/src/mage/sets/fallenempires/{HymnToTourach.java => HymnToTourach1.java} (91%) create mode 100644 Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java rename Mage.Sets/src/mage/sets/fallenempires/{IcatianJavelineers.java => IcatianJavelineers1.java} (93%) create mode 100644 Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java rename Mage.Sets/src/mage/sets/fallenempires/{NightSoil.java => NightSoil1.java} (91%) create mode 100644 Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java create mode 100644 Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java diff --git a/Mage.Sets/src/mage/sets/commander2013/NightSoil.java b/Mage.Sets/src/mage/sets/commander2013/NightSoil.java index b7e0c197361..b83edbc8648 100644 --- a/Mage.Sets/src/mage/sets/commander2013/NightSoil.java +++ b/Mage.Sets/src/mage/sets/commander2013/NightSoil.java @@ -33,7 +33,7 @@ import java.util.UUID; * * @author LevelX2 */ -public class NightSoil extends mage.sets.fallenempires.NightSoil { +public class NightSoil extends mage.sets.fallenempires.NightSoil1 { public NightSoil(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java index 259b571d0da..bbde1977f58 100644 --- a/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java +++ b/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java @@ -33,7 +33,7 @@ import java.util.UUID; * * @author fireshoes */ -public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers { +public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 { public IcatianJavelineers(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java similarity index 86% rename from Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java rename to Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java index 0396099817d..9a8e8e4cf68 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java +++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java @@ -34,21 +34,21 @@ import mage.constants.Rarity; * * @author North */ -public class GoblinGrenade extends mage.sets.magic2012.GoblinGrenade { +public class GoblinGrenade1 extends mage.sets.magic2012.GoblinGrenade { - public GoblinGrenade(UUID ownerId) { + public GoblinGrenade1(UUID ownerId) { super(ownerId); this.cardNumber = 114; this.expansionSetCode = "FEM"; this.rarity = Rarity.COMMON; } - public GoblinGrenade(final GoblinGrenade card) { + public GoblinGrenade1(final GoblinGrenade1 card) { super(card); } @Override - public GoblinGrenade copy() { - return new GoblinGrenade(this); + public GoblinGrenade1 copy() { + return new GoblinGrenade1(this); } } diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.java new file mode 100644 index 00000000000..a62d5202ee2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.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.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class GoblinGrenade2 extends mage.sets.magic2012.GoblinGrenade { + + public GoblinGrenade2(UUID ownerId) { + super(ownerId); + this.cardNumber = 115; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.COMMON; + } + + public GoblinGrenade2(final GoblinGrenade2 card) { + super(card); + } + + @Override + public GoblinGrenade2 copy() { + return new GoblinGrenade2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.java new file mode 100644 index 00000000000..752f2d3062c --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.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.fallenempires; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author North + */ +public class GoblinGrenade3 extends mage.sets.magic2012.GoblinGrenade { + + public GoblinGrenade3(UUID ownerId) { + super(ownerId); + this.cardNumber = 116; + this.expansionSetCode = "FEM"; + this.rarity = Rarity.COMMON; + } + + public GoblinGrenade3(final GoblinGrenade3 card) { + super(card); + } + + @Override + public GoblinGrenade3 copy() { + return new GoblinGrenade3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java similarity index 91% rename from Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java rename to Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java index 314a045ff79..ae9ec58249c 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java +++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java @@ -38,9 +38,9 @@ import mage.target.TargetPlayer; * * @author jonubuu */ -public class HymnToTourach extends CardImpl { +public class HymnToTourach1 extends CardImpl { - public HymnToTourach(UUID ownerId) { + public HymnToTourach1(UUID ownerId) { super(ownerId, 12, "Hymn to Tourach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}"); this.expansionSetCode = "FEM"; @@ -50,12 +50,12 @@ public class HymnToTourach extends CardImpl { this.getSpellAbility().addTarget(new TargetPlayer()); } - public HymnToTourach(final HymnToTourach card) { + public HymnToTourach1(final HymnToTourach1 card) { super(card); } @Override - public HymnToTourach copy() { - return new HymnToTourach(this); + public HymnToTourach1 copy() { + return new HymnToTourach1(this); } } diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java new file mode 100644 index 00000000000..e500765ff1d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java @@ -0,0 +1,56 @@ +/* + * 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; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author jonubuu + */ +public class HymnToTourach2 extends mage.sets.fallenempires.HymnToTourach1 { + + public HymnToTourach2(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + } + + public HymnToTourach2(final HymnToTourach2 card) { + super(card); + } + + @Override + public HymnToTourach2 copy() { + return new HymnToTourach2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java new file mode 100644 index 00000000000..b48d4ff5517 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java @@ -0,0 +1,56 @@ +/* + * 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; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author jonubuu + */ +public class HymnToTourach3 extends mage.sets.fallenempires.HymnToTourach1 { + + public HymnToTourach3(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + } + + public HymnToTourach3(final HymnToTourach3 card) { + super(card); + } + + @Override + public HymnToTourach3 copy() { + return new HymnToTourach3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java new file mode 100644 index 00000000000..591b97f8789 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java @@ -0,0 +1,56 @@ +/* + * 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; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author jonubuu + */ +public class HymnToTourach4 extends mage.sets.fallenempires.HymnToTourach1 { + + public HymnToTourach4(UUID ownerId) { + super(ownerId); + this.cardNumber = 15; + } + + public HymnToTourach4(final HymnToTourach4 card) { + super(card); + } + + @Override + public HymnToTourach4 copy() { + return new HymnToTourach4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java similarity index 93% rename from Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java rename to Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java index e525ddff687..a3a36e41680 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java @@ -47,9 +47,9 @@ import mage.target.common.TargetCreatureOrPlayer; * * @author fireshoes */ -public class IcatianJavelineers extends CardImpl { +public class IcatianJavelineers1 extends CardImpl { - public IcatianJavelineers(UUID ownerId) { + public IcatianJavelineers1(UUID ownerId) { super(ownerId, 148, "Icatian Javelineers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); this.expansionSetCode = "FEM"; this.subtype.add("Human"); @@ -67,12 +67,12 @@ public class IcatianJavelineers extends CardImpl { this.addAbility(ability); } - public IcatianJavelineers(final IcatianJavelineers card) { + public IcatianJavelineers1(final IcatianJavelineers1 card) { super(card); } @Override - public IcatianJavelineers copy() { - return new IcatianJavelineers(this); + public IcatianJavelineers1 copy() { + return new IcatianJavelineers1(this); } } diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.java new file mode 100644 index 00000000000..793fe6afae1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.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.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class IcatianJavelineers2 extends mage.sets.fallenempires.IcatianJavelineers1 { + + public IcatianJavelineers2(UUID ownerId) { + super(ownerId); + this.cardNumber = 149; + } + + public IcatianJavelineers2(final IcatianJavelineers2 card) { + super(card); + } + + @Override + public IcatianJavelineers2 copy() { + return new IcatianJavelineers2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java new file mode 100644 index 00000000000..85649357295 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.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.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class IcatianJavelineers3 extends mage.sets.fallenempires.IcatianJavelineers1 { + + public IcatianJavelineers3(UUID ownerId) { + super(ownerId); + this.cardNumber = 150; + } + + public IcatianJavelineers3(final IcatianJavelineers3 card) { + super(card); + } + + @Override + public IcatianJavelineers3 copy() { + return new IcatianJavelineers3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java similarity index 91% rename from Mage.Sets/src/mage/sets/fallenempires/NightSoil.java rename to Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java index aa9118664a2..f31f9bfcb00 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/NightSoil.java +++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java @@ -45,9 +45,9 @@ import mage.target.common.TargetCardInASingleGraveyard; * * @author LevelX2 */ -public class NightSoil extends CardImpl { +public class NightSoil1 extends CardImpl { - public NightSoil(UUID ownerId) { + public NightSoil1(UUID ownerId) { super(ownerId, 80, "Night Soil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); this.expansionSetCode = "FEM"; @@ -58,12 +58,12 @@ public class NightSoil extends CardImpl { this.addAbility(ability); } - public NightSoil(final NightSoil card) { + public NightSoil1(final NightSoil1 card) { super(card); } @Override - public NightSoil copy() { - return new NightSoil(this); + public NightSoil1 copy() { + return new NightSoil1(this); } } diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java new file mode 100644 index 00000000000..09706ba97b5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.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.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class NightSoil2 extends mage.sets.fallenempires.NightSoil1 { + + public NightSoil2(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + } + + public NightSoil2(final NightSoil2 card) { + super(card); + } + + @Override + public NightSoil2 copy() { + return new NightSoil2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java new file mode 100644 index 00000000000..7289331f5f6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.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.masterseditionii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class NightSoil3 extends mage.sets.fallenempires.NightSoil1 { + + public NightSoil3(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + } + + public NightSoil3(final NightSoil3 card) { + super(card); + } + + @Override + public NightSoil3 copy() { + return new NightSoil3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java b/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java index 1d8d6d5d373..21e4af02e9f 100644 --- a/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java +++ b/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author LevelX2 */ -public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach { +public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach1 { public HymnToTourach(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java index cd8d2c60232..5df5c74144e 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java @@ -33,7 +33,7 @@ import java.util.UUID; * * @author LevelX2 */ -public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers { +public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 { public IcatianJavelineers(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java b/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java index bfd1a3da304..17998657fbb 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author LevelX2 */ -public class NightSoil extends mage.sets.fallenempires.NightSoil { +public class NightSoil extends mage.sets.fallenempires.NightSoil1 { public NightSoil(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java index 39aa3d2541f..c2868996632 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java +++ b/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author fireshoes */ -public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers { +public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 { public IcatianJavelineers(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java b/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java index 8d891d3d838..c2aabdb54e0 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author LevelX2 */ -public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach { +public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach1 { public HymnToTourach(UUID ownerId) { super(ownerId); diff --git a/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java index dab3bbbc363..c70e020699e 100644 --- a/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java +++ b/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java @@ -34,7 +34,7 @@ import mage.constants.Rarity; * * @author fireshoes */ -public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers { +public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 { public IcatianJavelineers(UUID ownerId) { super(ownerId); From 81108be3466ad55ebbc1ae11895c512013b1f663 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 13:08:17 +0300 Subject: [PATCH 008/148] Fix Guided Strike tooltip text --- Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java index ed0d7f126bf..3728ecb59e9 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java +++ b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java @@ -30,6 +30,7 @@ package mage.sets.weatherlight; import java.util.UUID; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.Effect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -51,8 +52,12 @@ public class GuidedStrike extends CardImpl { // Target creature gets +1/+0 and gains first strike until end of turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1)); - this.getSpellAbility().addEffect(new BoostTargetEffect(1, 0, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn)); + Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+0"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains first strike until end of turn"); + this.getSpellAbility().addEffect(effect); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } From 3d59c57b0e4f36ce1c003b7b374630951dda2c19 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 14:23:55 +0300 Subject: [PATCH 009/148] Fix NullPointerException when a random discard effect is applied to a player with empty hand. --- Mage/src/mage/players/PlayerImpl.java | 68 ++++++++++++++------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index a9fb708017f..79702411d24 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -216,14 +216,14 @@ public abstract class PlayerImpl implements Player, Serializable { protected boolean topCardRevealed = false; // 800.4i When a player leaves the game, any continuous effects with durations that last until that player's next turn - // or until a specific point in that turn will last until that turn would have begun. + // or until a specific point in that turn will last until that turn would have begun. // They neither expire immediately nor last indefinitely. protected boolean reachedNextTurnAfterLeaving = false; // indicates that the spell with the set sourceId can be cast with an alternate mana costs (can also be no mana costs) protected UUID castSourceIdWithAlternateMana; protected ManaCosts castSourceIdManaCosts; - + // indicates that the player is in mana payment phase protected boolean payManaMode = false; @@ -369,7 +369,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.canPaySacrificeCost = player.canPaySacrificeCost(); this.loseByZeroOrLessLife = player.canLoseByZeroOrLessLife(); this.canPlayCardsFromGraveyard = player.canPlayCardsFromGraveyard(); - this.alternativeSourceCosts.addAll(player.getAlternativeSourceCosts()); + this.alternativeSourceCosts.addAll(player.getAlternativeSourceCosts()); this.topCardRevealed = player.isTopCardRevealed(); this.playersUnderYourControl.clear(); @@ -444,7 +444,7 @@ public abstract class PlayerImpl implements Player, Serializable { this.payManaMode = false; this.setLife(game.getLife(), game); this.setReachedNextTurnAfterLeaving(false); - + this.castSourceIdWithAlternateMana = null; this.castSourceIdManaCosts = null; } @@ -575,7 +575,7 @@ public abstract class PlayerImpl implements Player, Serializable { /** * returns true if the player has the control itself - false if the player is controlled by another player - * @return + * @return */ @Override public boolean isGameUnderControl() { @@ -704,8 +704,10 @@ public abstract class PlayerImpl implements Player, Serializable { if (random) { for (int i = 0; i < amount; i++) { Card card = this.getHand().getRandom(game); - discardedCards.add(card); - discard(card, source, game); + if(card != null) { + discardedCards.add(card); + discard(card, source, game); + } } } else { TargetDiscard target = new TargetDiscard(amount, amount, new FilterCard(CardUtil.numberToText(amount, "a") + " card" + (amount > 1 ? "s" : "")), playerId); @@ -802,7 +804,7 @@ public abstract class PlayerImpl implements Player, Serializable { attachedToPlayer.removeAttachment(permanent, game); } } - + } if (permanent.getPairedCard() != null) { Permanent pairedCard = game.getPermanent(permanent.getPairedCard()); @@ -876,7 +878,7 @@ public abstract class PlayerImpl implements Player, Serializable { while (isInGame() && cards.size() > 1) { this.choose(Outcome.Neutral, cards, target, game); UUID targetObjectId = target.getFirstTarget(); - cards.remove(targetObjectId); + cards.remove(targetObjectId); moveObjectToLibrary(targetObjectId, source.getSourceId(), game, true, false); target.clearChosen(); } @@ -917,7 +919,7 @@ public abstract class PlayerImpl implements Player, Serializable { return castSourceIdManaCosts; } - + @Override public boolean isInPayManaMode() { return payManaMode; @@ -947,7 +949,7 @@ public abstract class PlayerImpl implements Player, Serializable { spellAbility.getManaCosts().add(alternateCosts.copy()); spellAbility.getManaCostsToPay().clear(); spellAbility.getManaCostsToPay().add(alternateCosts.copy()); - } + } } setCastSourceIdWithAlternateMana(null, null); if (spell.activate(game, noMana)) { @@ -1528,7 +1530,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public String getLogName() { - return GameLog.getColoredPlayerName(name); + return GameLog.getColoredPlayerName(name); } @Override @@ -1669,11 +1671,11 @@ public abstract class PlayerImpl implements Player, Serializable { sourceControllerId = ((Spell) source).getControllerId(); } else if (source instanceof Card) { sourceAbilities = ((Card) source).getAbilities(game); - sourceControllerId = ((Card) source).getOwnerId(); + sourceControllerId = ((Card) source).getOwnerId(); } else if (source instanceof CommandObject){ sourceControllerId = ((CommandObject) source).getControllerId(); sourceAbilities = ((CommandObject) source).getAbilities(); - } + } } else { sourceAbilities = ((Permanent) source).getAbilities(game); sourceControllerId = ((Permanent) source).getControllerId(); @@ -2426,7 +2428,7 @@ public abstract class PlayerImpl implements Player, Serializable { if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) { for (Ability ability : card.getAbilities()) { if (ability.getZone().match(Zone.HAND)) { - ability.setControllerId(this.getId()); // controller must be set for case owner != caster + ability.setControllerId(this.getId()); // controller must be set for case owner != caster if (ability instanceof ActivatedAbility) { if (((ActivatedAbility) ability).canActivate(playerId, game)) { playable.add(ability); @@ -2537,7 +2539,7 @@ public abstract class PlayerImpl implements Player, Serializable { * @return */ private boolean shouldSkipGettingPlayable(Game game) { - if (game.getStep() == null) { // happens at the start of the game + if (game.getStep() == null) { // happens at the start of the game return true; } for (Entry phaseStep : silentPhaseSteps.entrySet()) { @@ -2841,16 +2843,16 @@ public abstract class PlayerImpl implements Player, Serializable { cardList.addAll(cards.getCards(game)); return moveCards(cardList, fromZone, toZone, source, game); } - + @Override public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game) { ArrayList cardList = new ArrayList<>(); if (card != null) { cardList.add(card); } - return moveCards(cardList, fromZone, toZone, source, game); + return moveCards(cardList, fromZone, toZone, source, game); } - + @Override public boolean moveCards(List cards, Zone fromZone, Zone toZone, Ability source, Game game) { if (cards.isEmpty()) { @@ -2858,13 +2860,13 @@ public abstract class PlayerImpl implements Player, Serializable { } game.fireEvent(new ZoneChangeGroupEvent(cards, source == null ? null : source.getSourceId(), this.getId(), fromZone, toZone)); switch(toZone) { - case EXILED: + case EXILED: boolean result = false; for(Card card: cards) { result |= moveCardToExileWithInfo(card, null, "", source == null ? null : source.getSourceId(), game, fromZone, true); } - return result; - case GRAVEYARD: + return result; + case GRAVEYARD: return moveCardsToGraveyardWithInfo(cards, source, game, fromZone); case HAND: result = false; @@ -2874,9 +2876,9 @@ public abstract class PlayerImpl implements Player, Serializable { return result; default: throw new UnsupportedOperationException("to Zone not supported yet"); - } + } } - + @Override public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) { return this.moveCardToHandWithInfo(card, sourceId, game, fromZone, true); @@ -2898,7 +2900,7 @@ public abstract class PlayerImpl implements Player, Serializable { default: sb.append(fromZone != null ? new StringBuilder(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : ""); break; - } + } sb.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand"); game.informPlayers(sb.toString()); } @@ -2906,10 +2908,10 @@ public abstract class PlayerImpl implements Player, Serializable { } return result; } - + @Override public boolean moveCardsToGraveyardWithInfo(List allCards, Ability source, Game game, Zone fromZone) { - boolean result = true; + boolean result = true; UUID sourceId = source == null ? null : source.getSourceId(); while (!allCards.isEmpty()) { // identify cards from one owner @@ -2943,10 +2945,10 @@ public abstract class PlayerImpl implements Player, Serializable { target.setRequired(true); while (choosingPlayer.isInGame() && cards.size() > 1) { choosingPlayer.chooseTarget(Outcome.Neutral, cards, target, source, game); - UUID targetObjectId = target.getFirstTarget(); + UUID targetObjectId = target.getFirstTarget(); Card card = cards.get(targetObjectId, game); - cards.remove(targetObjectId); - if (card != null) { + cards.remove(targetObjectId); + if (card != null) { result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone); } target.clearChosen(); @@ -2959,11 +2961,11 @@ public abstract class PlayerImpl implements Player, Serializable { result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone); } } - } + } } return result; } - + @Override public boolean moveCardToGraveyardWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) { boolean result = false; @@ -3045,7 +3047,7 @@ public abstract class PlayerImpl implements Player, Serializable { public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped) { return this.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, tapped, false); } - + @Override public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped, boolean facedown) { boolean result = false; From eaf7e591831c3ab6a1e6aa4b906565a3763e29a3 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 11 Jun 2015 14:25:07 +0300 Subject: [PATCH 010/148] Implement cards: Phyrexian Scuta, Power Matrix, and Sinister Strength --- .../sets/mercadianmasques/PowerMatrix.java | 83 ++++++++++++++++++ .../mage/sets/planeshift/PhyrexianScuta.java | 71 ++++++++++++++++ .../sets/planeshift/SinisterStrength.java | 85 +++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java new file mode 100644 index 00000000000..753c475ff9b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java @@ -0,0 +1,83 @@ +/* + * 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.mercadianmasques; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.Effect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +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 PowerMatrix extends CardImpl { + + public PowerMatrix(UUID ownerId) { + super(ownerId, 309, "Power Matrix", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "MMQ"; + + // {tap}: Target creature gets +1/+1 and gains flying, first strike, and trample until end of turn. + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+1"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); + effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying,"); + ability.addEffect(effect); + effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); + effect.setText("first strike,"); + ability.addEffect(effect); + effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and trample until end of turn."); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public PowerMatrix(final PowerMatrix card) { + super(card); + } + + @Override + public PowerMatrix copy() { + return new PowerMatrix(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java new file mode 100644 index 00000000000..5a43de13839 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; + +/** + * + * @author LoneFox + + */ +public class PhyrexianScuta extends CardImpl { + + public PhyrexianScuta(UUID ownerId) { + super(ownerId, 51, "Phyrexian Scuta", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Kicker-Pay 3 life. + this.addAbility(new KickerAbility(new PayLifeCost(3))); + // If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(), + true, "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", "")); + } + + public PhyrexianScuta(final PhyrexianScuta card) { + super(card); + } + + @Override + public PhyrexianScuta copy() { + return new PhyrexianScuta(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java b/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java new file mode 100644 index 00000000000..56b6eda461f --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java @@ -0,0 +1,85 @@ +/* + * 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.planeshift; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.SetCardColorAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +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 SinisterStrength extends CardImpl { + + public SinisterStrength(UUID ownerId) { + super(ownerId, 54, "Sinister Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "PLS"; + 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 +3/+1 and is black. + Effect effect = new BoostEnchantedEffect(3, 1); + effect.setText("Enchanted creature gets +3/+1"); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); + effect = new SetCardColorAttachedEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield, AttachmentType.AURA); + effect.setText("and is black"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public SinisterStrength(final SinisterStrength card) { + super(card); + } + + @Override + public SinisterStrength copy() { + return new SinisterStrength(this); + } +} From 32a123e799d20b819bee55fc6bd9333986329d4c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 12 Jun 2015 15:04:46 +0200 Subject: [PATCH 011/148] Added a test. --- .../cards/triggers/WorldgorgerDragonTest.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java index e344f493414..c1f2238dfb1 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java @@ -7,6 +7,7 @@ package org.mage.test.cards.triggers; import mage.constants.PhaseStep; import mage.constants.Zone; +import org.junit.Ignore; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -116,4 +117,73 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase { } + /** + * v9: Worldgorger Dragon + Animate Dead is still acting up (yey complex rules interactions!). + * The first time you return Animate Dead from Worldgorger's exile, it works like it's supposed + * to. You have to pick a creature, and it brings it back. But if you pick Worldgorger Dragon + * again, it allows you to not pick a creature, and regardless of whether you choose to skip or pick + * a different creature, it always returns the first creature you picked. Kind of hard to explain, + * but here's how to reproduce: + * + * 1) Cast Animate Dead, targeting Worldgorger Dragon + * 2) Worldgorger Dragon will exile Animate Dead, killing the dragon and returning the permanents + * 3) Select Worldgorger again + * 4) Step 2 repeats + * 5) Attempt to select a different creature. Worldgorger Dragon is returned instead. + * + */ + @Test + @Ignore + public void testWithAnimateDeadDifferentTargets() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + + // When Worldgorger Dragon enters the battlefield, exile all other permanents you control. + // When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control. + addCard(Zone.GRAVEYARD, playerA, "Worldgorger Dragon", 1); + + addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1); + // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" + // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield + // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it. + addCard(Zone.HAND, playerA, "Animate Dead"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); + // Instant {X}{R}{R} + // Volcanic Geyser deals X damage to target creature or player. + addCard(Zone.HAND, playerA, "Volcanic Geyser", 1); + // When Staunch Defenders enters the battlefield, you gain 4 life. + addCard(Zone.BATTLEFIELD, playerA, "Staunch Defenders", 1); + + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Worldgorger Dragon"); + addTarget(playerA, "Worldgorger Dragon"); + addTarget(playerA, "Worldgorger Dragon"); + addTarget(playerA, "Silvercoat Lion"); + + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 9); + setChoice(playerA, "X=7"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Worldgorger Dragon", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + assertLife(playerA, 24); + assertLife(playerB, 11); + + assertGraveyardCount(playerA, "Volcanic Geyser", 1); + + + } + } \ No newline at end of file From 3032fff50ec789c65a2dc72e679b2c57edae567e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 12 Jun 2015 22:17:41 +0200 Subject: [PATCH 012/148] * Phantasmal Image - Fixed that under some circumstances copied Dies-Triggered abilities did not work (e.g. copying a Wurmcoil Engine and dying in combat). --- Mage/src/mage/abilities/AbilityImpl.java | 2 +- .../abilities/effects/ContinuousEffect.java | 3 +++ .../effects/ContinuousEffectImpl.java | 18 +++++++++++++++++- .../abilities/effects/ContinuousEffects.java | 1 + .../abilities/effects/common/CopyEffect.java | 15 ++++++++++----- .../SetPowerToughnessSourceEffect.java | 8 ++++++-- 6 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index f9847aa8b7e..7621c9adadf 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -247,7 +247,7 @@ public abstract class AbilityImpl implements Ability { return false; } game.applyEffects(); - + /* 20130201 - 601.2b * If the spell is modal the player announces the mode choice (see rule 700.2). */ diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java index 6f925dc48f6..5f6987ab47c 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffect.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java @@ -61,4 +61,7 @@ public interface ContinuousEffect extends Effect { void newId(); @Override ContinuousEffect copy(); + + boolean isTemporary(); + void setTemporary(boolean temporary); } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java index ce4342d5b6a..a3603203321 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java @@ -68,7 +68,8 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu protected boolean discarded = false; // for manual effect discard protected boolean affectedObjectsSet = false; protected List affectedObjectList = new ArrayList<>(); - + protected boolean temporary = false; + // until your next turn protected int startingTurn; protected UUID startingControllerId; @@ -96,6 +97,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.discarded = effect.discarded; this.affectedObjectsSet = effect.affectedObjectsSet; this.affectedObjectList.addAll(effect.affectedObjectList); + this.temporary = effect.temporary; this.startingTurn = effect.startingTurn; this.startingControllerId = effect.startingControllerId; } @@ -234,4 +236,18 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu return affectedObjectList; } + /** + * Returns the status if the effect is temporary added to the ContinuousEffects + * @return + */ + @Override + public boolean isTemporary() { + return temporary; + } + + @Override + public void setTemporary(boolean temporary) { + this.temporary = temporary; + } + } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index 0b2c1fbe43b..9cc59829286 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -939,6 +939,7 @@ public class ContinuousEffects implements Serializable { */ public void addEffect(ContinuousEffect effect, UUID sourceId, Ability source) { if (!(source instanceof MageSingleton)) { // because MageSingletons may never be removed by removing the temporary effecs they are not added to the temporaryEffects to prevent this + effect.setTemporary(true); Set abilities = temporaryEffects.get(effect); if (abilities == null) { abilities = new HashSet<>(); diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index bbb1d6ba0ba..d5662baf4ec 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -40,6 +40,7 @@ import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentCard; @@ -56,6 +57,7 @@ public class CopyEffect extends ContinuousEffectImpl { * Object we copy from */ private MageObject target; + private UUID sourceId; private ApplyToPermanent applier; @@ -93,9 +95,14 @@ public class CopyEffect extends ContinuousEffectImpl { permanent = game.getPermanent(this.sourceId); } if (permanent == null) { - discard(); - return false; + permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter()); + // As long as the permanent is still in the LKI continue to copy to get triggered abilities to TriggeredAbilites for dies events. + if (permanent == null) { + discard(); + return false; + } } + permanent.setCopy(true); permanent.setName(target.getName()); permanent.getColor(game).setColor(target.getColor(game)); permanent.getManaCost().clear(); @@ -134,9 +141,7 @@ public class CopyEffect extends ContinuousEffectImpl { } else if (target instanceof PermanentToken || target instanceof Card) { permanent.setCardNumber(((Card) target).getCardNumber()); permanent.setExpansionSetCode(((Card) target).getExpansionSetCode()); - } - - permanent.setCopy(true); + } return true; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java index 7d60332c1d3..add455f4b14 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java @@ -36,8 +36,8 @@ import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.Permanent; /** * @@ -76,12 +76,16 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - MageObject mageObject = game.getObject(source.getSourceId()); + MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject == null) { if (duration.equals(Duration.Custom)) { discard(); } return false; + } else if (isTemporary()) { // it's somehow w + if (!(mageObject instanceof Permanent)) { + return false; + } } if (amount != null) { int value = amount.calculate(game, source, this); From 002cd218095316eda098b0e0543ce36ffb45ed4a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 12 Jun 2015 22:27:23 +0200 Subject: [PATCH 013/148] * Dance of the Dead - Fixed that the enchanted creature was not tapped as it entered the battlefield. Fixed that it was untapped in controllers untap phase without paying the mana costs. --- Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java index d0f72fc69f1..8c694ba376d 100644 --- a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java +++ b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java @@ -42,6 +42,7 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; import mage.abilities.effects.common.UntapEnchantedEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; @@ -96,7 +97,7 @@ public class DanceOfTheDead extends CardImpl { // Enchanted creature gets +1/+1 and doesn't untap during its controller's untap step. ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); - Effect effect = new DontUntapInControllersUntapStepSourceEffect(); + Effect effect = new DontUntapInControllersUntapStepEnchantedEffect(); effect.setText("and doesn't untap during its controller's untap step"); ability.addEffect(effect); this.addAbility(ability); @@ -144,7 +145,7 @@ class DanceOfTheDeadReAttachEffect extends OneShotEffect { } // put card into play - controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId()); + controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId(), true); Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId()); FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Dance of the Dead"); From ad186480a3a44ab1d848b087adc8afccef3e549f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 00:18:32 +0200 Subject: [PATCH 014/148] * Quenchable Fire - Fixed that the delayed triggered effect could not be removed by the special action. --- .../src/mage/sets/conflux/QuenchableFire.java | 52 ++++++++++++------- Mage/src/mage/game/Game.java | 2 +- Mage/src/mage/game/GameImpl.java | 3 +- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java index 9b7f9cdaf37..7338637ae0e 100644 --- a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java +++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java @@ -29,6 +29,7 @@ package mage.sets.conflux; import java.util.UUID; +import mage.MageObject; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; @@ -36,6 +37,7 @@ import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpecialAction; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.RemoveDelayedTriggeredAbilityEffect; @@ -78,7 +80,8 @@ class QuenchableFireEffect extends OneShotEffect { public QuenchableFireEffect() { super(Outcome.Damage); - staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step"; + staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step." + + "
    Use the Special button to pay the {U} with a special action before the beginning of your next upkeep step."; } public QuenchableFireEffect(final QuenchableFireEffect effect) { @@ -92,22 +95,34 @@ class QuenchableFireEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - //create delayed triggered ability - QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility(); - delayedAbility.setSourceId(source.getSourceId()); - delayedAbility.setControllerId(source.getControllerId()); - delayedAbility.setSourceObject(source.getSourceObject(game), game); - delayedAbility.getTargets().addAll(source.getTargets()); - game.addDelayedTriggeredAbility(delayedAbility); + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + + //create special action + QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(); - //create special action - QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(delayedAbility.getId()); - delayedAbility.setSpecialActionId(newAction.getId()); - newAction.setSourceId(source.getSourceId()); - newAction.setControllerId(source.getFirstTarget()); - newAction.getTargets().addAll(source.getTargets()); - game.getState().getSpecialActions().add(newAction); - return true; + //create delayed triggered ability + QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility(); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(sourceObject, game); + delayedAbility.getTargets().addAll(source.getTargets()); + delayedAbility.setSpecialActionId(newAction.getId()); + UUID delayedAbilityId = game.addDelayedTriggeredAbility(delayedAbility); + + // update special action + newAction.addCost(new ManaCostsImpl("{U}")); + Effect effect = new RemoveDelayedTriggeredAbilityEffect(delayedAbilityId); + newAction.addEffect(effect); + effect.setText(sourceObject.getIdName() + " - Pay {U} to remove the triggered ability that deals 3 damage to you at the beginning of your next upkeep step"); + newAction.addEffect(new RemoveSpecialActionEffect(newAction.getId())); + newAction.setSourceId(source.getSourceId()); + newAction.setControllerId(source.getFirstTarget()); + newAction.getTargets().addAll(source.getTargets()); + game.getState().getSpecialActions().add(newAction); + return true; + } + return false; } } @@ -151,11 +166,8 @@ class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility { class QuenchableFireSpecialAction extends SpecialAction { - public QuenchableFireSpecialAction(UUID effectId) { + public QuenchableFireSpecialAction() { super(); - this.addCost(new ManaCostsImpl("{U}")); - this.addEffect(new RemoveDelayedTriggeredAbilityEffect(effectId)); - this.addEffect(new RemoveSpecialActionEffect(this.getId())); } public QuenchableFireSpecialAction(final QuenchableFireSpecialAction ability) { diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 3743aae59c4..40c78f0512f 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -253,7 +253,7 @@ public interface Game extends MageItem, Serializable { Card copyCard(Card cardToCopy, Ability source, UUID newController); void addTriggeredAbility(TriggeredAbility ability); - void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); + UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility); void applyEffects(); boolean checkStateAndTriggered(); void playPriority(UUID activePlayerId, boolean resuming); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 23561b34258..505bfa8c0ff 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -1383,11 +1383,12 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) { + public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) { DelayedTriggeredAbility newAbility = delayedAbility.copy(); newAbility.newId(); newAbility.init(this); state.addDelayedTriggeredAbility(newAbility); + return newAbility.getId(); } /** From 3dc081e1a68994f33ba56c46541667d3bf9b49b4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 00:25:31 +0200 Subject: [PATCH 015/148] * Copy effect - Fixed that continuous copy effects were not removed as the related permanent left the battlefield. --- .../sets/newphyrexia/PhyrexianMetamorph.java | 82 ++++-------- .../sets/vintagemasters/BragoKingEternal.java | 1 - .../cards/copy/PhyrexianMetamorphTest.java | 124 ++++++++++++++++++ .../abilities/effects/common/CopyEffect.java | 11 +- 4 files changed, 151 insertions(+), 67 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index c4ca04c7f52..6948b40a292 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -36,8 +36,10 @@ import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; @@ -54,7 +56,15 @@ import mage.util.functions.ApplyToPermanent; * @author Loki */ public class PhyrexianMetamorph extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); + } + public PhyrexianMetamorph (UUID ownerId) { super(ownerId, 42, "Phyrexian Metamorph", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{UP}"); this.expansionSetCode = "NPH"; @@ -63,10 +73,21 @@ public class PhyrexianMetamorph extends CardImpl { this.power = new MageInt(0); this.toughness = new MageInt(0); - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect( - new PhyrexianMetamorphEffect(), - "You may have {this} 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", - true)); + ApplyToPermanent phyrexianMetamorphApplier = new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + if (!permanent.getCardType().contains(CardType.ARTIFACT)) { + permanent.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); + effect.setText("You may have {this} 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"); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect)); this.addAbility(ability); } @@ -80,56 +101,3 @@ public class PhyrexianMetamorph extends CardImpl { } } - -class PhyrexianMetamorphEffect extends OneShotEffect { - - private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); - - static { - filter.add(Predicates.or( - new CardTypePredicate(CardType.ARTIFACT), - new CardTypePredicate(CardType.CREATURE))); - } - - public PhyrexianMetamorphEffect() { - super(Outcome.Copy); - } - - public PhyrexianMetamorphEffect(final PhyrexianMetamorphEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null && sourcePermanent != null) { - Target target = new TargetPermanent(filter); - target.setNotTarget(true); - if (target.canChoose(source.getControllerId(), game)) { - 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.ARTIFACT)) { - permanent.getCardType().add(CardType.ARTIFACT); - } - return true; - } - }); - - return true; - } - } - } - return false; - } - - @Override - public PhyrexianMetamorphEffect copy() { - return new PhyrexianMetamorphEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java b/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java index bf7928bf32b..3739f406ec1 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java @@ -40,7 +40,6 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterNonlandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java new file mode 100644 index 00000000000..56819d12149 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java @@ -0,0 +1,124 @@ +/* + * 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.copy; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class PhyrexianMetamorphTest extends CardTestPlayerBase { + + + @Test + public void testCopyCreature() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); + + // 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. + addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP} + addCard(Zone.HAND, playerA, "Cloudshift"); + + //Flying + // Vanishing 3 (This permanent enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.) + // When Aven Riftwatcher enters the battlefield or leaves the battlefield, you gain 2 life. + addCard(Zone.BATTLEFIELD, playerB, "Aven Riftwatcher"); // 2/3 + + // When Ponyback Brigade enters the battlefield or is turned face up, put three 1/1 red Goblin creature tokens onto the battlefield. + addCard(Zone.BATTLEFIELD, playerB, "Ponyback Brigade"); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph"); + setChoice(playerA, "Aven Riftwatcher"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Aven Riftwatcher"); + setChoice(playerA, "Ponyback Brigade"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertLife(playerA, 24); + assertLife(playerB, 20); + + assertGraveyardCount(playerA, "Cloudshift", 1); + + assertPermanentCount(playerA, "Ponyback Brigade", 1); + assertPermanentCount(playerA, "Goblin", 3); + + } + + /** + * An opponent cast Phyrexian Metamorph and cloned another opponent's + * Maelstrom Wanderer(his Commander). The first opponent then dealt combat + * damage with Brago, King Eternal and chose to flicker several permanents, + * including the Phyrexian Metamorph/Maelstrom Wanderer, but he was not able + * to choose a new creature to clone when the Phyrexian Metamorph re-entered + * the battlefield. + */ + + @Test + public void testFlickerWithBrago() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + // 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. + addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP} + + // Flying + // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control. + addCard(Zone.BATTLEFIELD, playerA, "Brago, King Eternal"); // 2/4 + + // Creatures you control have haste. + // Cascade, cascade + addCard(Zone.BATTLEFIELD, playerB, "Maelstrom Wanderer"); // 7/5 + // When Ponyback Brigade enters the battlefield or is turned face up, put three 1/1 red Goblin creature tokens onto the battlefield. + addCard(Zone.BATTLEFIELD, playerB, "Ponyback Brigade"); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph"); + setChoice(playerA, "Maelstrom Wanderer"); + + attack(3, playerA, "Brago, King Eternal"); + addTarget(playerA, "Maelstrom Wanderer"); + setChoice(playerA, "Ponyback Brigade"); + + setStopAt(3, PhaseStep.END_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 18); + + assertPermanentCount(playerA, "Ponyback Brigade", 1); + assertPermanentCount(playerA, "Goblin", 3); + + } + + +} diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index d5662baf4ec..9560f3e6bfd 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -81,19 +81,12 @@ public class CopyEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); - if (affectedObjectsSet) { - affectedObjectList.add(new MageObjectReference(sourceId, game)); - } + affectedObjectList.add(new MageObjectReference(getSourceId(), game)); } @Override public boolean apply(Game game, Ability source) { - Permanent permanent; - if (affectedObjectsSet) { - permanent = affectedObjectList.get(0).getPermanent(game); - } else { - permanent = game.getPermanent(this.sourceId); - } + Permanent permanent = affectedObjectList.get(0).getPermanent(game); if (permanent == null) { permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter()); // As long as the permanent is still in the LKI continue to copy to get triggered abilities to TriggeredAbilites for dies events. From 4a022dde935ce8dc1cb2f0dad83d7342306e9de1 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 09:45:20 +0300 Subject: [PATCH 016/148] Implement cards: False Prophet, Merrow Harbinger, Still Life, and Tidal Warrior --- .../src/mage/sets/commander/FalseProphet.java | 53 +++++++++++++ .../src/mage/sets/lorwyn/MerrowHarbinger.java | 77 +++++++++++++++++++ .../src/mage/sets/odyssey/StillLife.java | 76 ++++++++++++++++++ .../sets/prereleaseevents/FalseProphet.java | 55 +++++++++++++ .../mage/sets/stronghold/TidalWarrior.java | 72 +++++++++++++++++ .../mage/sets/urzasdestiny/FalseProphet.java | 66 ++++++++++++++++ 6 files changed, 399 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/FalseProphet.java create mode 100644 Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java create mode 100644 Mage.Sets/src/mage/sets/odyssey/StillLife.java create mode 100644 Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java create mode 100644 Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java diff --git a/Mage.Sets/src/mage/sets/commander/FalseProphet.java b/Mage.Sets/src/mage/sets/commander/FalseProphet.java new file mode 100644 index 00000000000..02e9f79fb51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/FalseProphet.java @@ -0,0 +1,53 @@ +/* + * 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.commander; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class FalseProphet extends mage.sets.urzasdestiny.FalseProphet { + + public FalseProphet(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "CMD"; + } + + public FalseProphet(final FalseProphet card) { + super(card); + } + + @Override + public FalseProphet copy() { + return new FalseProphet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java b/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java new file mode 100644 index 00000000000..984104412a0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java @@ -0,0 +1,77 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +import mage.abilities.keyword.IslandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + + */ +public class MerrowHarbinger extends CardImpl { + + public static final FilterCard filter = new FilterCard("Merfolk card"); + + static { + filter.add(new SubtypePredicate("Merfolk")); + } + + public MerrowHarbinger(UUID ownerId) { + super(ownerId, 73, "Merrow Harbinger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Islandwalk + this.addAbility(new IslandwalkAbility()); + // When Merrow Harbinger enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true)); + } + + public MerrowHarbinger(final MerrowHarbinger card) { + super(card); + } + + @Override + public MerrowHarbinger copy() { + return new MerrowHarbinger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/odyssey/StillLife.java b/Mage.Sets/src/mage/sets/odyssey/StillLife.java new file mode 100644 index 00000000000..97e9d7d2ee9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/StillLife.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.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.permanent.token.Token; + +/** + * + * @author LoneFox + + */ +public class StillLife extends CardImpl { + + public StillLife(UUID ownerId) { + super(ownerId, 275, "Still Life", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); + this.expansionSetCode = "ODY"; + + // {G}{G}: Still Life becomes a 4/3 Centaur creature until end of turn. It's still an enchantment. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new StillLifeCentaur(), "", Duration.EndOfTurn), new ManaCostsImpl("{G}{G}"))); + } + + public StillLife(final StillLife card) { + super(card); + } + + @Override + public StillLife copy() { + return new StillLife(this); + } +} + +class StillLifeCentaur extends Token { + + public StillLifeCentaur() { + super("Centaur", "a 4/3 Centaur creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Centaur"); + power = new MageInt(4); + toughness = new MageInt(3); + } +} diff --git a/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java b/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java new file mode 100644 index 00000000000..b288153460b --- /dev/null +++ b/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java @@ -0,0 +1,55 @@ +/* + * 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.prereleaseevents; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class FalseProphet extends mage.sets.urzasdestiny.FalseProphet { + + public FalseProphet(UUID ownerId) { + super(ownerId); + this.cardNumber = 7; + this.expansionSetCode = "PTC"; + this.rarity = Rarity.SPECIAL; + } + + public FalseProphet(final FalseProphet card) { + super(card); + } + + @Override + public FalseProphet copy() { + return new FalseProphet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java b/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java new file mode 100644 index 00000000000..56a850505f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.stronghold; + +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.effects.common.continuous.BecomesBasicLandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + + */ +public class TidalWarrior extends CardImpl { + + public TidalWarrior(UUID ownerId) { + super(ownerId, 47, "Tidal Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}"); + this.expansionSetCode = "STH"; + this.subtype.add("Merfolk"); + this.subtype.add("Warrior"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target land becomes an Island until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost()); + ability.addTarget(new TargetLandPermanent()); + this.addAbility(ability); + } + + public TidalWarrior(final TidalWarrior card) { + super(card); + } + + @Override + public TidalWarrior copy() { + return new TidalWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java b/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java new file mode 100644 index 00000000000..aa5f554acac --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ExileAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class FalseProphet extends CardImpl { + + public FalseProphet(UUID ownerId) { + super(ownerId, 6, "False Prophet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When False Prophet dies, exile all creatures. + this.addAbility(new DiesTriggeredAbility(new ExileAllEffect(new FilterCreaturePermanent()))); + } + + public FalseProphet(final FalseProphet card) { + super(card); + } + + @Override + public FalseProphet copy() { + return new FalseProphet(this); + } +} From b3fdc167a8b3159ed1fd647b5dd680c89d6ee6fc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 09:35:37 +0200 Subject: [PATCH 017/148] * The Mimeoplasm - Fixed that if a Mimeoplasm was copied (e.g. by Clone) that not the target copied by Mimeoplasm was copied but instead the Mimeoplasm itself. --- .../mage/sets/commander/TheMimeoplasm.java | 22 +++-- .../test/cards/copy/TheMimeoplasmTest.java | 97 +++++++++++++++++++ .../java/org/mage/test/player/TestPlayer.java | 52 ++++++++-- .../abilities/effects/common/CopyEffect.java | 5 +- 4 files changed, 159 insertions(+), 17 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java diff --git a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java index de4556bc487..0397ca4cff8 100644 --- a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java +++ b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java @@ -36,6 +36,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -94,31 +96,33 @@ class TheMimeoplasmEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); + Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { + if (controller != null && permanent != null) { if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) { - if (player.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) { + if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) { TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of")); - TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card for additional +1/+1 counters")); - if (player.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) { + TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card to determine amount of additional +1/+1 counters")); + if (controller.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) { Card cardToCopy = game.getCard(targetCopy.getFirstTarget()); if (cardToCopy != null) { - player.moveCardToExileWithInfo(cardToCopy, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); - if (player.choose(Outcome.Copy, targetCounters, source.getSourceId(), game)) { + if (controller.choose(Outcome.Copy, targetCounters, source.getSourceId(), game)) { Card cardForCounters = game.getCard(targetCounters.getFirstTarget()); if (cardForCounters != null) { - player.moveCardToExileWithInfo(cardForCounters, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); + Cards cardsToExile = new CardsImpl(); + cardsToExile.add(cardToCopy); + cardsToExile.add(cardForCounters); + controller.moveCards(cardsToExile, Zone.GRAVEYARD, Zone.EXILED, source, game); CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId()); game.addEffect(copyEffect, source); permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), game); - return true; } } } } } } + return true; } return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java new file mode 100644 index 00000000000..5ef499da439 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java @@ -0,0 +1,97 @@ +/* + * 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.copy; + +import mage.abilities.keyword.FlyingAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class TheMimeoplasmTest extends CardTestPlayerBase { + + /** + * I cast either Phyrexian Metamorph or Phantasmal Image and copied The + * Mimeoplasm which was copying a Primeval Titan, but my clone became + * another Mimeoplasm, so it exiled two creatures from graveyards and cloned + * one of those instead. + * + * Copying cards that are copy of other cards copies the original, rather + * than the copy. + * To wit, when The Mimeoplasm is out (and lets say is a copy of Elvish + * Mystic), and someone then plays Clone choosing to enter as the cloned + * Elvish Mystic, they are incorrectly getting The Mimeoplasm instead. + * + */ + @Test + public void testCloneMimeoplasm() { + // As The Mimeoplasm enters the battlefield, you may exile two creature cards from graveyards. + // If you do, it enters the battlefield as a copy of one of those cards with a number of additional +1/+1 counters on it equal to the power of the other card. + addCard(Zone.HAND, playerA, "The Mimeoplasm", 1); // {2}{G}{U}{B} + + addCard(Zone.HAND, playerA, "Clone", 1); // {3}{U} + + addCard(Zone.GRAVEYARD, playerB, "Silvercoat Lion", 1); // 2/2 + addCard(Zone.GRAVEYARD, playerB, "Aven Riftwatcher", 1); // 2/3 + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 7); + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + + + castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "The Mimeoplasm"); + setChoice(playerA, "Aven Riftwatcher"); + setChoice(playerA, "Silvercoat Lion"); + + castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "Clone"); + setChoice(playerA, "Aven Riftwatcher"); + + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertHandCount(playerA, "Clone", 0); + + assertLife(playerA, 24); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Aven Riftwatcher", 2); + assertPowerToughness(playerA, "Aven Riftwatcher", 4, 5); + assertPowerToughness(playerA, "Aven Riftwatcher", 2, 3); + + assertGraveyardCount(playerB, 0); + + + } +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java index 4f99f385689..be7c65487a0 100644 --- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java +++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java @@ -29,6 +29,7 @@ package org.mage.test.player; import java.io.Serializable; import java.util.ArrayList; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -91,6 +92,7 @@ import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.TargetSource; import mage.target.TargetSpell; +import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCreaturePermanentAmount; @@ -604,17 +606,53 @@ public class TestPlayer implements Player { } } } + if (target instanceof TargetCardInGraveyard) { + TargetCardInGraveyard targetCardInGraveyard = ((TargetCardInGraveyard) target); + Set possibleTargets = new HashSet<>(); + for(UUID playerId: this.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + possibleTargets.addAll(player.getGraveyard()); + } + } + + for (String choose2 : choices) { + String[] targetList = choose2.split("\\^"); + boolean targetFound = false; + for (UUID targetId : possibleTargets) { + MageObject targetObject = game.getObject(targetId); + if (targetObject != null) { + for (String targetName : targetList) { + if (targetObject.getName().equals(targetName)) { + List alreadyTargetted = targetCardInGraveyard.getTargets(); + if (targetCardInGraveyard.canTarget(targetObject.getId(), game)) { + if (alreadyTargetted != null && !alreadyTargetted.contains(targetObject.getId())) { + targetCardInGraveyard.add(targetObject.getId(), game); + choices.remove(choose2); + targetFound = true; + } + } + } + } + if (targetFound && targetCardInGraveyard.isChosen()) { + choices.remove(choose2); + return true; + } + } + } + } + } if (target instanceof TargetSource) { Set possibleTargets; TargetSource t = ((TargetSource) target); possibleTargets = t.possibleTargets(sourceId, computerPlayer.getId(), game); - for (UUID targetId : possibleTargets) { - MageObject targetObject = game.getObject(targetId); - if (targetObject != null) { - for (String choose2 : choices) { - String[] targetList = choose2.split("\\^"); - boolean targetFound = false; - for (String targetName : targetList) { + for (String choose2 : choices) { + String[] targetList = choose2.split("\\^"); + boolean targetFound = false; + for (String targetName : targetList) { + for (UUID targetId : possibleTargets) { + MageObject targetObject = game.getObject(targetId); + if (targetObject != null) { if (targetObject.getName().equals(targetName)) { List alreadyTargetted = target.getTargets(); if (t.canTarget(targetObject.getId(), game)) { diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java index 9560f3e6bfd..9d1194fda2a 100644 --- a/Mage/src/mage/abilities/effects/common/CopyEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java @@ -67,7 +67,7 @@ public class CopyEffect extends ContinuousEffectImpl { public CopyEffect(Duration duration, MageObject target, UUID sourceId) { super(duration, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature); - this.target = target; + this.target = target; this.sourceId = sourceId; } @@ -81,6 +81,9 @@ public class CopyEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); + if (!(target instanceof Permanent) && (target instanceof Card)) { + this.target = new PermanentCard((Card)target, source.getControllerId(), game); + } affectedObjectList.add(new MageObjectReference(getSourceId(), game)); } From 4e13a248f503e78c5e8301544d6961731273bb96 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 11:00:56 +0300 Subject: [PATCH 018/148] Implement cards: Followed Footsteps, Nim Abomination, Thrashing Wumpus --- .../mage/sets/darksteel/NimAbomination.java | 69 +++++++++++ .../mercadianmasques/ThrashingWumpus.java | 66 +++++++++++ .../mage/sets/ravnica/FollowedFootsteps.java | 109 ++++++++++++++++++ 3 files changed, 244 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/darksteel/NimAbomination.java create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java create mode 100644 Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java diff --git a/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java new file mode 100644 index 00000000000..d13bc0e2504 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.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.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class NimAbomination extends CardImpl { + + public NimAbomination(UUID ownerId) { + super(ownerId, 49, "Nim Abomination", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "DST"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // At the beginning of your end step, if Nim Abomination is untapped, you lose 3 life. + this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(3), + TargetController.YOU, new InvertCondition(new SourceTappedCondition()), false)); + } + + public NimAbomination(final NimAbomination card) { + super(card); + } + + @Override + public NimAbomination copy() { + return new NimAbomination(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java b/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java new file mode 100644 index 00000000000..ca9a4b4e971 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.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.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + + */ +public class ThrashingWumpus extends CardImpl { + + public ThrashingWumpus(UUID ownerId) { + super(ownerId, 166, "Thrashing Wumpus", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {B}: Thrashing Wumpus deals 1 damage to each creature and each player. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(1), new ManaCostsImpl("{B}"))); + } + + public ThrashingWumpus(final ThrashingWumpus card) { + super(card); + } + + @Override + public ThrashingWumpus copy() { + return new ThrashingWumpus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java new file mode 100644 index 00000000000..4ab45ecce4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java @@ -0,0 +1,109 @@ +/* + * 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.ravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.EmptyToken; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; +import mage.util.CardUtil; + +/** + * + * @author LoneFox + + */ +public class FollowedFootsteps extends CardImpl { + + public FollowedFootsteps(UUID ownerId) { + super(ownerId, 51, "Followed Footsteps", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}"); + this.expansionSetCode = "RAV"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Copy)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // At the beginning of your upkeep, put a token that's a copy of enchanted creature onto the battlefield. + this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new FollowedFootstepsEffect(), false)); + } + + public FollowedFootsteps(final FollowedFootsteps card) { + super(card); + } + + @Override + public FollowedFootsteps copy() { + return new FollowedFootsteps(this); + } +} + +class FollowedFootstepsEffect extends OneShotEffect { + + public FollowedFootstepsEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "You put a token onto the battlefield that's a copy of enchanted creature"; + } + + public FollowedFootstepsEffect(final FollowedFootstepsEffect effect) { + super(effect); + } + + @Override + public FollowedFootstepsEffect copy() { + return new FollowedFootstepsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo()); + if (target != null) { + EmptyToken token = new EmptyToken(); + CardUtil.copyTo(token).from(target); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); + return true; + } + return false; + } +} From 0f37d0fcd05c3b998ff923d4dd016441d9bb6f3f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 11:30:25 +0200 Subject: [PATCH 019/148] Added country name to tooltip of country icon in user list. --- .../main/java/mage/client/chat/ChatPanel.form | 2 +- .../main/java/mage/client/chat/ChatPanel.java | 47 +++-------- .../gui/countryBox/CountryCellRenderer.java | 81 +++++++++++++++++++ 3 files changed, 95 insertions(+), 35 deletions(-) create mode 100644 Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form index 7bc34fdbb7b..f423543b402 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form @@ -96,7 +96,7 @@ - + diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java index 60a405a7928..19b2a67bb11 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java @@ -37,31 +37,25 @@ import java.awt.Color; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.UUID; import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JTextField; import javax.swing.table.AbstractTableModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableColumnModel; import mage.client.MageFrame; -import mage.client.dialog.PreferencesDialog; -import static mage.client.dialog.PreferencesDialog.KEY_TABLES_COLUMNS_ORDER; -import static mage.client.dialog.PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH; import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_ORDER; import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_WIDTH; import mage.client.util.MageTableRowSorter; import mage.client.util.gui.TableUtil; +import mage.client.util.gui.countryBox.CountryCellRenderer; import mage.remote.MageRemoteException; import mage.remote.Session; import mage.view.ChatMessage.MessageColor; import mage.view.ChatMessage.MessageType; import mage.view.RoomUsersView; import mage.view.UsersView; -import org.apache.log4j.Logger; import org.mage.card.arcane.ManaSymbols; /** @@ -69,13 +63,11 @@ import org.mage.card.arcane.ManaSymbols; * @author BetaSteward_at_googlemail.com, nantuko */ public class ChatPanel extends javax.swing.JPanel { - - private static final Logger logger = Logger.getLogger(ChatPanel.class); - + private UUID chatId; private Session session; private final List players = new ArrayList<>(); - private final TableModel tableModel; + private final UserTableModel userTableModel; /** * Chat message color for opponents. */ @@ -153,14 +145,15 @@ public class ChatPanel extends javax.swing.JPanel { * @param addPlayersTab */ public ChatPanel(boolean addPlayersTab) { - tableModel = new TableModel(); + userTableModel = new UserTableModel(); initComponents(); setBackground(new Color(0, 0, 0, ALPHA)); jTablePlayers.setBackground(new Color(0, 0, 0, ALPHA)); jTablePlayers.setForeground(Color.white); - jTablePlayers.setRowSorter(new MageTableRowSorter(tableModel)); - + jTablePlayers.setRowSorter(new MageTableRowSorter(userTableModel)); + TableUtil.setColumnWidthAndOrder(jTablePlayers, defaultColumnsWidth, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER); + jTablePlayers.setDefaultRenderer(Icon.class, new CountryCellRenderer()); if (jScrollPaneTxt != null) { jScrollPaneTxt.setBackground(new Color(0, 0, 0, ALPHA)); @@ -331,13 +324,10 @@ public class ChatPanel extends javax.swing.JPanel { return this.jSplitPane1.getDividerLocation(); } - class TableModel extends AbstractTableModel { - - - + class UserTableModel extends AbstractTableModel { + private final String[] columnNames = new String[]{" ","Players", "Info", "Games", "Connection"}; private UsersView[] players = new UsersView[0]; - private Map flagIconCache = new HashMap<>(); public void loadData(Collection roomUserInfoList) throws MageRemoteException { RoomUsersView roomUserInfo = roomUserInfoList.iterator().next(); @@ -368,7 +358,7 @@ public class ChatPanel extends javax.swing.JPanel { public Object getValueAt(int arg0, int arg1) { switch (arg1) { case 0: - return getCountryFlagIcon(players[arg0].getFlagName()); + return players[arg0].getFlagName(); case 1: return players[arg0].getUserName(); case 2: @@ -407,18 +397,7 @@ public class ChatPanel extends javax.swing.JPanel { return false; } - private ImageIcon getCountryFlagIcon(String countryCode) { - ImageIcon flagIcon = flagIconCache.get(countryCode); - if (flagIcon == null) { - flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode +".png")); - if (flagIcon.getImage() == null) { - logger.warn("Country flag resource not found: " + countryCode); - } else { - flagIconCache.put(countryCode, flagIcon); - } - } - return flagIcon; - } + } @@ -460,7 +439,7 @@ public class ChatPanel extends javax.swing.JPanel { jScrollPanePlayers.setBorder(null); - jTablePlayers.setModel(this.tableModel); + jTablePlayers.setModel(this.userTableModel); jTablePlayers.setToolTipText("Connected players"); jTablePlayers.setAutoscrolls(false); jTablePlayers.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); @@ -528,7 +507,7 @@ public class ChatPanel extends javax.swing.JPanel { public void setRoomUserInfo(List> view) { try { - tableModel.loadData(view.get(0)); + userTableModel.loadData(view.get(0)); } catch (Exception ex) { this.players.clear(); } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java new file mode 100644 index 00000000000..ddcc10aee5c --- /dev/null +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java @@ -0,0 +1,81 @@ +/* + * 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.client.util.gui.countryBox; + +import java.awt.Component; +import java.util.HashMap; +import java.util.Map; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.table.DefaultTableCellRenderer; +import mage.client.chat.ChatPanel; +import org.apache.log4j.Logger; + +/** + * + * @author LevelX2 + */ +public class CountryCellRenderer extends DefaultTableCellRenderer { + + private static final Logger logger = Logger.getLogger(CountryCellRenderer.class); + private final Map flagIconCache = new HashMap<>(); + + private final Map countryMap = new HashMap<>(); + + public CountryCellRenderer() { + for( int i = 0; i <= CountryComboBox.countryList.length - 1; i++) { + countryMap.put(CountryComboBox.countryList[i][1],CountryComboBox.countryList[i][0]); + } + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + if(column == 0) { + label.setToolTipText(countryMap.get((String)value)); + label.setIcon(getCountryFlagIcon((String)value)); + label.setText(""); + } + return label; + } + + private ImageIcon getCountryFlagIcon(String countryCode) { + ImageIcon flagIcon = flagIconCache.get(countryCode); + if (flagIcon == null) { + flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode +".png")); + if (flagIcon.getImage() == null) { + logger.warn("Country flag resource not found: " + countryCode); + } else { + flagIconCache.put(countryCode, flagIcon); + } + } + return flagIcon; + } +} From ce26bc8ed076ee006a697166a2327b6c5ad03255 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 12:27:50 +0200 Subject: [PATCH 020/148] Added option to deactivate to ask th eplayer in which order cards go to gaveyard. --- .../src/main/java/mage/client/MageFrame.java | 9 +-- .../mage/client/dialog/PreferencesDialog.form | 42 ++++++---- .../mage/client/dialog/PreferencesDialog.java | 81 ++++++++++++------- Mage.Common/src/mage/remote/Connection.java | 65 +++------------ Mage.Common/src/mage/remote/SessionImpl.java | 13 +-- .../mage/remote/interfaces/ClientData.java | 4 +- Mage.Common/src/mage/view/PlayerView.java | 2 +- Mage.Common/src/mage/view/UserDataView.java | 14 +++- .../java/mage/player/ai/ComputerPlayer.java | 2 +- .../src/main/java/mage/server/Session.java | 5 +- Mage/src/mage/players/PlayerImpl.java | 8 +- Mage/src/mage/players/net/UserData.java | 11 ++- 12 files changed, 127 insertions(+), 129 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 8a9e3a95f50..641ba54ddb6 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -739,14 +739,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } public void setUserPrefsToConnection(Connection connection) { - int avatarId = PreferencesDialog.getSelectedAvatar(); - connection.setAvatarId(avatarId); - boolean showAbilityPickerForced = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_ABILITY_PICKER_FORCED, "true").equals("true"); - connection.setShowAbilityPickerForced(showAbilityPickerForced); - connection.setAllowRequestShowHandCards(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true")); - connection.setConfirmEmptyManaPool(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true")); - connection.setUserSkipPrioritySteps(PreferencesDialog.getUserSkipPrioritySteps()); - connection.setFlagName(MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png")); + connection.setUserData(PreferencesDialog.getUserData()); } /** diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form index 06253718466..cfc3e9c0364 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form @@ -82,10 +82,10 @@ - + - + @@ -201,23 +201,17 @@ - - - - - - - - - - - - - - - + + + + + + + + + @@ -235,6 +229,9 @@ + + + @@ -307,6 +304,17 @@ + + + + + + + + + + + diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index a55dee9d986..1a92477f2fd 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -66,6 +66,7 @@ import mage.client.util.gui.BufferedImageBuilder; import mage.players.net.UserSkipPrioritySteps; import mage.remote.Connection; import mage.remote.Connection.ProxyType; +import mage.view.UserDataView; import org.apache.log4j.Logger; /** @@ -86,6 +87,7 @@ public class PreferencesDialog extends javax.swing.JDialog { public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards"; public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter"; public static final String KEY_GAME_CONFIRM_EMPTY_MANA_POOL = "gameConfirmEmptyManaPool"; + public static final String KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER = "gameAskMoveToGraveORder"; public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave"; @@ -346,6 +348,7 @@ public class PreferencesDialog extends javax.swing.JDialog { cbAllowRequestToShowHandCards = new javax.swing.JCheckBox(); cbShowStormCounter = new javax.swing.JCheckBox(); cbConfirmEmptyManaPool = new javax.swing.JCheckBox(); + cbAskMoveToGraveOrder = new javax.swing.JCheckBox(); main_gamelog = new javax.swing.JPanel(); cbGameLogAutoSave = new javax.swing.JCheckBox(); tabPhases = new javax.swing.JPanel(); @@ -570,6 +573,16 @@ public class PreferencesDialog extends javax.swing.JDialog { } }); + cbAskMoveToGraveOrder.setSelected(true); + cbAskMoveToGraveOrder.setText("Ask player for setting order cards go to graveyard"); + cbAskMoveToGraveOrder.setToolTipText("If activated and multiple cards go to the graveyard at the same time
    \nthe player is asked to set the order of the cards."); + cbAskMoveToGraveOrder.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); + cbAskMoveToGraveOrder.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cbAskMoveToGraveOrderActionPerformed(evt); + } + }); + javax.swing.GroupLayout main_gameLayout = new javax.swing.GroupLayout(main_game); main_game.setLayout(main_gameLayout); main_gameLayout.setHorizontalGroup( @@ -577,18 +590,15 @@ public class PreferencesDialog extends javax.swing.JDialog { .addGroup(main_gameLayout.createSequentialGroup() .addContainerGap() .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(main_gameLayout.createSequentialGroup() - .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(main_gameLayout.createSequentialGroup() - .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING)) - .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(0, 0, Short.MAX_VALUE)))) + .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING)) + .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); main_gameLayout.setVerticalGroup( main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -603,7 +613,10 @@ public class PreferencesDialog extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cbShowStormCounter) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(cbConfirmEmptyManaPool)) + .addComponent(cbConfirmEmptyManaPool) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cbAskMoveToGraveOrder) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile"); @@ -651,10 +664,10 @@ public class PreferencesDialog extends javax.swing.JDialog { .addContainerGap() .addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 189, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(40, Short.MAX_VALUE)) + .addContainerGap()) ); main_card.getAccessibleContext().setAccessibleName("Game panel"); @@ -1626,7 +1639,7 @@ public class PreferencesDialog extends javax.swing.JDialog { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) - .addComponent(tabsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE) + .addComponent(tabsPanel) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -1655,6 +1668,7 @@ public class PreferencesDialog extends javax.swing.JDialog { save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true", "false", UPDATE_CACHE_POLICY); + save(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true", "false", UPDATE_CACHE_POLICY); save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY); // Phases @@ -1717,13 +1731,7 @@ public class PreferencesDialog extends javax.swing.JDialog { } try { - MageFrame.getSession().updatePreferencesForServer( - getSelectedAvatar(), - dialog.showAbilityPickerForced.isSelected(), - dialog.cbAllowRequestToShowHandCards.isSelected(), - dialog.cbConfirmEmptyManaPool.isSelected(), - getUserSkipPrioritySteps(), - MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png")); + MageFrame.getSession().updatePreferencesForServer(getUserData()); prefs.flush(); } catch (BackingStoreException ex) { @@ -1978,6 +1986,10 @@ public class PreferencesDialog extends javax.swing.JDialog { // TODO add your handling code here: }//GEN-LAST:event_cbConfirmEmptyManaPoolActionPerformed + private void cbAskMoveToGraveOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAskMoveToGraveOrderActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cbAskMoveToGraveOrderActionPerformed + private void showProxySettings() { if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) { this.pnlProxy.setVisible(true); @@ -2055,6 +2067,7 @@ public class PreferencesDialog extends javax.swing.JDialog { load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true"); load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true"); load(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true"); + load(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true"); load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true"); @@ -2395,26 +2408,32 @@ public class PreferencesDialog extends javax.swing.JDialog { public void mousePressed(MouseEvent e) { if (selectedAvatarId != id) { setSelectedId(id); - MageFrame.getSession().updatePreferencesForServer( - id, - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), - getUserSkipPrioritySteps(), - MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png") - ); + MageFrame.getSession().updatePreferencesForServer(getUserData()); } } }); } } + public static UserDataView getUserData(){ + return new UserDataView( + getSelectedAvatar(), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), + getUserSkipPrioritySteps(), + MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true") + ); + } + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnBattlefieldBGMBrowse; private javax.swing.JButton btnBrowseBackgroundImage; private javax.swing.JButton btnBrowseBattlefieldImage; private javax.swing.JButton btnBrowseImageLocation; private javax.swing.JCheckBox cbAllowRequestToShowHandCards; + private javax.swing.JCheckBox cbAskMoveToGraveOrder; private javax.swing.JCheckBox cbCheckForNewImages; private javax.swing.JCheckBox cbConfirmEmptyManaPool; private javax.swing.JCheckBox cbEnableBattlefieldBGM; diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java index 21e51faf794..e8337feacde 100644 --- a/Mage.Common/src/mage/remote/Connection.java +++ b/Mage.Common/src/mage/remote/Connection.java @@ -35,6 +35,7 @@ import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import mage.players.net.UserSkipPrioritySteps; +import mage.view.UserDataView; /** * @@ -54,12 +55,14 @@ public class Connection { private int clientCardDatabaseVersion; private boolean forceDBComparison; - private int avatarId; - private boolean showAbilityPickerForced; - private boolean allowRequestShowHandCards; - private boolean confirmEmptyManaPool; - private String flagName; - private UserSkipPrioritySteps userSkipPrioritySteps; + private UserDataView userData; + +// private int avatarId; +// private boolean showAbilityPickerForced; +// private boolean allowRequestShowHandCards; +// private boolean confirmEmptyManaPool; +// private String flagName; +// private UserSkipPrioritySteps userSkipPrioritySteps; private static final String serialization = "?serializationtype=jboss"; private static final String transport = "bisocket"; @@ -221,45 +224,12 @@ public class Connection { return null; } - public int getAvatarId() { - return avatarId; - } - - public void setAvatarId(int avatarId) { - this.avatarId = avatarId; - } - - public boolean isShowAbilityPickerForced() { - return showAbilityPickerForced; - } - - public void setShowAbilityPickerForced(boolean showAbilityPickerForced) { - this.showAbilityPickerForced = showAbilityPickerForced; - } - - public boolean allowRequestShowHandCards() { - return allowRequestShowHandCards; - } - - public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) { - this.allowRequestShowHandCards = allowRequestShowHandCards; - } - - public boolean confirmEmptyManaPool() { - return confirmEmptyManaPool; - } - - public void setConfirmEmptyManaPool(boolean confirmEmptyManaPool) { - this.confirmEmptyManaPool = confirmEmptyManaPool; + public void setUserData(UserDataView userData) { + this.userData= userData; } - - public UserSkipPrioritySteps getUserSkipPrioritySteps() { - return userSkipPrioritySteps; - } - - public void setUserSkipPrioritySteps(UserSkipPrioritySteps userSkipPrioritySteps) { - this.userSkipPrioritySteps = userSkipPrioritySteps; + public UserDataView getUserData() { + return userData; } public boolean isForceDBComparison() { @@ -269,13 +239,4 @@ public class Connection { public void setForceDBComparison(boolean forceDBComparison) { this.forceDBComparison = forceDBComparison; } - - public String getFlagName() { - return flagName; - } - - public void setFlagName(String flagName) { - this.flagName = flagName; - } - } diff --git a/Mage.Common/src/mage/remote/SessionImpl.java b/Mage.Common/src/mage/remote/SessionImpl.java index 2bcc00dfb39..a5bf686b3bc 100644 --- a/Mage.Common/src/mage/remote/SessionImpl.java +++ b/Mage.Common/src/mage/remote/SessionImpl.java @@ -275,16 +275,10 @@ public class SessionImpl implements Session { this.sessionId = callbackClient.getSessionId(); boolean registerResult; if (connection.getPassword() == null) { - UserDataView userDataView = new UserDataView(connection.getAvatarId(), - connection.isShowAbilityPickerForced(), - connection.allowRequestShowHandCards(), - connection.confirmEmptyManaPool(), - connection.getUserSkipPrioritySteps(), - connection.getFlagName()); // for backward compatibility. don't remove twice call - first one does nothing but for version checking registerResult = server.registerClient(connection.getUsername(), sessionId, client.getVersion()); if (registerResult) { - server.setUserData(connection.getUsername(), sessionId, userDataView); + server.setUserData(connection.getUsername(), sessionId, connection.getUserData()); } } else { registerResult = server.registerAdmin(connection.getPassword(), sessionId, client.getVersion()); @@ -1397,11 +1391,10 @@ public class SessionImpl implements Session { } @Override - public boolean updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) { + public boolean updatePreferencesForServer(UserDataView userData) { try { if (isConnected()) { - UserDataView userDataView = new UserDataView(avatarId, showAbilityPickerForced, allowRequestShowHandCards, confirmEmptyManaPool, userSkipPrioritySteps, flagName); - server.setUserData(connection.getUsername(), sessionId, userDataView); + server.setUserData(connection.getUsername(), sessionId, userData); } return true; } catch (MageException ex) { diff --git a/Mage.Common/src/mage/remote/interfaces/ClientData.java b/Mage.Common/src/mage/remote/interfaces/ClientData.java index 2a9fe56b384..7b4f248d934 100644 --- a/Mage.Common/src/mage/remote/interfaces/ClientData.java +++ b/Mage.Common/src/mage/remote/interfaces/ClientData.java @@ -27,7 +27,7 @@ */ package mage.remote.interfaces; -import mage.players.net.UserSkipPrioritySteps; +import mage.view.UserDataView; /** * @author noxx @@ -36,5 +36,5 @@ public interface ClientData { String getUserName(); - boolean updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName); + boolean updatePreferencesForServer(UserDataView userData); } diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java index 3e9eb437d81..487e84afd26 100644 --- a/Mage.Common/src/mage/view/PlayerView.java +++ b/Mage.Common/src/mage/view/PlayerView.java @@ -115,7 +115,7 @@ public class PlayerView implements Serializable { if (player.getUserData() != null) { this.userDataView = new UserDataView(player.getUserData()); } else { - this.userDataView = new UserDataView(0, false, false, true, null,"world.png"); + this.userDataView = UserDataView.getDefaultUserDataView(); } for (CommandObject commandObject : game.getState().getCommand()) { diff --git a/Mage.Common/src/mage/view/UserDataView.java b/Mage.Common/src/mage/view/UserDataView.java index 9bf65b6f2e7..40171cbe315 100644 --- a/Mage.Common/src/mage/view/UserDataView.java +++ b/Mage.Common/src/mage/view/UserDataView.java @@ -18,15 +18,22 @@ public class UserDataView implements Serializable { protected boolean confirmEmptyManaPool; protected UserSkipPrioritySteps userSkipPrioritySteps; String flagName; + protected boolean askMoveToGraveOrder; + static UserDataView getDefaultUserDataView() { + return new UserDataView(0, false, false, true, null,"world.png", false); + } + public UserDataView(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, - boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) { + boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName, boolean askMoveToGraveOrder) { this.avatarId = avatarId; this.showAbilityPickerForced = showAbilityPickerForced; this.allowRequestShowHandCards = allowRequestShowHandCards; this.userSkipPrioritySteps = userSkipPrioritySteps; this.confirmEmptyManaPool = confirmEmptyManaPool; this.flagName = flagName; + this.askMoveToGraveOrder = askMoveToGraveOrder; + } public UserDataView(UserData userData) { @@ -37,6 +44,7 @@ public class UserDataView implements Serializable { this.userSkipPrioritySteps = userData.getUserSkipPrioritySteps(); this.confirmEmptyManaPool = userData.confirmEmptyManaPool(); this.flagName = userData.getFlagName(); + this.askMoveToGraveOrder = userData.askMoveToGraveOrder(); } public int getAvatarId() { @@ -62,5 +70,9 @@ public class UserDataView implements Serializable { public String getFlagName() { return flagName; } + + public boolean askMoveToGraveOrder() { + return askMoveToGraveOrder; + } } diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index e10917f2746..7daf4cb517b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -175,7 +175,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { public ComputerPlayer(String name, RangeOfInfluence range) { super(name, range); human = false; - userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png"); + userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png", false); pickedCards = new ArrayList<>(); } diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index 2560f43da87..5bfe452d51c 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -142,7 +142,7 @@ public class Session { if (user == null) { user = UserManager.getInstance().findUser("Admin"); } - user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png")); + user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png", false)); if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { logger.info("Error connecting Admin!"); } @@ -157,7 +157,7 @@ public class Session { userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId(), userDataView.isShowAbilityPickerForced(), userDataView.allowRequestShowHandCards(), userDataView.confirmEmptyManaPool(), userDataView.getUserSkipPrioritySteps(), - userDataView.getFlagName()); + userDataView.getFlagName(), userDataView.askMoveToGraveOrder()); user.setUserData(userData); } else { if (userDataView.getAvatarId() == 51) { // Update special avatar if first avatar is selected @@ -168,6 +168,7 @@ public class Session { userData.setAllowRequestShowHandCards(userDataView.allowRequestShowHandCards()); userData.setUserSkipPrioritySteps(userDataView.getUserSkipPrioritySteps()); userData.setConfirmEmptyManaPool(userDataView.confirmEmptyManaPool()); + userData.setAskMoveToGraveOrder(userDataView.askMoveToGraveOrder()); } return true; } diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 79702411d24..eb51a191511 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2936,9 +2936,11 @@ public abstract class PlayerImpl implements Player, Serializable { if (choosingPlayer == null) { continue; } - boolean chooseOrder = true; - if (cards.size() > 2) { - chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game); + boolean chooseOrder = false; + if (userData.askMoveToGraveOrder()) { + if (cards.size() > 3) { + chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game); + } } if (chooseOrder) { TargetCard target = new TargetCard(fromZone, new FilterCard("card to put on the top of your graveyard (last one chosen will be topmost)")); diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java index 72823bd53ea..b1b83a7a7cd 100644 --- a/Mage/src/mage/players/net/UserData.java +++ b/Mage/src/mage/players/net/UserData.java @@ -16,10 +16,11 @@ public class UserData implements Serializable { protected boolean confirmEmptyManaPool; protected UserSkipPrioritySteps userSkipPrioritySteps; protected String flagName; + protected boolean askMoveToGraveOrder; public UserData(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, - String flagName) { + String flagName, boolean askMoveToGraveOrder) { this.groupId = userGroup.getGroupId(); this.avatarId = avatarId; this.showAbilityPickerForced = showAbilityPickerForced; @@ -84,5 +85,13 @@ public class UserData implements Serializable { public String getFlagName() { return flagName; } + + public boolean askMoveToGraveOrder() { + return askMoveToGraveOrder; + } + + public void setAskMoveToGraveOrder(boolean askMoveToGraveOrder) { + this.askMoveToGraveOrder = askMoveToGraveOrder; + } } From f287156d9ad5c200162aa6398c367a29a737977e Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 16:58:31 +0300 Subject: [PATCH 021/148] Remove duplicate import --- Mage.Sets/src/mage/sets/portal/FireImp.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/portal/FireImp.java b/Mage.Sets/src/mage/sets/portal/FireImp.java index 790dc35e352..613ef39ba63 100644 --- a/Mage.Sets/src/mage/sets/portal/FireImp.java +++ b/Mage.Sets/src/mage/sets/portal/FireImp.java @@ -33,7 +33,6 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; From dcd18f3e84a6fd60d4ea81fde3e16e6a1f8900f9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 16:59:10 +0300 Subject: [PATCH 022/148] Implement cards: Extra Arms, Goblin Skycutter, and Saber Ants --- .../mage/sets/mercadianmasques/SaberAnts.java | 99 +++++++++++++++++++ .../src/mage/sets/scourge/ExtraArms.java | 77 +++++++++++++++ .../mage/sets/timespiral/GoblinSkycutter.java | 83 ++++++++++++++++ 3 files changed, 259 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java create mode 100644 Mage.Sets/src/mage/sets/scourge/ExtraArms.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java new file mode 100644 index 00000000000..04c41525247 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java @@ -0,0 +1,99 @@ +/* + * 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.mercadianmasques; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DealtDamageToSourceTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +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.token.InsectToken; +import mage.players.Player; + +/** + * + * @author LoneFox + + */ +public class SaberAnts extends CardImpl { + + public SaberAnts(UUID ownerId) { + super(ownerId, 267, "Saber Ants", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MMQ"; + this.subtype.add("Insect"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever Saber Ants is dealt damage, you may put that many 1/1 green Insect creature tokens onto the battlefield. + this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new SaberAntsEffect(), true)); + } + + public SaberAnts(final SaberAnts card) { + super(card); + } + + @Override + public SaberAnts copy() { + return new SaberAnts(this); + } +} + +class SaberAntsEffect extends OneShotEffect { + + public SaberAntsEffect() { + super(Outcome.Benefit); + this.staticText = "Whenever Saber Ants is dealt damage, you may put that many 1/1 green Insect creature tokens onto the battlefield."; + } + + public SaberAntsEffect(final SaberAntsEffect effect) { + super(effect); + } + + @Override + public SaberAntsEffect copy() { + return new SaberAntsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int damage = (Integer) this.getValue("damage"); + return new CreateTokenEffect(new InsectToken(), damage).apply(game, source); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/ExtraArms.java b/Mage.Sets/src/mage/sets/scourge/ExtraArms.java new file mode 100644 index 00000000000..b148cfeb158 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/ExtraArms.java @@ -0,0 +1,77 @@ +/* + * 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.scourge; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreatureOrPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class ExtraArms extends CardImpl { + + public ExtraArms(UUID ownerId) { + super(ownerId, 92, "Extra Arms", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Whenever enchanted creature attacks, it deals 2 damage to target creature or player. + ability = new AttacksAttachedTriggeredAbility(new DamageTargetEffect(2), AttachmentType.AURA, false); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ExtraArms(final ExtraArms card) { + super(card); + } + + @Override + public ExtraArms copy() { + return new ExtraArms(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java b/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java new file mode 100644 index 00000000000..5f5e114a8e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java @@ -0,0 +1,83 @@ +/* + * 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.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect; +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; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class GoblinSkycutter extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public GoblinSkycutter(UUID ownerId) { + super(ownerId, 159, "Goblin Skycutter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Sacrifice Goblin Skycutter: Goblin Skycutter deals 2 damage to target creature with flying. That creature loses flying until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new SacrificeSourceCost()); + ability.addEffect(new LoseAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public GoblinSkycutter(final GoblinSkycutter card) { + super(card); + } + + @Override + public GoblinSkycutter copy() { + return new GoblinSkycutter(this); + } +} From 1a0adae936ef579087707bc96ee9a95ea6354263 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 18:58:43 +0300 Subject: [PATCH 023/148] Implement cards: Drekavac, Erg Raiders, Hasran Ogress, and Sewer Rats --- .../mage/sets/arabiannights/ErgRaiders.java | 53 +++++++++ .../mage/sets/arabiannights/HasranOgress.java | 53 +++++++++ .../src/mage/sets/dissension/Drekavac.java | 76 +++++++++++++ .../mage/sets/fifthedition/ErgRaiders.java | 53 +++++++++ .../mage/sets/fourthedition/ErgRaiders.java | 90 +++++++++++++++ .../mage/sets/mastersedition/ErgRaiders.java | 53 +++++++++ .../sets/masterseditioniv/HasranOgress.java | 103 ++++++++++++++++++ Mage.Sets/src/mage/sets/mirage/SewerRats.java | 71 ++++++++++++ .../mage/sets/revisededition/ErgRaiders.java | 53 +++++++++ 9 files changed, 605 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java create mode 100644 Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java create mode 100644 Mage.Sets/src/mage/sets/dissension/Drekavac.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java create mode 100644 Mage.Sets/src/mage/sets/mirage/SewerRats.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java new file mode 100644 index 00000000000..840710323ef --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java @@ -0,0 +1,53 @@ +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 3; + this.expansionSetCode = "ARN"; + } + + public ErgRaiders(final ErgRaiders card) { + super(card); + } + + @Override + public ErgRaiders copy() { + return new ErgRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java new file mode 100644 index 00000000000..767c07fa5c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java @@ -0,0 +1,53 @@ +/* + * 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.arabiannights; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class HasranOgress extends mage.sets.masterseditioniv.HasranOgress { + + public HasranOgress(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "ARN"; + } + + public HasranOgress(final HasranOgress card) { + super(card); + } + + @Override + public HasranOgress copy() { + return new HasranOgress(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/Drekavac.java b/Mage.Sets/src/mage/sets/dissension/Drekavac.java new file mode 100644 index 00000000000..e752a3ac8fa --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/Drekavac.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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInHand; + +/** + * + * @author LoneFox + + */ +public class Drekavac extends CardImpl { + + private static final FilterCard filter = new FilterCard("noncreature card"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public Drekavac(UUID ownerId) { + super(ownerId, 43, "Drekavac", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Beast"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Drekavac enters the battlefield, sacrifice it unless you discard a noncreature card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(filter))))); + } + + public Drekavac(final Drekavac card) { + super(card); + } + + @Override + public Drekavac copy() { + return new Drekavac(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java new file mode 100644 index 00000000000..dae9ebd5a3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java @@ -0,0 +1,53 @@ +/* + * 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 ErgRaiders extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "5ED"; + } + + public ErgRaiders(final ErgRaiders card) { + super(card); + } + + @Override + public ErgRaiders copy() { + return new ErgRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java new file mode 100644 index 00000000000..532891ad019 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java @@ -0,0 +1,90 @@ +/* + * 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.TriggeredAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisTurnWatcher; + +/** + * + * @author LoneFox + + */ +public class ErgRaiders extends CardImpl { + + public ErgRaiders(UUID ownerId) { + super(ownerId, 19, "Erg Raiders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn. + TriggeredAbility ability = new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility(new DamageControllerEffect(2), TargetController.YOU, false), + new ErgRaidersCondition(), "At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn."); + ability.addWatcher(new AttackedThisTurnWatcher()); + this.addAbility(ability); + } + + public ErgRaiders(final ErgRaiders card) { + super(card); + } + + @Override + public ErgRaiders copy() { + return new ErgRaiders(this); + } +} + +class ErgRaidersCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent raiders = game.getPermanentOrLKIBattlefield(source.getSourceId()); + AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn"); + if(raiders.wasControlledFromStartOfControllerTurn() && !watcher.getAttackedThisTurnCreatures().contains(raiders.getId())) { + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java new file mode 100644 index 00000000000..854f83d1a03 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java @@ -0,0 +1,53 @@ +/* + * 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 ErgRaiders extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "MED"; + } + + public ErgRaiders(final ErgRaiders card) { + super(card); + } + + @Override + public ErgRaiders copy() { + return new ErgRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java b/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java new file mode 100644 index 00000000000..f183ab6e5a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java @@ -0,0 +1,103 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + + */ +public class HasranOgress extends CardImpl { + + public HasranOgress(UUID ownerId) { + super(ownerId, 86, "Hasran Ogress", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Hasran Ogress attacks, it deals 3 damage to you unless you pay {2}. + this.addAbility(new AttacksTriggeredAbility(new HasranOgressEffect(), false)); + } + + public HasranOgress(final HasranOgress card) { + super(card); + } + + @Override + public HasranOgress copy() { + return new HasranOgress(this); + } +} + +class HasranOgressEffect extends OneShotEffect { + + public HasranOgressEffect() { + super(Outcome.Damage); + this.staticText = "{this} deals 3 damage to you unless you pay {2}"; + } + + public HasranOgressEffect(final HasranOgressEffect effect) { + super(effect); + } + + @Override + public HasranOgressEffect copy() { + return new HasranOgressEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cost cost = new ManaCostsImpl("{2}"); + String message = "Would you like to pay {2} to prevent taking 3 damage from Hasran Ogress?"; + if (!(controller.chooseUse(Outcome.Benefit, message, game) + && cost.pay(source, game, source.getSourceId(), controller.getId(), false))) { + controller.damage(3, source.getSourceId(), game, false, true); + } + return true; + } + return false; + } +} + diff --git a/Mage.Sets/src/mage/sets/mirage/SewerRats.java b/Mage.Sets/src/mage/sets/mirage/SewerRats.java new file mode 100644 index 00000000000..4422dd8667c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/SewerRats.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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.LimitedTimesPerTurnActivatedAbility; +import mage.abilities.costs.common.PayLifeCost; +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 SewerRats extends CardImpl { + + public SewerRats(UUID ownerId) { + super(ownerId, 37, "Sewer Rats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Rat"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}, Pay 1 life: Sewer Rats gets +1/+0 until end of turn. Activate this ability no more than three times each turn. + Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}"), 3); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + public SewerRats(final SewerRats card) { + super(card); + } + + @Override + public SewerRats copy() { + return new SewerRats(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java b/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java new file mode 100644 index 00000000000..d6419978e4f --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java @@ -0,0 +1,53 @@ +/* + * 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; + +/** + * + * @author LoneFox + + */ +public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders { + + public ErgRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 17; + this.expansionSetCode = "3ED"; + } + + public ErgRaiders(final ErgRaiders card) { + super(card); + } + + @Override + public ErgRaiders copy() { + return new ErgRaiders(this); + } +} From e48be86f7b67f2757451059f77848bea13744066 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 19:21:03 +0200 Subject: [PATCH 024/148] * Zoetic Cavern - Fixed that if cast with Morph the spell was not handled as spell with card type "Creature" (e.g. causing problem with Possibility Storm). --- .../mage/sets/commander2014/ZoeticCavern.java | 2 +- .../cards/triggers/PossibilityStormTest.java | 95 +++++++++++++++++++ Mage/src/mage/abilities/AbilityImpl.java | 2 +- Mage/src/mage/constants/SpellAbilityType.java | 2 +- Mage/src/mage/game/stack/Spell.java | 5 + Mage/src/mage/players/PlayerImpl.java | 2 +- 6 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java diff --git a/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java b/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java index 6613499c77d..ed54e110b30 100644 --- a/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java +++ b/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java @@ -46,7 +46,7 @@ public class ZoeticCavern extends CardImpl { this.expansionSetCode = "C14"; // {T}: Add {1} to your mana pool. - this.addAbility(new ColorlessManaAbility()); + this.addAbility(new ColorlessManaAbility()); // Morph {2} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}"))); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java new file mode 100644 index 00000000000..6501fbf2ab9 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java @@ -0,0 +1,95 @@ +/* + * 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; + + +import mage.cards.Card; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class PossibilityStormTest extends CardTestPlayerBase { + + /** + * There's currently a bug with Possibility Storm and Zoetic Cavern. The way + * it's supposed to work is the P. Storm trigger exiles Zoetic Cavern and + * then uses last known information about the spell to determine the type of + * card the trigger is looking for(creature in this instance). Instead it's + * basing the type solely off what's printed on the card. What happened to + * me earlier was the trigger skipped right over an Emrakul and then + * revealed a Flooded Strand. I was prompted whether or not I wanted to + * "cast" Flooded Strand without paying it's cost. Eventually I clicked yes + * and it produced a Game Error that resulted in rollback. I recreated the + * error against an AI opponent and copied the code. Can't actually post it + * because the filter on this site claims it makes my post look too + * "spammy". Here's a screenshot of it instead(in spoiler tag). + */ + + @Test + public void TestWithZoeticCavern() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3); + // Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from + // the top of his or her library until he or she exiles a card that shares a card type with it. That + // player may cast that card without paying its mana cost. Then he or she puts all cards exiled with + // Possibility Storm on the bottom of his or her library in a random order. + addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 2); + + // {T}: Add {1} to your mana pool. + // Morph {2} + addCard(Zone.HAND, playerA, "Zoetic Cavern"); + + addCard(Zone.LIBRARY, playerA, "Silvercoat Lion"); + skipInitShuffling(); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Zoetic Cavern"); + setChoice(playerA, "Yes"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Zoetic Cavern", 0); + + boolean zoeticCavernInLibrary = false; + for (Card card: playerA.getLibrary().getCards(currentGame)) { + if (card.getName().equals("Zoetic Cavern")) { + zoeticCavernInLibrary = true; + } + } + Assert.assertEquals("Zoetic Cavern has to be in the library", true, zoeticCavernInLibrary); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 7621c9adadf..c7bbd061e53 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -299,7 +299,7 @@ public abstract class AbilityImpl implements Ability { // A player can't apply two alternative methods of casting or two alternative costs to a single spell. if (!activateAlternateOrAdditionalCosts(sourceObject, noMana, controller, game)){ if (getAbilityType().equals(AbilityType.SPELL) - && ((SpellAbility) this).getSpellAbilityType().equals(SpellAbilityType.LAND_ALTERNATE)) { + && ((SpellAbility) this).getSpellAbilityType().equals(SpellAbilityType.FACE_DOWN_CREATURE)) { return false; } } diff --git a/Mage/src/mage/constants/SpellAbilityType.java b/Mage/src/mage/constants/SpellAbilityType.java index 70af522434f..881fdf06a6c 100644 --- a/Mage/src/mage/constants/SpellAbilityType.java +++ b/Mage/src/mage/constants/SpellAbilityType.java @@ -7,7 +7,7 @@ package mage.constants; public enum SpellAbilityType { BASE("Basic SpellAbility"), BASE_ALTERNATE("Basic SpellAbility Alternate"), // used for Overload, Flashback to know they must be handled as Alternate casting costs - LAND_ALTERNATE("Basic SpellAbility Alternate Land"), // used for Lands with Morph to cast as Face Down creature + FACE_DOWN_CREATURE("Face down creature"), // used for Lands with Morph to cast as Face Down creature SPLIT("Split SpellAbility"), SPLIT_FUSED("Split SpellAbility"), SPLIT_LEFT("LeftSplit SpellAbility"), diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index bbb1ef01d8f..2ae5dd56c79 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -372,6 +372,11 @@ public class Spell extends StackObjImpl implements Card { @Override public List getCardType() { + if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.FACE_DOWN_CREATURE)) { + List cardTypes = new ArrayList<>(); + cardTypes.add(CardType.CREATURE); + return cardTypes; + } if (this.getSpellAbility() instanceof BestowAbility) { List cardTypes = new ArrayList<>(); cardTypes.addAll(card.getCardType()); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index eb51a191511..7accbb420a4 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -989,7 +989,7 @@ public abstract class PlayerImpl implements Player, Serializable { } } if (found) { - SpellAbility spellAbility = new SpellAbility(null, "", game.getState().getZone(card.getId()), SpellAbilityType.LAND_ALTERNATE); + SpellAbility spellAbility = new SpellAbility(null, "", game.getState().getZone(card.getId()), SpellAbilityType.FACE_DOWN_CREATURE); spellAbility.setControllerId(this.getId()); spellAbility.setSourceId(card.getId()); if (cast(spellAbility, game, false)) { From 6d2f95c591ed4240c57b7a8128892ed90e1c91eb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 19:57:08 +0200 Subject: [PATCH 025/148] * Fixed that countering the half of a split spell did not work correctly. --- .../counterspell/CounterspellTest.java | 80 +++++++++++++++++++ Mage/src/mage/cards/CardImpl.java | 6 ++ 2 files changed, 86 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java new file mode 100644 index 00000000000..1481997f5af --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java @@ -0,0 +1,80 @@ +/* + * 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.abilities.oneshot.counterspell; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class CounterspellTest extends CardTestPlayerBase { + + /** + It looks like Boom//Bust can't be countered (although it says it's countered in the log). + + Code: Select all + 13:10: Benno casts Boom [8ce] targeting Mountain [4c8] Island [80c] + 13:10: Benno casts Counterspell [2b7] targeting Boom [8ce] + 13:10: Benno puts Boom [8ce] from stack into his or her graveyard + 13:10: Boom is countered by Counterspell [2b7] + 13:10: Benno puts Counterspell [2b7] from stack into his or her graveyard + 13:10: Mountain [4c8] was destroyed + 13:10: Island [80c] was destroyed + */ + + @Test + public void testCounterSplitSpell() { + // Boom - Sorcery {1}{R} + // Destroy target land you control and target land you don't control. + addCard(Zone.HAND, playerA, "Boom // Bust"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.HAND, playerB, "Counterspell"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boom", "Mountain^Island"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Boom"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Boom // Bust", 1); + assertGraveyardCount(playerB, "Counterspell", 1); + + assertPermanentCount(playerA, "Mountain", 2); + assertPermanentCount(playerB, "Island", 2); + + assertLife(playerA, 20); + assertLife(playerB, 20); + } +} diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index b656ae3bf29..8f9f4ee18a6 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -359,6 +359,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card { break; case STACK: StackObject stackObject = game.getStack().getSpell(getId()); + if (stackObject == null && (this instanceof SplitCard)) { // handle if half od Split cast is on the stack + stackObject = game.getStack().getSpell(((SplitCard)this).getLeftHalfCard().getId()); + if (stackObject == null) { + stackObject = game.getStack().getSpell(((SplitCard)this).getRightHalfCard().getId()); + } + } if (stackObject != null) { game.getStack().remove(stackObject); } From 2036dd104fb03f381dae3ed3eed9dacc00042071 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 20:08:22 +0200 Subject: [PATCH 026/148] * Ancient Stirrings - Fixed that the card selection to move a card to hand was not optional (fixes #1020). --- .../src/mage/sets/riseoftheeldrazi/AncientStirrings.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java index e8d1a74c219..9c08a777ab5 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java @@ -37,6 +37,7 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorlessPredicate; import java.util.UUID; +import mage.constants.Zone; /** * @author LevelX @@ -54,10 +55,11 @@ public class AncientStirrings extends CardImpl { super(ownerId, 174, "Ancient Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "ROE"; - // Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand. // Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.) - this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); + this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, Zone.LIBRARY, + false, true, false, Zone.HAND, true)); + } public AncientStirrings(final AncientStirrings card) { From f98e3703312526fa775131458b91353b022fdc11 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 20:48:56 +0200 Subject: [PATCH 027/148] * Fixed that attack each turn if able was always handled like attack each combat if able. --- .../sets/khansoftarkir/ZurgoHelmsmasher.java | 4 +-- .../sets/magic2014/MaraudingMaulhorn.java | 2 +- .../AttacksEachCombatStaticAbility.java | 33 +++++++++++++++++++ .../common/AttacksEachTurnStaticAbility.java | 2 ++ .../combat/AttacksIfAbleSourceEffect.java | 25 +++++++++++--- .../common/AttackedThisTurnWatcher.java | 1 + 6 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java b/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java index e003a002255..01fbf263c89 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java @@ -29,7 +29,7 @@ package mage.sets.khansoftarkir; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.common.AttacksEachCombatStaticAbility; import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MyTurnCondition; @@ -64,7 +64,7 @@ public class ZurgoHelmsmasher extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // Zurgo Helmsmasher attacks each combat if able. - this.addAbility(new AttacksEachTurnStaticAbility()); + this.addAbility(new AttacksEachCombatStaticAbility()); // Zurgo Helmsmasher has indestructible as long as it's your turn. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield), diff --git a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java index e5fa803cc8b..a43e8d31670 100644 --- a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java +++ b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java @@ -63,7 +63,7 @@ public class MaraudingMaulhorn extends CardImpl { // Marauding Maulhorn attacks each combat if able unless you control a creature named Advocate of the Beast. Effect effect = new ConditionalRequirementEffect( - new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield), + new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true), new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 1)); effect.setText("{this} attacks each combat if able unless you control a creature named Advocate of the Beast"); diff --git a/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java new file mode 100644 index 00000000000..adb4be894b1 --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java @@ -0,0 +1,33 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.StaticAbility; +import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; +import mage.constants.Duration; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ + +public class AttacksEachCombatStaticAbility extends StaticAbility { + + public AttacksEachCombatStaticAbility() { + super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true)); + } + + public AttacksEachCombatStaticAbility(AttacksEachCombatStaticAbility ability) { + super(ability); + } + + @Override + public AttacksEachCombatStaticAbility copy() { + return new AttacksEachCombatStaticAbility(this); + } + +} diff --git a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java index 19951542b6a..7e5d27f7cd4 100644 --- a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java +++ b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java @@ -32,6 +32,7 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.abilities.StaticAbility; import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -41,6 +42,7 @@ public class AttacksEachTurnStaticAbility extends StaticAbility { public AttacksEachTurnStaticAbility() { super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield)); + addWatcher(new AttackedThisTurnWatcher()); } public AttacksEachTurnStaticAbility(AttacksEachTurnStaticAbility ability) { diff --git a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java index 104d3bdfe04..4390a891a11 100644 --- a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java @@ -33,6 +33,7 @@ import mage.abilities.Ability; import mage.abilities.effects.RequirementEffect; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisTurnWatcher; /** * @@ -40,18 +41,25 @@ import mage.game.permanent.Permanent; */ public class AttacksIfAbleSourceEffect extends RequirementEffect { + boolean eachCombat; + public AttacksIfAbleSourceEffect(Duration duration) { + this(duration, false); + } + + public AttacksIfAbleSourceEffect(Duration duration, boolean eachCombat) { super(duration); + this.eachCombat = eachCombat; if (this.duration == Duration.EndOfTurn) { - staticText = "{this} attacks this turn if able"; - } - else { - staticText = "{this} attacks each turn if able"; + staticText = "{this} attacks " + (eachCombat ? "each combat" :"this turn") + " if able"; + } else { + staticText = "{this} attacks each " + (eachCombat ? "combat" :"turn") + " if able"; } } public AttacksIfAbleSourceEffect(final AttacksIfAbleSourceEffect effect) { super(effect); + this.eachCombat = effect.eachCombat; } @Override @@ -61,7 +69,14 @@ public class AttacksIfAbleSourceEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return permanent.getId().equals(source.getSourceId()); + if (permanent.getId().equals(source.getSourceId())) { + if (eachCombat) { + return true; + } + AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher)game.getState().getWatchers().get("AttackedThisTurn"); + return watcher != null && !watcher.getAttackedThisTurnCreatures().contains(permanent.getId()); + } + return false; } @Override diff --git a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java index be9dac03561..febd9d3eaa7 100644 --- a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java +++ b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java @@ -40,6 +40,7 @@ import mage.watchers.Watcher; */ public class AttackedThisTurnWatcher extends Watcher { + // TODO: use MageObjectReference instead of UUID public Set attackedThisTurnCreatures = new HashSet<>(); public AttackedThisTurnWatcher() { From d738a5ccce839d06b5755eacf8dca1b5042d8e08 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 21:11:16 +0200 Subject: [PATCH 028/148] * Soul Foundry - Fixed that the activation cost for the ability to put a copy of the imprinted card to the battlefield was calculated wrongly (fixes #1019). --- .../mage/sets/innistrad/BloodlineKeeper.java | 2 +- .../src/mage/sets/mirrodin/SoulFoundry.java | 27 ++++---- .../test/cards/single/SoulFoundryTest.java | 67 +++++++++++++++++++ 3 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index 1c7d05c764d..94a3961d9d5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -67,7 +67,7 @@ public class BloodlineKeeper extends CardImpl { this.secondSideCard = new LordOfLineage(ownerId); this.addAbility(FlyingAbility.getInstance()); - // {tap}: Put a 2/2 black Vampire creature token with flying onto the battlefield. + // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); // {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires. this.addAbility(new TransformAbility()); diff --git a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java index cd94be9ca31..8e4c6a28792 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java @@ -65,7 +65,7 @@ public class SoulFoundry extends CardImpl { // Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand. this.addAbility(new EntersBattlefieldTriggeredAbility(new SoulFoundryImprintEffect(), true, "Imprint - ")); - // {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. + // {X}, {T}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulFoundryEffect(), new ManaCostsImpl("{X}")); ability.addCost(new TapSourceCost()); this.addAbility(ability); @@ -78,20 +78,23 @@ public class SoulFoundry extends CardImpl { @Override public void adjustCosts(Ability ability, Game game) { - Permanent card = game.getPermanent(ability.getSourceId()); - if (card != null) { - if (card.getImprinted().size() > 0) { - Card imprinted = game.getCard(card.getImprinted().get(0)); - if (imprinted != null) { - ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); + if (ability instanceof SimpleActivatedAbility) { + Permanent sourcePermanent = game.getPermanent(ability.getSourceId()); + if (sourcePermanent != null) { + if (sourcePermanent.getImprinted().size() > 0) { + Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0)); + if (imprinted != null) { + ability.getManaCostsToPay().clear(); + ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost())); + } } } - } - // no {X} anymore as we already have imprinted the card with defined manacost - for (ManaCost cost : ability.getManaCostsToPay()) { - if (cost instanceof VariableCost) { - cost.setPaid(); + // no {X} anymore as we already have imprinted the card with defined manacost + for (ManaCost cost : ability.getManaCostsToPay()) { + if (cost instanceof VariableCost) { + cost.setPaid(); + } } } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java new file mode 100644 index 00000000000..326e36c81ce --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java @@ -0,0 +1,67 @@ +/* + * 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.single; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class SoulFoundryTest extends CardTestPlayerBase { + + /** + * Soul Foundry imprinted with Bloodline Keeper costs 8 colorless mana to + * use the ability instead of 4 (the converted mana cost of Bloodline + * Keeper). + */ + @Test + public void testBloodlineKeeper() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 8); + // Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand. + // {X}, {T}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card. + addCard(Zone.HAND, playerA, "Soul Foundry"); // {4} + addCard(Zone.HAND, playerA, "Bloodline Keeper"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Foundry"); + setChoice(playerA, "Yes"); + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},{T}: Put a token"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Soul Foundry", 1); + + assertExileCount("Bloodline Keeper", 1); + assertPermanentCount(playerA, "Bloodline Keeper", 1); + } +} \ No newline at end of file From 921361ac3860096fb44a2af8239826ef79650504 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 13 Jun 2015 22:30:18 +0300 Subject: [PATCH 029/148] Fix Stromkirk Noble's missing tooltip text by reimplementing the ability in (what I believe to be) the standard way for such abilities. --- .../mage/sets/innistrad/StromkirkNoble.java | 58 +++++-------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java index bae289634cb..8d3e95c0cb3 100644 --- a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java +++ b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java @@ -29,20 +29,18 @@ package mage.sets.innistrad; import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.RestrictionEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,6 +49,12 @@ import mage.game.permanent.Permanent; */ public class StromkirkNoble extends CardImpl { + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Humans"); + + static { + filter.add(new SubtypePredicate("Human")); + } + public StromkirkNoble(UUID ownerId) { super(ownerId, 164, "Stromkirk Noble", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); this.expansionSetCode = "ISD"; @@ -60,8 +64,8 @@ public class StromkirkNoble extends CardImpl { this.toughness = new MageInt(1); // Stromkirk Noble can't be blocked by Humans. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StromkirkEffect())); - // Whenever Stromkirk Noble deals combat damage to a player, put a +1/+1 counter on it. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + // Whenever Stromkirk Noble deals combat damage to a player, put a +1/+1 counter on it. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); } @@ -75,33 +79,3 @@ public class StromkirkNoble extends CardImpl { return new StromkirkNoble(this); } } - -class StromkirkEffect extends RestrictionEffect { - - public StromkirkEffect() { - super(Duration.WhileOnBattlefield); - } - - public StromkirkEffect(final StromkirkEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getSourceId())) { - return true; - } - return false; - } - - @Override - public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return !blocker.hasSubtype("Human"); - } - - @Override - public StromkirkEffect copy() { - return new StromkirkEffect(this); - } - -} \ No newline at end of file From adefaf890ab0eb42f3c9f141103364d8b75ee461 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 21:52:54 +0200 Subject: [PATCH 030/148] [ORI] Added 47 cards. --- .../client/util/sets/ConstructedFormats.java | 4 +- .../src/main/resources/image.url.properties | 2 +- .../mage/sets/magicorigins/ActOfTreason.java | 54 ++++++++++++++ .../mage/sets/magicorigins/AegisAngel.java | 52 +++++++++++++ .../mage/sets/magicorigins/AkroanJailer.java | 74 +++++++++++++++++++ .../mage/sets/magicorigins/BellowsLizard.java | 52 +++++++++++++ .../mage/sets/magicorigins/CatacombSlug.java | 52 +++++++++++++ .../mage/sets/magicorigins/ChandrasFury.java | 52 +++++++++++++ .../sets/magicorigins/ChargingGriffin.java | 52 +++++++++++++ .../sets/magicorigins/Claustrophobia.java | 52 +++++++++++++ .../mage/sets/magicorigins/Cobblebrute.java | 52 +++++++++++++ .../mage/sets/magicorigins/CruelRevival.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/Disperse.java | 52 +++++++++++++ .../mage/sets/magicorigins/DivineVerdict.java | 52 +++++++++++++ .../sets/magicorigins/EagleOfTheWatch.java | 65 ++++++++++++++++ .../sets/magicorigins/ElvishVisionary.java | 52 +++++++++++++ .../sets/magicorigins/FieryConclusion.java | 52 +++++++++++++ .../sets/magicorigins/FieryHellhound.java | 52 +++++++++++++ .../mage/sets/magicorigins/FleshToDust.java | 52 +++++++++++++ .../sets/magicorigins/GoldForgedSentinel.java | 52 +++++++++++++ .../sets/magicorigins/HitchclawRecluse.java | 62 ++++++++++++++++ .../src/mage/sets/magicorigins/Hydrolash.java | 63 ++++++++++++++++ .../mage/sets/magicorigins/IntoTheVoid.java | 52 +++++++++++++ .../mage/sets/magicorigins/JayemdaeTome.java | 54 ++++++++++++++ .../mage/sets/magicorigins/LeafGilder.java | 52 +++++++++++++ .../mage/sets/magicorigins/MahamotiDjinn.java | 52 +++++++++++++ .../mage/sets/magicorigins/MaritimeGuard.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/Meteorite.java | 52 +++++++++++++ .../mage/sets/magicorigins/MightyLeap.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/MindRot.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/Nightmare.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/Plummet.java | 52 +++++++++++++ .../mage/sets/magicorigins/PrizedUnicorn.java | 52 +++++++++++++ .../mage/sets/magicorigins/RingwardenOwl.java | 65 ++++++++++++++++ .../mage/sets/magicorigins/RunedServitor.java | 52 +++++++++++++ .../sets/magicorigins/ScrapskinDrake.java | 52 +++++++++++++ .../mage/sets/magicorigins/SengirVampire.java | 54 ++++++++++++++ .../mage/sets/magicorigins/SerraAngel.java | 54 ++++++++++++++ .../mage/sets/magicorigins/ShivanDragon.java | 52 +++++++++++++ .../mage/sets/magicorigins/TerraStomper.java | 52 +++++++++++++ .../mage/sets/magicorigins/TitanicGrowth.java | 52 +++++++++++++ .../sets/magicorigins/TitansStrength.java | 52 +++++++++++++ .../mage/sets/magicorigins/TowerGeist.java | 52 +++++++++++++ .../mage/sets/magicorigins/ValorInAkros.java | 60 +++++++++++++++ .../sets/magicorigins/VastwoodGorger.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/WeaveFate.java | 52 +++++++++++++ .../magicorigins/WeightOfTheUnderworld.java | 52 +++++++++++++ .../sets/magicorigins/YevasForcemage.java | 52 +++++++++++++ .../src/mage/sets/magicorigins/YokedOx.java | 52 +++++++++++++ 49 files changed, 2532 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/AegisAngel.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Disperse.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/FleshToDust.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Meteorite.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/MindRot.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Nightmare.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/Plummet.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/SengirVampire.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/SerraAngel.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/TerraStomper.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/WeaveFate.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/YokedOx.java diff --git a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java index 5cd0fe2b2b0..81bc28210b6 100644 --- a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java +++ b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java @@ -29,7 +29,7 @@ public class ConstructedFormats { public static final String MODERN = "- Modern"; private static final Map> underlyingSetCodesPerFormat = new HashMap<>(); - private static final List formats = new ArrayList(); + private static final List formats = new ArrayList<>(); private ConstructedFormats() { } @@ -59,7 +59,7 @@ public class ConstructedFormats { else { cutoff = new GregorianCalendar(calendar.get(Calendar.YEAR) - 2, Calendar.SEPTEMBER, 1); } - final Map expansionInfo = new HashMap(); + final Map expansionInfo = new HashMap<>(); for (ExpansionInfo set : ExpansionRepository.instance.getAll()) { expansionInfo.put(set.getName(), set); formats.add(set.getName()); diff --git a/Mage.Client/src/main/resources/image.url.properties b/Mage.Client/src/main/resources/image.url.properties index 7ba6f59ee2e..21a5556cc22 100644 --- a/Mage.Client/src/main/resources/image.url.properties +++ b/Mage.Client/src/main/resources/image.url.properties @@ -64,6 +64,6 @@ ddd=gvl unh=uh dde=pvc # Remove setname as soon as the images can be downloaded -ignore.urls=TOK,MMB,ORI +ignore.urls=TOK,MMB # sets ordered by release time (newest goes first) token.lookup.order=TPR,MPRP,DD3,DDO,ORI,MMB,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.java b/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.java new file mode 100644 index 00000000000..ab0270570c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.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.magicorigins; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ActOfTreason extends mage.sets.magic2010.ActOfTreason { + + public ActOfTreason(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + this.rarity = Rarity.COMMON; + } + + public ActOfTreason(final ActOfTreason card) { + super(card); + } + + @Override + public ActOfTreason copy() { + return new ActOfTreason(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.java b/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.java new file mode 100644 index 00000000000..8f604f6dbf6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AegisAngel extends mage.sets.magic2012.AegisAngel { + + public AegisAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 273; + this.expansionSetCode = "ORI"; + } + + public AegisAngel(final AegisAngel card) { + super(card); + } + + @Override + public AegisAngel copy() { + return new AegisAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java b/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java new file mode 100644 index 00000000000..cd3162e2c69 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class AkroanJailer extends CardImpl { + + public AkroanJailer(UUID ownerId) { + super(ownerId, 1, "Akroan Jailer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {2}{W}, {T}: Tap target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{2}{W}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + + } + + public AkroanJailer(final AkroanJailer card) { + super(card); + } + + @Override + public AkroanJailer copy() { + return new AkroanJailer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.java b/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.java new file mode 100644 index 00000000000..f43dc9c3ea2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class BellowsLizard extends mage.sets.returntoravnica.BellowsLizard { + + public BellowsLizard(UUID ownerId) { + super(ownerId); + this.cardNumber = 132; + this.expansionSetCode = "ORI"; + } + + public BellowsLizard(final BellowsLizard card) { + super(card); + } + + @Override + public BellowsLizard copy() { + return new BellowsLizard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java new file mode 100644 index 00000000000..38ceb429d07 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug { + + public CatacombSlug(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public CatacombSlug(final CatacombSlug card) { + super(card); + } + + @Override + public CatacombSlug copy() { + return new CatacombSlug(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java new file mode 100644 index 00000000000..7aafc1d8ef6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ChandrasFury extends mage.sets.magic2013.ChandrasFury { + + public ChandrasFury(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public ChandrasFury(final ChandrasFury card) { + super(card); + } + + @Override + public ChandrasFury copy() { + return new ChandrasFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java new file mode 100644 index 00000000000..3cbc9c975af --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin { + + public ChargingGriffin(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public ChargingGriffin(final ChargingGriffin card) { + super(card); + } + + @Override + public ChargingGriffin copy() { + return new ChargingGriffin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java new file mode 100644 index 00000000000..b363d80e591 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Claustrophobia extends mage.sets.innistrad.Claustrophobia { + + public Claustrophobia(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public Claustrophobia(final Claustrophobia card) { + super(card); + } + + @Override + public Claustrophobia copy() { + return new Claustrophobia(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java new file mode 100644 index 00000000000..97349a0e0e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute { + + public Cobblebrute(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public Cobblebrute(final Cobblebrute card) { + super(card); + } + + @Override + public Cobblebrute copy() { + return new Cobblebrute(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java new file mode 100644 index 00000000000..7682e5befe8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class CruelRevival extends mage.sets.onslaught.CruelRevival { + + public CruelRevival(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public CruelRevival(final CruelRevival card) { + super(card); + } + + @Override + public CruelRevival copy() { + return new CruelRevival(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java new file mode 100644 index 00000000000..7581651100b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Disperse.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Disperse extends mage.sets.scarsofmirrodin.Disperse { + + public Disperse(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public Disperse(final Disperse card) { + super(card); + } + + @Override + public Disperse copy() { + return new Disperse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.java b/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.java new file mode 100644 index 00000000000..492afb6c562 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DivineVerdict extends mage.sets.magic2010.DivineVerdict { + + public DivineVerdict(UUID ownerId) { + super(ownerId); + this.cardNumber = 274; + this.expansionSetCode = "ORI"; + } + + public DivineVerdict(final DivineVerdict card) { + super(card); + } + + @Override + public DivineVerdict copy() { + return new DivineVerdict(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.java b/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.java new file mode 100644 index 00000000000..48ef646ab0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class EagleOfTheWatch extends CardImpl { + + public EagleOfTheWatch(UUID ownerId) { + super(ownerId, 275, "Eagle of the Watch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + } + + public EagleOfTheWatch(final EagleOfTheWatch card) { + super(card); + } + + @Override + public EagleOfTheWatch copy() { + return new EagleOfTheWatch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java new file mode 100644 index 00000000000..d901aee1be2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary { + + public ElvishVisionary(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public ElvishVisionary(final ElvishVisionary card) { + super(card); + } + + @Override + public ElvishVisionary copy() { + return new ElvishVisionary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java new file mode 100644 index 00000000000..a973a8e8d1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FieryConclusion extends mage.sets.ravnica.FieryConclusion { + + public FieryConclusion(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public FieryConclusion(final FieryConclusion card) { + super(card); + } + + @Override + public FieryConclusion copy() { + return new FieryConclusion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.java b/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.java new file mode 100644 index 00000000000..7c1fa061165 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FieryHellhound extends mage.sets.magic2010.FieryHellhound { + + public FieryHellhound(UUID ownerId) { + super(ownerId); + this.cardNumber = 284; + this.expansionSetCode = "ORI"; + } + + public FieryHellhound(final FieryHellhound card) { + super(card); + } + + @Override + public FieryHellhound copy() { + return new FieryHellhound(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.java b/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.java new file mode 100644 index 00000000000..2c04313f824 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class FleshToDust extends mage.sets.magic2015.FleshToDust { + + public FleshToDust(UUID ownerId) { + super(ownerId); + this.cardNumber = 280; + this.expansionSetCode = "ORI"; + } + + public FleshToDust(final FleshToDust card) { + super(card); + } + + @Override + public FleshToDust copy() { + return new FleshToDust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java new file mode 100644 index 00000000000..418337f87b1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSentinel { + + public GoldForgedSentinel(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public GoldForgedSentinel(final GoldForgedSentinel card) { + super(card); + } + + @Override + public GoldForgedSentinel copy() { + return new GoldForgedSentinel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java b/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java new file mode 100644 index 00000000000..23193c76d9b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class HitchclawRecluse extends CardImpl { + + public HitchclawRecluse(UUID ownerId) { + super(ownerId, 181, "Hitchclaw Recluse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Spider"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Reach + this.addAbility(ReachAbility.getInstance()); + } + + public HitchclawRecluse(final HitchclawRecluse card) { + super(card); + } + + @Override + public HitchclawRecluse copy() { + return new HitchclawRecluse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java b/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java new file mode 100644 index 00000000000..73e088a3dc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.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.magicorigins; + +import java.util.UUID; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; + +/** + * + * @author LevelX2 + */ +public class Hydrolash extends CardImpl { + + public Hydrolash(UUID ownerId) { + super(ownerId, 59, "Hydrolash", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); + this.expansionSetCode = "ORI"; + + // Attacking creatures get -2/-0 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(-2, 0, Duration.EndOfTurn, new FilterAttackingCreature(), false)); + // Draw a card. + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + } + + public Hydrolash(final Hydrolash card) { + super(card); + } + + @Override + public Hydrolash copy() { + return new Hydrolash(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.java b/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.java new file mode 100644 index 00000000000..8f4a7129709 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class IntoTheVoid extends mage.sets.avacynrestored.IntoTheVoid { + + public IntoTheVoid(UUID ownerId) { + super(ownerId); + this.cardNumber = 277; + this.expansionSetCode = "ORI"; + } + + public IntoTheVoid(final IntoTheVoid card) { + super(card); + } + + @Override + public IntoTheVoid copy() { + return new IntoTheVoid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java new file mode 100644 index 00000000000..8588e525641 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.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.magicorigins; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome { + + public JayemdaeTome(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + this.rarity = Rarity.UNCOMMON; + } + + public JayemdaeTome(final JayemdaeTome card) { + super(card); + } + + @Override + public JayemdaeTome copy() { + return new JayemdaeTome(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java new file mode 100644 index 00000000000..5c2ef28e0af --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class LeafGilder extends mage.sets.lorwyn.LeafGilder { + + public LeafGilder(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public LeafGilder(final LeafGilder card) { + super(card); + } + + @Override + public LeafGilder copy() { + return new LeafGilder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.java b/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.java new file mode 100644 index 00000000000..b43f3266594 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class MahamotiDjinn extends mage.sets.tenthedition.MahamotiDjinn { + + public MahamotiDjinn(UUID ownerId) { + super(ownerId); + this.cardNumber = 278; + this.expansionSetCode = "ORI"; + } + + public MahamotiDjinn(final MahamotiDjinn card) { + super(card); + } + + @Override + public MahamotiDjinn copy() { + return new MahamotiDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java new file mode 100644 index 00000000000..ffc48924a7a --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard { + + public MaritimeGuard(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public MaritimeGuard(final MaritimeGuard card) { + super(card); + } + + @Override + public MaritimeGuard copy() { + return new MaritimeGuard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java new file mode 100644 index 00000000000..f76704a0dba --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Meteorite extends mage.sets.magic2015.Meteorite { + + public Meteorite(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public Meteorite(final Meteorite card) { + super(card); + } + + @Override + public Meteorite copy() { + return new Meteorite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java new file mode 100644 index 00000000000..ca7871a5d01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class MightyLeap extends mage.sets.magic2011.MightyLeap { + + public MightyLeap(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public MightyLeap(final MightyLeap card) { + super(card); + } + + @Override + public MightyLeap copy() { + return new MightyLeap(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/MindRot.java b/Mage.Sets/src/mage/sets/magicorigins/MindRot.java new file mode 100644 index 00000000000..00bc85d1f7e --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/MindRot.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class MindRot extends mage.sets.tenthedition.MindRot { + + public MindRot(UUID ownerId) { + super(ownerId); + this.cardNumber = 281; + this.expansionSetCode = "ORI"; + } + + public MindRot(final MindRot card) { + super(card); + } + + @Override + public MindRot copy() { + return new MindRot(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Nightmare.java b/Mage.Sets/src/mage/sets/magicorigins/Nightmare.java new file mode 100644 index 00000000000..66b16d06b81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Nightmare.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Nightmare extends mage.sets.tenthedition.Nightmare { + + public Nightmare(UUID ownerId) { + super(ownerId); + this.cardNumber = 282; + this.expansionSetCode = "ORI"; + } + + public Nightmare(final Nightmare card) { + super(card); + } + + @Override + public Nightmare copy() { + return new Nightmare(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/Plummet.java b/Mage.Sets/src/mage/sets/magicorigins/Plummet.java new file mode 100644 index 00000000000..656174705bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/Plummet.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Plummet extends mage.sets.magic2011.Plummet { + + public Plummet(UUID ownerId) { + super(ownerId); + this.cardNumber = 286; + this.expansionSetCode = "ORI"; + } + + public Plummet(final Plummet card) { + super(card); + } + + @Override + public Plummet copy() { + return new Plummet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.java b/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.java new file mode 100644 index 00000000000..53404983129 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class PrizedUnicorn extends mage.sets.magic2010.PrizedUnicorn { + + public PrizedUnicorn(UUID ownerId) { + super(ownerId); + this.cardNumber = 287; + this.expansionSetCode = "ORI"; + } + + public PrizedUnicorn(final PrizedUnicorn card) { + super(card); + } + + @Override + public PrizedUnicorn copy() { + return new PrizedUnicorn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.java b/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.java new file mode 100644 index 00000000000..5f1b4be7822 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ProwessAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class RingwardenOwl extends CardImpl { + + public RingwardenOwl(UUID ownerId) { + super(ownerId, 68, "Ringwarden Owl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Bird"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Prowess + this.addAbility(new ProwessAbility()); + } + + public RingwardenOwl(final RingwardenOwl card) { + super(card); + } + + @Override + public RingwardenOwl copy() { + return new RingwardenOwl(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java new file mode 100644 index 00000000000..907344659f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor { + + public RunedServitor(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public RunedServitor(final RunedServitor card) { + super(card); + } + + @Override + public RunedServitor copy() { + return new RunedServitor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java new file mode 100644 index 00000000000..d4252ebcd87 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake { + + public ScrapskinDrake(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public ScrapskinDrake(final ScrapskinDrake card) { + super(card); + } + + @Override + public ScrapskinDrake copy() { + return new ScrapskinDrake(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.java b/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.java new file mode 100644 index 00000000000..22738918ecb --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.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.magicorigins; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class SengirVampire extends mage.sets.tenthedition.SengirVampire { + + public SengirVampire(UUID ownerId) { + super(ownerId); + this.cardNumber = 283; + this.expansionSetCode = "ORI"; + this.rarity = Rarity.UNCOMMON; + } + + public SengirVampire(final SengirVampire card) { + super(card); + } + + @Override + public SengirVampire copy() { + return new SengirVampire(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.java b/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.java new file mode 100644 index 00000000000..66a988ea548 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.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.magicorigins; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class SerraAngel extends mage.sets.tenthedition.SerraAngel { + + public SerraAngel(UUID ownerId) { + super(ownerId); + this.cardNumber = 276; + this.expansionSetCode = "ORI"; + this.rarity = Rarity.UNCOMMON; + } + + public SerraAngel(final SerraAngel card) { + super(card); + } + + @Override + public SerraAngel copy() { + return new SerraAngel(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.java b/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.java new file mode 100644 index 00000000000..8b8db501f71 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ShivanDragon extends mage.sets.tenthedition.ShivanDragon { + + public ShivanDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 285; + this.expansionSetCode = "ORI"; + } + + public ShivanDragon(final ShivanDragon card) { + super(card); + } + + @Override + public ShivanDragon copy() { + return new ShivanDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.java b/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.java new file mode 100644 index 00000000000..ccc15798ad3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TerraStomper extends mage.sets.zendikar.TerraStomper { + + public TerraStomper(UUID ownerId) { + super(ownerId); + this.cardNumber = 288; + this.expansionSetCode = "ORI"; + } + + public TerraStomper(final TerraStomper card) { + super(card); + } + + @Override + public TerraStomper copy() { + return new TerraStomper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java new file mode 100644 index 00000000000..0a3464df340 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth { + + public TitanicGrowth(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public TitanicGrowth(final TitanicGrowth card) { + super(card); + } + + @Override + public TitanicGrowth copy() { + return new TitanicGrowth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java new file mode 100644 index 00000000000..fbb3ca18954 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TitansStrength extends mage.sets.theros.TitansStrength { + + public TitansStrength(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public TitansStrength(final TitansStrength card) { + super(card); + } + + @Override + public TitansStrength copy() { + return new TitansStrength(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java new file mode 100644 index 00000000000..83f4e1c1304 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class TowerGeist extends mage.sets.darkascension.TowerGeist { + + public TowerGeist(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public TowerGeist(final TowerGeist card) { + super(card); + } + + @Override + public TowerGeist copy() { + return new TowerGeist(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java b/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java new file mode 100644 index 00000000000..82f5128b61c --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java @@ -0,0 +1,60 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.common.CreatureEntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class ValorInAkros extends CardImpl { + + public ValorInAkros(UUID ownerId) { + super(ownerId, 39, "Valor in Akros", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "ORI"; + + // Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn. + this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new BoostControlledEffect(1,1,Duration.EndOfTurn))); + } + + public ValorInAkros(final ValorInAkros card) { + super(card); + } + + @Override + public ValorInAkros copy() { + return new ValorInAkros(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java new file mode 100644 index 00000000000..d63e8419778 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger { + + public VastwoodGorger(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public VastwoodGorger(final VastwoodGorger card) { + super(card); + } + + @Override + public VastwoodGorger copy() { + return new VastwoodGorger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.java b/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.java new file mode 100644 index 00000000000..88eef44bb47 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WeaveFate extends mage.sets.khansoftarkir.WeaveFate { + + public WeaveFate(UUID ownerId) { + super(ownerId); + this.cardNumber = 279; + this.expansionSetCode = "ORI"; + } + + public WeaveFate(final WeaveFate card) { + super(card); + } + + @Override + public WeaveFate copy() { + return new WeaveFate(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java new file mode 100644 index 00000000000..a2152d252aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUnderworld { + + public WeightOfTheUnderworld(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public WeightOfTheUnderworld(final WeightOfTheUnderworld card) { + super(card); + } + + @Override + public WeightOfTheUnderworld copy() { + return new WeightOfTheUnderworld(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java new file mode 100644 index 00000000000..9aeebb11921 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class YevasForcemage extends mage.sets.magic2013.YevasForcemage { + + public YevasForcemage(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public YevasForcemage(final YevasForcemage card) { + super(card); + } + + @Override + public YevasForcemage copy() { + return new YevasForcemage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java new file mode 100644 index 00000000000..a8782b64095 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.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.magicorigins; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class YokedOx extends mage.sets.theros.YokedOx { + + public YokedOx(UUID ownerId) { + super(ownerId); + this.cardNumber = 999; + this.expansionSetCode = "ORI"; + } + + public YokedOx(final YokedOx card) { + super(card); + } + + @Override + public YokedOx copy() { + return new YokedOx(this); + } +} From 933160856f34e8f2dce0fef84db5cb4032b16f8f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 21:54:17 +0200 Subject: [PATCH 031/148] [ORI] Updated mtg-cards-data.txt (72 cards). --- Utils/mtg-cards-data.txt | 198 ++++++++++++++++++++++++++------------- 1 file changed, 134 insertions(+), 64 deletions(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index d5fe33b6dd9..3ae82c3d2eb 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -25522,71 +25522,71 @@ Garruk, Apex Predator|Media Inserts|104|Special|{5}{B}{G}|Planeswalker - Garruk| Shamanic Revelation|Media Inserts|105|Special|{2}{G}{G}|Sorcery|||Draw a card for each creature you control.$Ferocious - You gain 4 life for each creature you control with power 4 or greater.| Ojutai's Command|Media Inserts|106|Special|{2}{W}{U}|Instant|||Choose two - Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield; or You gain 4 life; or Counter target creature spell; or Draw a card.| Sultai|Media Inserts|999|Special|{{U}{B}{G}|Legendary Creature - Placeholder|2|2|| -Wood Elves|WPN Gateway|1|Special|{2}{G}|Creature — Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| -Icatian Javelineers|WPN Gateway|2|Special|{W}|Creature — Human Soldier|1|1|Icatian Javelineers enters the battlefield with a javelin counter on it.${T}, Remove a javelin counter from Icatian Javelineers: Icatian Javelineers deals 1 damage to target creature or player.| +Wood Elves|WPN Gateway|1|Special|{2}{G}|Creature — Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.| +Icatian Javelineers|WPN Gateway|2|Special|{W}|Creature — Human Soldier|1|1|Icatian Javelineers enters the battlefield with a javelin counter on it.${T}, Remove a javelin counter from Icatian Javelineers: Icatian Javelineers deals 1 damage to target creature or player.| Fiery Temper|WPN Gateway|3|Special|{1}{R}{R}|Instant|||Fiery Temper deals 3 damage to target creature or player.$Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)| Boomerang|WPN Gateway|4|Special|{U}{U}|Instant|||Return target permanent to its owner's hand.| -Calciderm|WPN Gateway|5|Special|{2}{W}{W}|Creature — Beast|5|5|Shroud (This creature can't be the target of spells or abilities.)$Vanishing 4 (This permanent enters the battlefield with four time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)| -Reckless Wurm|WPN Gateway|6|Special|{3}{R}{R}|Creature — Wurm|4|4|Trample$Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)| -Yixlid Jailer|WPN Gateway|7|Special|{1}{B}|Creature — Zombie Wizard|2|1|Cards in graveyards lose all abilities.| +Calciderm|WPN Gateway|5|Special|{2}{W}{W}|Creature — Beast|5|5|Shroud (This creature can't be the target of spells or abilities.)$Vanishing 4 (This permanent enters the battlefield with four time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)| +Reckless Wurm|WPN Gateway|6|Special|{3}{R}{R}|Creature — Wurm|4|4|Trample$Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)| +Yixlid Jailer|WPN Gateway|7|Special|{1}{B}|Creature — Zombie Wizard|2|1|Cards in graveyards lose all abilities.| Zoetic Cavern|WPN Gateway|8|Special||Land|||{T}: Add {1} to your mana pool.$Morph {2} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)| -Llanowar Elves|WPN Gateway|9|Special|{G}|Creature — Elf Druid|1|1|{T}: Add {G} to your mana pool.| -Mogg Fanatic|WPN Gateway|10|Special|{R}|Creature — Goblin|1|1|Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.| +Llanowar Elves|WPN Gateway|9|Special|{G}|Creature — Elf Druid|1|1|{T}: Add {G} to your mana pool.| +Mogg Fanatic|WPN Gateway|10|Special|{R}|Creature — Goblin|1|1|Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.| Mind Stone|WPN Gateway|11|Special|{2}|Artifact|||{T}: Add {1} to your mana pool.${1}, {T}, Sacrifice Mind Stone: Draw a card.| -Dauntless Dourbark|WPN Gateway|12|Special|{3}{G}|Creature — Treefolk Warrior|*|*|Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control.$Dauntless Dourbark has trample as long as you control another Treefolk.| +Dauntless Dourbark|WPN Gateway|12|Special|{3}{G}|Creature — Treefolk Warrior|*|*|Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control.$Dauntless Dourbark has trample as long as you control another Treefolk.| Lava Axe|WPN Gateway|13|Special|{4}{R}|Sorcery|||Lava Axe deals 5 damage to target player.| -Cenn's Tactician|WPN Gateway|14|Special|{W}|Creature — Kithkin Soldier|1|1|{W}, {T}: Put a +1/+1 counter on target Soldier creature.$Each creature you control with a +1/+1 counter on it can block an additional creature.| -Oona's Blackguard|WPN Gateway|15|Special|{1}{B}|Creature — Faerie Rogue|1|1|Flying$Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it.$Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.| -Gravedigger|WPN Gateway|16|Special|{3}{B}|Creature — Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.| -Boggart Ram-Gang|WPN Gateway|17|Special|{RG}{RG}{RG}|Creature — Goblin Warrior|3|3|Haste$Wither (This deals damage to creatures in the form of -1/-1 counters.)| -Wilt-Leaf Cavaliers|WPN Gateway|18|Special|{GW}{GW}{GW}|Creature — Elf Knight|3|4|Vigilance| -Duergar Hedge-Mage|WPN Gateway|19|Special|{2}{RW}|Creature — Dwarf Shaman|2|2|When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.$When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.| -Selkie Hedge-Mage|WPN Gateway|20|Special|{2}{GU}|Creature — Merfolk Wizard|2|2|When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life.$When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.| -Sprouting Thrinax|WPN Gateway|21|Special|{B}{R}{G}|Creature — Lizard|3|3|When Sprouting Thrinax dies, put three 1/1 green Saproling creature tokens onto the battlefield.| -Woolly Thoctar|WPN Gateway|22|Special|{W}{R}{G}|Creature — Beast|5|4|| +Cenn's Tactician|WPN Gateway|14|Special|{W}|Creature — Kithkin Soldier|1|1|{W}, {T}: Put a +1/+1 counter on target Soldier creature.$Each creature you control with a +1/+1 counter on it can block an additional creature.| +Oona's Blackguard|WPN Gateway|15|Special|{1}{B}|Creature — Faerie Rogue|1|1|Flying$Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it.$Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.| +Gravedigger|WPN Gateway|16|Special|{3}{B}|Creature — Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.| +Boggart Ram-Gang|WPN Gateway|17|Special|{RG}{RG}{RG}|Creature — Goblin Warrior|3|3|Haste$Wither (This deals damage to creatures in the form of -1/-1 counters.)| +Wilt-Leaf Cavaliers|WPN Gateway|18|Special|{GW}{GW}{GW}|Creature — Elf Knight|3|4|Vigilance| +Duergar Hedge-Mage|WPN Gateway|19|Special|{2}{RW}|Creature — Dwarf Shaman|2|2|When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.$When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.| +Selkie Hedge-Mage|WPN Gateway|20|Special|{2}{GU}|Creature — Merfolk Wizard|2|2|When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life.$When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.| +Sprouting Thrinax|WPN Gateway|21|Special|{B}{R}{G}|Creature — Lizard|3|3|When Sprouting Thrinax dies, put three 1/1 green Saproling creature tokens onto the battlefield.| +Woolly Thoctar|WPN Gateway|22|Special|{W}{R}{G}|Creature — Beast|5|4|| Path to Exile|WPN Gateway|24|Special|{W}|Instant|||Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library.| -Hellspark Elemental|WPN Gateway|25|Special|{1}{R}|Creature — Elemental|3|1|Trample, haste$At the beginning of the end step, sacrifice Hellspark Elemental.$Unearth {1}{R} ({1}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)| -Marisi's Twinclaws|WPN Gateway|26|Special|{2}{RW}{G}|Creature — Cat Warrior|2|4|Double strike| +Hellspark Elemental|WPN Gateway|25|Special|{1}{R}|Creature — Elemental|3|1|Trample, haste$At the beginning of the end step, sacrifice Hellspark Elemental.$Unearth {1}{R} ({1}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)| +Marisi's Twinclaws|WPN Gateway|26|Special|{2}{RW}{G}|Creature — Cat Warrior|2|4|Double strike| Slave of Bolas|WPN Gateway|27|Special|{3}{UR}{B}|Sorcery|||Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step.| -Mycoid Shepherd|WPN Gateway|28|Special|{1}{W}{G}{G}|Creature — Fungus|5|4|Whenever Mycoid Shepherd or another creature you control with power 5 or greater dies, you may gain 5 life.| -Naya Sojourners|WPN Gateway|29|Special|{2}{W}{R}{G}|Creature — Elf Shaman|5|3|When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.$Cycling {2}{G} ({2}{G}, Discard this card: Draw a card.)| -Mind Control|WPN Gateway|30|Special|{3}{U}{U}|Enchantment — Aura|||Enchant creature$You control enchanted creature.| +Mycoid Shepherd|WPN Gateway|28|Special|{1}{W}{G}{G}|Creature — Fungus|5|4|Whenever Mycoid Shepherd or another creature you control with power 5 or greater dies, you may gain 5 life.| +Naya Sojourners|WPN Gateway|29|Special|{2}{W}{R}{G}|Creature — Elf Shaman|5|3|When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.$Cycling {2}{G} ({2}{G}, Discard this card: Draw a card.)| +Mind Control|WPN Gateway|30|Special|{3}{U}{U}|Enchantment — Aura|||Enchant creature$You control enchanted creature.| Rise from the Grave|WPN Gateway|31|Special|{4}{B}|Sorcery|||Put target creature card from a graveyard onto the battlefield under your control. That creature is a black Zombie in addition to its other colors and types.| -Kor Duelist|WPN Gateway|32|Special|{W}|Creature — Kor Soldier|1|1|As long as Kor Duelist is equipped, it has double strike. (It deals both first-strike and regular combat damage.)| -Vampire Nighthawk|WPN Gateway|33|Special|{1}{B}{B}|Creature — Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| -Nissa's Chosen|WPN Gateway|34|Special|{G}{G}|Creature — Elf Warrior|2|3|If Nissa's Chosen would die, put it on the bottom of its owner's library instead.| -Emeria Angel|WPN Gateway|35|Special|{2}{W}{W}|Creature — Angel|3|3|Flying$Landfall — Whenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.| -Kor Firewalker|WPN Gateway|36|Special|{W}{W}|Creature — Kor Soldier|2|2|Protection from red$Whenever a player casts a red spell, you may gain 1 life.| -Leatherback Baloth|WPN Gateway|37|Special|{G}{G}{G}|Creature — Beast|4|5|| -Hada Freeblade|WPN Gateway|38|Special|{W}|Creature — Human Soldier Ally|0|1|Whenever Hada Freeblade or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Hada Freeblade.| -Kalastria Highborn|WPN Gateway|39|Special|{B}{B}|Creature — Vampire Shaman|2|2|Whenever Kalastria Highborn or another Vampire you control dies, you may pay {B}. If you do, target player loses 2 life and you gain 2 life.| +Kor Duelist|WPN Gateway|32|Special|{W}|Creature — Kor Soldier|1|1|As long as Kor Duelist is equipped, it has double strike. (It deals both first-strike and regular combat damage.)| +Vampire Nighthawk|WPN Gateway|33|Special|{1}{B}{B}|Creature — Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| +Nissa's Chosen|WPN Gateway|34|Special|{G}{G}|Creature — Elf Warrior|2|3|If Nissa's Chosen would die, put it on the bottom of its owner's library instead.| +Emeria Angel|WPN Gateway|35|Special|{2}{W}{W}|Creature — Angel|3|3|Flying$Landfall — Whenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.| +Kor Firewalker|WPN Gateway|36|Special|{W}{W}|Creature — Kor Soldier|2|2|Protection from red$Whenever a player casts a red spell, you may gain 1 life.| +Leatherback Baloth|WPN Gateway|37|Special|{G}{G}{G}|Creature — Beast|4|5|| +Hada Freeblade|WPN Gateway|38|Special|{W}|Creature — Human Soldier Ally|0|1|Whenever Hada Freeblade or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Hada Freeblade.| +Kalastria Highborn|WPN Gateway|39|Special|{B}{B}|Creature — Vampire Shaman|2|2|Whenever Kalastria Highborn or another Vampire you control dies, you may pay {B}. If you do, target player loses 2 life and you gain 2 life.| Syphon Mind|WPN Gateway|40|Special|{3}{B}|Sorcery|||Each other player discards a card. You draw a card for each card discarded this way.| -Pathrazer of Ulamog|WPN Gateway|46|Special|{11}|Creature — Eldrazi|9|9|Annihilator 3 (Whenever this creature attacks, defending player sacrifices three permanents.)$Pathrazer of Ulamog can't be blocked except by three or more creatures.| +Pathrazer of Ulamog|WPN Gateway|46|Special|{11}|Creature — Eldrazi|9|9|Annihilator 3 (Whenever this creature attacks, defending player sacrifices three permanents.)$Pathrazer of Ulamog can't be blocked except by three or more creatures.| Curse of Wizardry|WPN Gateway|47|Special|{2}{B}{B}|Enchantment|||As Curse of Wizardry enters the battlefield, choose a color.$Whenever a player casts a spell of the chosen color, that player loses 1 life.| Staggershock|WPN Gateway|48|Special|{2}{R}|Instant|||Staggershock deals 2 damage to target creature or player.$Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)| -Deathless Angel|WPN Gateway|49|Special|{4}{W}{W}|Creature — Angel|5|7|Flying${W}{W}: Target creature gains indestructible until end of turn.| +Deathless Angel|WPN Gateway|49|Special|{4}{W}{W}|Creature — Angel|5|7|Flying${W}{W}: Target creature gains indestructible until end of turn.| Fling|WPN Gateway|50|Special|{1}{R}|Instant|||As an additional cost to cast Fling, sacrifice a creature.$Fling deals damage equal to the sacrificed creature's power to target creature or player.| -Sylvan Ranger|WPN Gateway|51|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| -Plague Stinger|WPN Gateway|59|Special|{1}{B}|Creature — Insect Horror|1|1|Flying$Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)| +Sylvan Ranger|WPN Gateway|51|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| +Plague Stinger|WPN Gateway|59|Special|{1}{B}|Creature — Insect Horror|1|1|Flying$Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)| Golem's Heart|WPN Gateway|60|Special|{2}|Artifact|||Whenever a player casts an artifact spell, you may gain 1 life.| -Skinrender|WPN Gateway|63|Special|{2}{B}{B}|Creature — Zombie|3|3|When Skinrender enters the battlefield, put three -1/-1 counters on target creature.| +Skinrender|WPN Gateway|63|Special|{2}{B}{B}|Creature — Zombie|3|3|When Skinrender enters the battlefield, put three -1/-1 counters on target creature.| Master's Call|WPN Gateway|64|Special|{2}{W}|Instant|||Put two 1/1 colorless Myr artifact creature tokens onto the battlefield.| -Plague Myr|WPN Gateway|65|Special|{2}|Artifact Creature — Myr|1|1|Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)${T}: Add {1} to your mana pool.| -Signal Pest|WPN Gateway|66|Special|{1}|Artifact Creature — Pest|0|1|Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)$Signal Pest can't be blocked except by creatures with flying or reach.| +Plague Myr|WPN Gateway|65|Special|{2}|Artifact Creature — Myr|1|1|Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)${T}: Add {1} to your mana pool.| +Signal Pest|WPN Gateway|66|Special|{1}|Artifact Creature — Pest|0|1|Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)$Signal Pest can't be blocked except by creatures with flying or reach.| Fling|WPN Gateway|69|Special|{1}{R}|Instant|||As an additional cost to cast Fling, sacrifice a creature.$Fling deals damage equal to the sacrificed creature's power to target creature or player.| -Sylvan Ranger|WPN Gateway|70|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| -Vault Skirge|WPN Gateway|71|Special|{1}{BP}|Artifact Creature — Imp|1|1|({BP} can be paid with either {B} or 2 life.)$Flying$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| -Maul Splicer|WPN Gateway|72|Special|{6}{G}|Creature — Human Artificer|1|1|When Maul Splicer enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield.$Golem creatures you control have trample.| +Sylvan Ranger|WPN Gateway|70|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.| +Vault Skirge|WPN Gateway|71|Special|{1}{BP}|Artifact Creature — Imp|1|1|({BP} can be paid with either {B} or 2 life.)$Flying$Lifelink (Damage dealt by this creature also causes you to gain that much life.)| +Maul Splicer|WPN Gateway|72|Special|{6}{G}|Creature — Human Artificer|1|1|When Maul Splicer enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield.$Golem creatures you control have trample.| Shrine of Burning Rage|WPN Gateway|73|Special|{2}|Artifact|||At the beginning of your upkeep or whenever you cast a red spell, put a charge counter on Shrine of Burning Rage.${3}, {T}, Sacrifice Shrine of Burning Rage: Shrine of Burning Rage deals damage equal to the number of charge counters on it to target creature or player.| -Tormented Soul|WPN Gateway|76|Special|{B}|Creature — Spirit|1|1|Tormented Soul can't block and can't be blocked.| -Auramancer|WPN Gateway|77|Special|{2}{W}|Creature — Human Wizard|2|2|When Auramancer enters the battlefield, you may return target enchantment card from your graveyard to your hand.| +Tormented Soul|WPN Gateway|76|Special|{B}|Creature — Spirit|1|1|Tormented Soul can't block and can't be blocked.| +Auramancer|WPN Gateway|77|Special|{2}{W}|Creature — Human Wizard|2|2|When Auramancer enters the battlefield, you may return target enchantment card from your graveyard to your hand.| Circle of Flame|WPN Gateway|78|Special|{1}{R}|Enchantment|||Whenever a creature without flying attacks you or a planeswalker you control, Circle of Flame deals 1 damage to that creature.| -Gather the Townsfolk|WPN Gateway|79|Special|{1}{W}|Sorcery|||Put two 1/1 white Human creature tokens onto the battlefield.$Fateful hour — If you have 5 or less life, put five of those tokens onto the battlefield instead.| -Curse of the Bloody Tome|WPN Gateway|80|Special|{2}{U}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard.| -Curse of Thirst|WPN Gateway|81|Special|{4}{B}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her.| -Nearheath Stalker|WPN Gateway|82|Special|{4}{R}|Creature — Vampire Rogue|4|1|Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)| -Bloodcrazed Neonate|WPN Gateway|83|Special|{1}{R}|Creature — Vampire|2|1|Bloodcrazed Neonate attacks each turn if able.$Whenever Bloodcrazed Neonate deals combat damage to a player, put a +1/+1 counter on it.| -Boneyard Wurm|WPN Gateway|84|Special|{1}{G}|Creature — Wurm|*|*|Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.| +Gather the Townsfolk|WPN Gateway|79|Special|{1}{W}|Sorcery|||Put two 1/1 white Human creature tokens onto the battlefield.$Fateful hour — If you have 5 or less life, put five of those tokens onto the battlefield instead.| +Curse of the Bloody Tome|WPN Gateway|80|Special|{2}{U}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard.| +Curse of Thirst|WPN Gateway|81|Special|{4}{B}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her.| +Nearheath Stalker|WPN Gateway|82|Special|{4}{R}|Creature — Vampire Rogue|4|1|Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)| +Bloodcrazed Neonate|WPN Gateway|83|Special|{1}{R}|Creature — Vampire|2|1|Bloodcrazed Neonate attacks each turn if able.$Whenever Bloodcrazed Neonate deals combat damage to a player, put a +1/+1 counter on it.| +Boneyard Wurm|WPN Gateway|84|Special|{1}{G}|Creature — Wurm|*|*|Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.| Dirtcowl Wurm|Prerelease Events|1|Special|{4}{G}|Creature - Wurm|3|4|Whenever an opponent plays a land, put a +1/+1 counter on Dirtcowl Wurm.| Revenant|Prerelease Events|2|Special|{4}{B}|Creature - Spirit|*|*|Flying$Revenant's power and toughness are each equal to the number of creature cards in your graveyard.| Monstrous Hount|Prerelease Events|3|Special|{3}{R}|Creature - Hound|4|4|Monstrous Hound can't attack unless you control more lands than defending player.$Monstrous Hound can't block unless you control more lands than attacking player.| @@ -25601,7 +25601,7 @@ Avatar of Hope|Prerelease Events|11|Special|{6}{W}{W}|Creature - Avatar|4|9|If y Raging Kavu|Prerelease Events|12|Special|{4}{1}{R}{G}|Creature - Kavu|3|1|Flash$Haste| Questing Phelddagrif|Prerelease Events|13|Special|{1}{W}{U}{G}|Creature - Phelddagrif|4|4|{G}: Questing Phelddagrif gets +1/+1 until end of turn. Target opponent puts a 1/1 green Hippo creature token onto the battlefield.${W}: Questing Phelddagrif gains protection from black and from red until end of turn. Target opponent gains 2 life.${U}: Questing Phelddagrif gains flying until end of turn. Target opponent may draw a card.| Fungal Shambler|Prerelease Events|14|Special|{4}{U}{B}{G}|Creature - Fungus Beast|6|4|Trample$Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card.| -Stone-Tongue Baselisk|Prerelease Events|15|Special|{4}{G}{G}{G}|Creature - Basilisk|4|5|Whenever Stone-Tongue Basilisk deals combat damage to a creature, destroy that creature at end of combat.$Threshold — As long as seven or more cards are in your graveyard, all creatures able to block Stone-Tongue Basilisk do so.| +Stone-Tongue Baselisk|Prerelease Events|15|Special|{4}{G}{G}{G}|Creature - Basilisk|4|5|Whenever Stone-Tongue Basilisk deals combat damage to a creature, destroy that creature at end of combat.$Threshold — As long as seven or more cards are in your graveyard, all creatures able to block Stone-Tongue Basilisk do so.| Laquatus's Champion|Prerelease Events|16|Special|{4}{B}{B}|Creature - Nightmare Horror|6|3|When Laquatus's Champion enters the battlefield, target player loses 6 life.$When Laquatus's Champion leaves the battlefield, that player gains 6 life.${B}: Regenerate Laquatus's Champion.| Glory|Prerelease Events|17|Special|{{3}{W}{W}|Creature - Incarnation|3|3|Flying${2}{W}: Choose a color. Creatures you control gain protection from the chosen color until end of turn. Activate this ability only if Glory is in your graveyard.| Silent Specter|Prerelease Events|18|Special|{4}{B}{B}|Creature - Specter|4|4|Flying$Whenever Silent Specter deals combat damage to a player, that player discards two cards.$Morph {3}{B}{B} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)| @@ -25617,9 +25617,9 @@ Gleancrawler|Prerelease Events|27|Special|{3}{BG}{BG}{BG}|Creature - Insect Horr Djinn Illuminatus|Prerelease Events|28|Special|{5}{UR}{UR}|Creature - Djinn|3|5|({U/R} can be paid with either {U} or {R}.)$Flying$Each instant and sorcery spell you cast has replicate. The replicate cost is equal to its mana cost. (When you cast it, copy it for each time you paid its replicate cost. You may choose new targets for the copies.)| Avatar of Discord|Prerelease Events|29|Special|{BR}{BR}{BR}|Creature - Avatar|5|3|({B/R} can be paid with either {B} or {R}.)$Flying$When Avatar of Discord enters the battlefield, sacrifice it unless you discard two cards.| Allosaurus Rider|Prerelease Events|30|Special|{5}{G}{G}|Creature - Elf Warrior|1+*|1+*|You may exile two green cards from your hand rather than pay Allosaurus Rider's mana cost.$Allosaurus Rider's power and toughness are each equal to 1 plus the number of lands you control.| -Lotus Bloom|Prerelease Events|31|Special||Artifact|||Suspend 3�{0} (Rather than cast this card from your hand, pay {0} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.)${T}, Sacrifice Lotus Bloom: Add three mana of any one color to your mana pool. +Lotus Bloom|Prerelease Events|31|Special||Artifact|||Suspend 3�{0} (Rather than cast this card from your hand, pay {0} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.)${T}, Sacrifice Lotus Bloom: Add three mana of any one color to your mana pool. Oros, the Avenger|Prerelease Events|32|Special|{3}{W}{B}{R}|Legendary Creature - Dragon|6|6|Flying$Whenever Oros, the Avenger deals combat damage to a player, you may pay {2}{W}. If you do, Oros deals 3 damage to each nonwhite creature.| -Korlash, Heir to Blackblade|Prerelease Events|33|Special|{2}{B}{B}|Legendary Creature - Zombie Warrior|*|*|Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control.${1}{B}: Regenerate Korlash.$Grandeur — Discard another card named Korlash, Heir to Blackblade: Search your library for up to two Swamp cards, put them onto the battlefield tapped, then shuffle your library.| +Korlash, Heir to Blackblade|Prerelease Events|33|Special|{2}{B}{B}|Legendary Creature - Zombie Warrior|*|*|Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control.${1}{B}: Regenerate Korlash.$Grandeur — Discard another card named Korlash, Heir to Blackblade: Search your library for up to two Swamp cards, put them onto the battlefield tapped, then shuffle your library.| Wren's Run Packmaster|Prerelease Events|34|Special|{3}{G}|Creature - Elf Warrior|5|5|Champion an Elf (When this creature enters the battlefield, sacrifice it unless you exile another Elf you control. When this creature leaves the battlefield, that card returns to the battlefield.)${2}{G}: Put a 2/2 green Wolf creature token onto the battlefield.$Wolves you control have deathtouch.| Door of Destinies|Prerelease Events|35|Special|{4}|Artifact|||As Door of Destinies enters the battlefield, choose a creature type.$Whenever you cast a spell of the chosen type, put a charge counter on Door of Destinies.$Creatures you control of the chosen type get +1/+1 for each charge counter on Door of Destinies.| Demigod of Revenge|Prerelease Events|36|Special|{BR}{BR}{BR}{BR}{BR}|Creature - Spirit Avatar|5|4|Flying$Haste$When you cast Demigod of Revenge, return all cards named Demigod of Revenge from your graveyard to the battlefield.| @@ -25628,7 +25628,7 @@ Ajani Vengeant|Prerelease Events|38|Special|{2}{W}{R}|Planeswalker - Ajani|||+1: Malfegor|Prerelease Events|39|Special|{2}{B}{B}{R}{R}|Legendary Creature - Demon Dragon|6|6|Flying$When Malfegor enters the battlefield, discard your hand. Each opponent sacrifices a creature for each card discarded this way.| Dragon Broodmother|Prerelease Events|40|Special|{2}{R}{R}{R}{G}|Creature - Dragon|4|4|Flying$At the beginning of each upkeep, put a 1/1 red and green Dragon creature token with flying and devour 2 onto the battlefield. (As the token enters the battlefield, you may sacrifice any number of creatures. It enters the battlefield with twice that many +1/+1 counters on it.)| Vampire Nocturnus|Prerelease Events|41|Special|{1}{B}{B}{B}|Creature - Vampire|3|3|Play with the top card of your library revealed.$As long as the top card of your library is black, Vampire Nocturnus and other Vampire creatures you control get +2/+1 and have flying.| -Rampaging Baloths|Prerelease Events|42|Special|{4}{G}{G}|Creature - Beast|6|6|Trample$Landfall — Whenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.| +Rampaging Baloths|Prerelease Events|42|Special|{4}{G}{G}|Creature - Beast|6|6|Trample$Landfall — Whenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.| Comet Storm|Prerelease Events|43|Special|{X}{R}{R}|Instant|||Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.)$Choose target creature or player, then choose another target creature or player for each time Comet Storm was kicked. Comet Storm deals X damage to each of them.| Emrakul, the Aeons Torn|Prerelease Events|44|Special|{15}|Legendary Creature - Eldrazi|15|15|Emrakul, the Aeons Torn can't be countered.$When you cast Emrakul, take an extra turn after this one.$Flying, protection from colored spells, annihilator 6$When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library.| Sun Titan|Prerelease Events|45|Special|{4}{W}{W}|Creature - Giant|6|6|Vigilance$Whenever Sun Titan enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield.| @@ -25651,7 +25651,7 @@ Grove of the Guardian|Prerelease Events|59|Special||Land|||{T}: Add {1} to your Consuming Aberration|Prerelease Events|60|Special|{3}{U}{B}|Creature - Horror|*|*|Consuming Aberration's power and toughness are each equal to the number of cards in your opponents' graveyards.$Whenever you cast a spell, each opponent reveals cards from the top of his or her library until he or she reveals a land card, then puts those cards into his or her graveyard.| Fathom Mage|Prerelease Events|61|Special|{2}{U}{G}|Creature - Human Wizard|1|1|Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature.)$Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card.| Foundry Champion|Prerelease Events|62|Special|{4}{W}{R}|Creature - Elemental Soldier|4|4When Foundry Champion enters the battlefield, it deals damage to target creature or player equal to the number of creatures you control.${R}: Foundry Champion gets +1/+0 until end of turn.${W}: Foundry Champion gets +0/+1 until end of turn.| -Rubblehulk|Prerelease Events|63|Special|{4}{R}{G}|Creature - Elemental|*|*|Rubblehulk's power and toughness are each equal to the number of lands you control.$Bloodrush — {1}{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.| +Rubblehulk|Prerelease Events|63|Special|{4}{R}{G}|Creature - Elemental|*|*|Rubblehulk's power and toughness are each equal to the number of lands you control.$Bloodrush — {1}{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.| Treasury Thrull|Prerelease Events|64|Special|{4}{W}{B}|Creature - Thrull|4|4|Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)$Whenever Treasury Thrull attacks, you may return target artifact, creature, or enchantment card from your graveyard to your hand.| Maze's End|Prerelease Events|65|Special||Land|||Maze's End enters the battlefield tapped.${T}: Add {1} to your mana pool.${3}, {T}, Return Maze's End to its owner's hand: Search your library for a Gate card, put it onto the battlefield, then shuffle your library. If you control ten or more Gates with different names, you win the game.| Plains|Prerelease Events|66|Special||Basic Land - Plains|||({T}: Add {W} to your mana pool.)| @@ -25660,15 +25660,15 @@ Celestial Archon|Prerelease Events|68|Special|{3}{W}{W}|Enchantment Creature - A Shipbreaker Kraken|Prerelease Events|69|Special|{4}{U}{U}|Creature - Kraken|6|6|{6}{U}{U}: Monstrosity 4. (If this creature isn't monstrous, put four +1/+1 counters on it and it becomes monstrous.)$When Shipbreaker Kraken becomes monstrous, tap up to four target creatures. Those creatures don't untap during their controllers' untap steps for as long as you control Shipbreaker Kraken.| Abhorrent Overlord|Prerelease Events|70|Special|{5}{B}{B}|Creature - Demon|6|6|Flying$When Abhorrent Overlord enters the battlefield, put a number of 1/1 black Harpy creature tokens with flying onto the battlefield equal to your devotion to black. (Each {B} in the mana costs of permanents you control counts toward your devotion to black.)$At the beginning of your upkeep, sacrifice a creature.| Ember Swallower|Prerelease Events|71|Special|{2}{R}{R}|Creature - Elemental|4|5|{5}{R}{R}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.)$When Ember Swallower becomes monstrous, each player sacrifices three lands.| -Anthousa, Setessan Hero|Prerelease Events|72|Special|{3}{G}{G}|Legendary Creature - Human Warrior|4|5|Heroic — Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands.| +Anthousa, Setessan Hero|Prerelease Events|72|Special|{3}{G}{G}|Legendary Creature - Human Warrior|4|5|Heroic — Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands.| Silent Sentinel|Prerelease Events|73|Special|{5}{W}{W}|Creature - Archon|4|6|Flying$Whenever Silent Sentinel attacks, you may return target enchantment card from your graveyard to the battlefield.| -Arbiter of the Ideal|Prerelease Events|74|Special|{4}{U}{U}|Creature - Sphinx|4|5|Flying$Inspired — Whenever Arbiter of the Ideal becomes untapped, reveal the top card of your library. If it's an artifact, creature, or land card, you may put it onto the battlefield with a manifestation counter on it. That permanent is an enchantment in addition to its other types.| +Arbiter of the Ideal|Prerelease Events|74|Special|{4}{U}{U}|Creature - Sphinx|4|5|Flying$Inspired — Whenever Arbiter of the Ideal becomes untapped, reveal the top card of your library. If it's an artifact, creature, or land card, you may put it onto the battlefield with a manifestation counter on it. That permanent is an enchantment in addition to its other types.| Eater of Hope|Prerelease Events|75|Special|{5}{B}{B}|Creature - Demon|6|4|Flying${B}, Sacrifice another creature: Regenerate Eater of Hope.${2}{B}, Sacrifice two other creatures: Destroy target creature.| Forgestoker Dragon|Prerelease Events|76|Special|{4}{R}{R}|Creature - Dragon|5|4|Flying${1}{R}: Forgestoker Dragon deals 1 damage to target creature. That creature can't block this combat. Activate this ability only if Forgestoker Dragon is attacking.| Nessian Wilds Ravager|Prerelease Events|77|Special|{4}{G}{G}|Creature - Hydra|6|6|Tribute 6 (As this creature enters the battlefield, an opponent of your choice may place six +1/+1 counters on it.)$When Nessian Wilds Ravager enters the battlefield, if tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature. (Each deals damage equal to its power to the other.)| -Dawnbringer Charioteers|Prerelease Events|78|Special|{2}{W}{W}|Creature - Human Soldier|2|4|Flying, lifelink$Heroic — Whenever you cast a spell that targets Dawnbringer Charioteers, put a +1/+1 counter on Dawnbringer Charioteers.| +Dawnbringer Charioteers|Prerelease Events|78|Special|{2}{W}{W}|Creature - Human Soldier|2|4|Flying, lifelink$Heroic — Whenever you cast a spell that targets Dawnbringer Charioteers, put a +1/+1 counter on Dawnbringer Charioteers.| Scourge of Fleets|Prerelease Events|79|Special|{5}{U}{U}|Creature - Kraken|6|6|When Scourge of Fleets enters the battlefield, return each creature your opponents control with toughness X or less to its owner's hand, where X is the number of Islands you control.| -Doomwake Giant|Prerelease Events|80|Special|{4}{B}|Enchantment Creature - Giant|4|6|Constellation — Whenever Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.| +Doomwake Giant|Prerelease Events|80|Special|{4}{B}|Enchantment Creature - Giant|4|6|Constellation — Whenever Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.| Spawn of Thraxes|Prerelease Events|81|Special|{5}{R}{R}|Creature - Dragon|5|5|Flying$When Spawn of Thraxes enters the battlefield, it deals damage to target creature or player equal to the number of Mountains you control.| Heroes' Bane|Prerelease Events|82|Special|{3}{G}{G}|Creature - Hydra|0|0|Heroes' Bane enters the battlefield with four +1/+1 counters on it.${2}{G}{G}: Put X +1/+1 counters on Heroes' Bane, where X is its power.| Resolute Archangel|Prerelease Events|83|Special|{5}{W}{W}|Creature - Angel|4|4|Flying$When Resolute Archangel enters the battlefield, if your life total is less than your starting life total, it becomes equal to your starting life total.| @@ -26018,7 +26018,7 @@ Thrive|Modern Masters 2015 Edition|166|C|{X}{G}|Sorcery|||Put a +1/+1 counter on Tukatongue Thallid|Modern Masters 2015 Edition|167|C|{G}|Creature - Fungus|1|1|When Tukatongue Thallid dies, put a 1/1 green Saproling creature token onto the battlefield.| Vines of Vastwood|Modern Masters 2015 Edition|168|C|{G}|Instant|||Kicker {G} (You may pay an additional {G} as you cast this spell.)$Target creature can't be the target of spells or abilities your opponents control this turn. If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn.| Wolfbriar Elemental|Modern Masters 2015 Edition|169|R|{2}{G}{G}|Creature - Elemental|4|4|Multikicker {G} (You may pay an additional {G} any number of times as you cast this spell.)$When Wolfbriar Elemental enters the battlefield, put a 2/2 green Wolf creature token onto the battlefield for each time it was kicked.| -Fortify|Modern Masters 2015 Edition|17|C|{2}{W}|Instant|||Choose one -$• Creatures you control get +2/+0 until end of turn.$• Creatures you control get +0/+2 until end of turn.| +Fortify|Modern Masters 2015 Edition|17|C|{2}{W}|Instant|||Choose one -$• Creatures you control get +2/+0 until end of turn.$• Creatures you control get +0/+2 until end of turn.| Agony Warp|Modern Masters 2015 Edition|170|U|{U}{B}|Instant|||Target creature gets -3/-0 until end of turn.$Target creature gets -0/-3 until end of turn.| Apocalypse Hydra|Modern Masters 2015 Edition|171|R|{X}{R}{G}|Creature - Hydra|0|0|Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.${1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.| Boros Swiftblade|Modern Masters 2015 Edition|172|U|{R}{W}|Creature - Human Soldier|1|2|Double strike| @@ -26127,7 +26127,7 @@ Karn Liberated|Modern Masters 2015 Edition|4|M|{7}|Planeswalker - Karn|||+4: Tar Air Servant|Modern Masters 2015 Edition|40|U|{4}{U}|Creature - Elemental|4|3|Flying${2}{U}: Tap target creature with flying.| Argent Sphinx|Modern Masters 2015 Edition|41|R|{2}{U}{U}|Creature - Sphinx|4|3|Flying$Metalcraft - {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts.| Cloud Elemental|Modern Masters 2015 Edition|42|C|{2}{U}|Creature - Elemental|2|3|Flying$Cloud Elemental can block only creatures with flying.| -Cryptic Command|Modern Masters 2015 Edition|43|R|{1}{U}{U}{U}|Instant|||Choose two -$• Counter target spell.$• Return target permanent to its owner's hand.$• Tap all creatures your opponents control.$• Draw a card.| +Cryptic Command|Modern Masters 2015 Edition|43|R|{1}{U}{U}{U}|Instant|||Choose two -$• Counter target spell.$• Return target permanent to its owner's hand.$• Tap all creatures your opponents control.$• Draw a card.| Faerie Mechanist|Modern Masters 2015 Edition|44|C|{3}{U}|Artifact Creature - Faerie Artificer|2|2|Flying$When Faerie Mechanist enters the battlefield, look at the top three cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order.| Flashfreeze|Modern Masters 2015 Edition|45|U|{1}{U}|Instant|||Counter target red or green spell.| Guile|Modern Masters 2015 Edition|46|R|{3}{U}{U}{U}|Creature - Elemental Incarnation|6|6|Guile can't be blocked except by three or more creatures.$If a spell or ability you control would counter a spell, instead exile that spell and you may play that card without paying its mana cost.$When Guile is put into a graveyard from anywhere, shuffle it into its owner's library.| @@ -26179,7 +26179,7 @@ Nameless Inversion|Modern Masters 2015 Edition|87|C|{1}{B}|Tribal Instant - Shap Necroskitter|Modern Masters 2015 Edition|88|R|{1}{B}{B}|Creature - Elemental|1|4|Wither (This deals damage to creatures in the form of -1/-1 counters.)$Whenever a creature an opponent controls with a -1/-1 counter on it dies, you may return that card to the battlefield under your control.| Plagued Rusalka|Modern Masters 2015 Edition|89|C|{B}|Creature - Spirit|1|1|{B}, Sacrifice a creature: Target creature gets -1/-1 until end of turn.| Arrest|Modern Masters 2015 Edition|9|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block, and its activated abilities can't be activated.| -Profane Command|Modern Masters 2015 Edition|90|R|{X}{B}{B}|Sorcery|||Choose two -$• Target player loses X life.$• Return target creature card with converted mana cost X or less from your graveyard to the battlefield.$• Target creature gets -X/-X until end of turn.$• Up to X target creatures gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)| +Profane Command|Modern Masters 2015 Edition|90|R|{X}{B}{B}|Sorcery|||Choose two -$• Target player loses X life.$• Return target creature card with converted mana cost X or less from your graveyard to the battlefield.$• Target creature gets -X/-X until end of turn.$• Up to X target creatures gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)| Puppeteer Clique|Modern Masters 2015 Edition|91|R|{3}{B}{B}|Creature - Faerie Wizard|3|2|Flying$When Puppeteer Clique enters the battlefield, put target creature card from an opponent's graveyard onto the battlefield under your control. It gains haste. At the beginning of your next end step, exile it.$Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)| Reassembling Skeleton|Modern Masters 2015 Edition|92|U|{1}{B}|Creature - Skeleton Warrior|1|1|{1}{B}: Return Reassembling Skeleton from your graveyard to the battlefield tapped.| Scavenger Drake|Modern Masters 2015 Edition|93|U|{3}{B}|Creature - Drake|1|1|Flying$Whenever another creature dies, you may put a +1/+1 counter on Scavenger Drake.| @@ -26189,8 +26189,78 @@ Sickle Ripper|Modern Masters 2015 Edition|96|C|{1}{B}|Creature - Elemental Warri Sign in Blood|Modern Masters 2015 Edition|97|C|{B}{B}|Sorcery|||Target player draws two cards and loses 2 life.| Spread the Sickness|Modern Masters 2015 Edition|98|U|{4}{B}|Sorcery|||Destroy target creature, then proliferate. (You choose any number of permanents and/or players with counters on them, then give each another counter of a kind already there.)| Surgical Extraction|Modern Masters 2015 Edition|99|R|{BP}|Instant|||({BP} can be paid with either {B} or 2 life.)$Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library.| -Liliana, Heretical Healer|Magic Origins|106|M|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana, Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.| -Liliana, Defiant Necromancer|Magic Origins|106|M||Planeswalker - Liliana|||+2: Each player discards a card.$-X: Return target nonlegendary creature card with converted mana cost X from your graveyard to the battlefield.$-8: You get an emble with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."| +Charging Griffin|Magic Origins|?|C|{3}{W}{3}{W}|Creature - Griffin|2|22|2|Flying$Whenever Charging Griffin attacks, it gets +1/+1 until end of turn.$Flying$Whenever Charging Griffin attacks, it gets +1/+1 until end of turn.| +Mighty Leap|Magic Origins|?|C|{1}{W}{1}{W}|Instant|||Target creature gets +2/+2 and gains flying until end of turn.$Target creature gets +2/+2 and gains flying until end of turn.| +Yoked Ox|Magic Origins|?|C|{W}{W}|Creature - Ox|0|40|4|| +Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Tap target creature.| +Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."| +Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.| +Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.| +Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance (Attacking doesn't cause this creature to tap.)$At the beginning of combat on each opponent's turn, tap target creature that player controls.| +Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| +Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.| +Divine Verdict|Magic Origins|274|C|{3}{W}{3}{W}|Instant|||Destroy target attacking or blocking creature.$Destroy target attacking or blocking creature.| +Eagle of the Watch|Magic Origins|275|C|{2}{W}|Creature - Bird|2|1|Flying, vigilance| +Serra Angel|Magic Origins|276|U|{3}{W}{W}{3}{W}{W}|Creature - Angel|4|44|4|Flying$Vigilance$Flying$Vigilance| +Claustrophobia|Magic Origins|?|C|{1}{U}{U}{1}{U}{U}|Enchantment - Aura|||$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.| +Disperse|Magic Origins|?|C|{1}{U}{1}{U}|Instant|||Return target nonland permanent to its owner's hand.$Return target nonland permanent to its owner's hand.| +Maritime Guard|Magic Origins|?|C|{1}{U}{1}{U}|Creature - Merfolk Soldier|1|31|3|| +Scrapskin Drake|Magic Origins|?|C|{2}{U}{2}{U}|Creature - Zombie Drake|2|32|3|Flying$Scrapskin Drake can block only creatures with flying.$Flying$Scrapskin Drake can block only creatures with flying.| +Tower Geist|Magic Origins|?|U|{3}{U}{3}{U}|Creature - Spirit|2|22|2|Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.| +Hydrolash|Magic Origins|59|U|{2}{U}|Instant|||Attacking creatures get -2/-0 until end of turn.$Draw a card.| +Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$Whenever Jhessian Thief deals combat damage to a player, draw a card.| +Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying (This creature can't be blocked except by creatures with flying or reach.)$Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)| +Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.| +Into the Void|Magic Origins|277|U|{3}{U}{3}{U}|Sorcery|||Return up to two target creatures to their owners' hands.$Return up to two target creatures to their owners' hands.| +Mahamoti Djinn|Magic Origins|278|R|{4}{U}{U}{4}{U}{U}|Creature - Djinn|5|65|6|Flying$Flying| +Weave Fate|Magic Origins|279|C|{3}{U}{3}{U}|Instant|||Draw two cards.$Draw two cards.| +Catacomb Slug|Magic Origins|?|C|{4}{B}{4}{B}|Creature - Slug|2|62|6|| +Cruel Revival|Magic Origins|?|C|{4}{B}{4}{B}|Instant|||Destroy target non-Zombie creature. It can't be regenerated. Return up to one target Zombie card from your graveyard to your hand.$Destroy target non-Zombie creature. It can't be regenerated. Return up to one target Zombie card from your graveyard to your hand.| +Weight of the Underworld|Magic Origins|?|C|{3}{B}{3}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -3/-2.$Enchant creature$Enchanted creature gets -3/-2.| +Deadbridge Shaman|Magic Origins|91|C|{2}{B}|Creature - Elf Shaman|3|1|When Deadbridge Shaman dies, target opponent discards a card.| +Eyeblight Assassin|Magic Origins|95|C|{2}{B}|Creature - Elf Assassin|2|2|When Eyeblight Assassin enters the battlefield, target creature an opponent controls gets -1/-1 until end of turn.| +Liliana, Defiant Necromancer|Magic Origins|106|M||Planeswalker - Liliana|3|+2: Each player discards a card.$-X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.$-8: You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."| +Liliana, Heretical Healer|Magic Origins|106|M|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.| +Malakir Cullblade|Magic Origins|108|U|{1}{B}|Creature - Vampire Warrior|1|1|Whenever a creature an opponent controls dies, put a +1/+1 counter on Malakir Cullblade.| +Rabid Bloodsucker|Magic Origins|113|C|{4}{B}|Creature - Vampire|3|2|Flying$When Rabid Bloodsucker enters the battlefield, each player loses 2 life.| +Reave Soul|Magic Origins|115|C|{1}{B}|Sorcery|||Destroy target creature with power 3 or less.| +Shambling Ghoul|Magic Origins|119|C|{1}{B}|Creature - Zombie|2|3|Shambling Ghoul enters the battlefield tapped.| +Flesh to Dust|Magic Origins|280|C|{3}{B}{B}{3}{B}{B}|Instant|||Destroy target creature. It can't be regenerated.$Destroy target creature. It can't be regenerated.| +Mind Rot|Magic Origins|281|C|{2}{B}{2}{B}|Sorcery|||Target player discards two cards.$Target player discards two cards.| +Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.$Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.| +Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.| +Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| +Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| +Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2|| +Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.| +Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.| +Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| +Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.| +Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace (This creature can't be blocked except by two or more creatures.)| +Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.| +Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.| +Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.| +Subterranean Scout|Magic Origins|164|C|{1}{R}|Creature - Goblin Scout|2|1|When Subterranean Scout enters the battlefield, target creature with power 2 or less can't be blocked this turn.| +Volcanic Rambler|Magic Origins|167|C|{5}{R}|Creature - Elemental|6|4|{2}{R}: Volcanic Rambler deals 1 damage to target player.| +Fiery Hellhound|Magic Origins|284|C|{1}{R}{R}{1}{R}{R}|Creature - Elemental Hound|2|22|2|{R}: Fiery Hellhound gets +1/+0 until end of turn.${R}: Fiery Hellhound gets +1/+0 until end of turn.| +Shivan Dragon|Magic Origins|285|R|{4}{R}{R}{4}{R}{R}|Creature - Dragon|5|55|5|Flying${R}: Shivan Dragon gets +1/+0 until end of turn.$Flying${R}: Shivan Dragon gets +1/+0 until end of turn.| +Elvish Visionary|Magic Origins|?|C|{1}{G}{1}{G}|Creature - Elf Shaman|1|11|1|When Elvish Visionary enters the battlefield, draw a card.$When Elvish Visionary enters the battlefield, draw a card.| +Leaf Gilder|Magic Origins|?|C|{1}{G}{1}{G}|Creature - Elf Druid|2|12|1|{T}: Add {G} to your mana pool.${T}: Add {G} to your mana pool.| +Titanic Growth|Magic Origins|?|C|{1}{G}{1}{G}|Instant|||Target creature gets +4/+4 until end of turn.$Target creature gets +4/+4 until end of turn.| +Vastwood Gorger|Magic Origins|?|C|{5}{G}{5}{G}|Creature - Wurm|5|65|6|| +Yeva's Forcemage|Magic Origins|?|C|{2}{G}{2}{G}|Creature - Elf Shaman|2|22|2|When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.$When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.| +Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.| +Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach| +Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.| +Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.| +Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.| +Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.| +Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample| +Meteorite|Magic Origins|?|U|{5}{5}|Artifact|||When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.$When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.| +Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying| +Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.| +Jayemdae Tome|Magic Origins|?|U|{4}{4}|Artifact|||{4}, {T}: Draw a card.${4}, {T}: Draw a card.| +Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}| Ambush Commander|Duel Decks: Anthology, Elves vs. Goblins|1|R|{3}{G}{G}|Creature - Elf|2|2|Forests you control are 1/1 green Elf creatures that are still lands.${1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.| Lys Alana Huntmaster|Duel Decks: Anthology, Elves vs. Goblins|10|C|{2}{G}{G}|Creature - Elf Warrior|3|3|Whenever you cast an Elf spell, you may put a 1/1 green Elf Warrior creature token onto the battlefield.| Stonewood Invoker|Duel Decks: Anthology, Elves vs. Goblins|11|C|{1}{G}|Creature - Elf Mutant|2|2|{7}{G}: Stonewood Invoker gets +5/+5 until end of turn.| @@ -26486,7 +26556,7 @@ Surrakar Banisher|Duel Decks: Elspeth vs. Kiora|43|C|{4}{U}|Creature - Surrakar| Whelming Wave|Duel Decks: Elspeth vs. Kiora|44|R|{2}{U}{U}|Sorcery|||Return all creatures to their owners' hands except for Krakens, Leviathans, Octopuses, and Serpents.| Explore|Duel Decks: Elspeth vs. Kiora|45|C|{1}{G}|Sorcery|||You may play an additional land this turn.$Draw a card.| Explosive Vegetation|Duel Decks: Elspeth vs. Kiora|46|U|{3}{G}|Sorcery|||Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library.| -Grazing Gladehart|Duel Decks: Elspeth vs. Kiora|47|C|{2}{G}|Creature - Antelope|2|2|Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.| +Grazing Gladehart|Duel Decks: Elspeth vs. Kiora|47|C|{2}{G}|Creature - Antelope|2|2|Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.| Nessian Asp|Duel Decks: Elspeth vs. Kiora|48|C|{4}{G}|Creature - Snake|4|5|Reach${6}{G}: Monstrosity 4. (If this creature isn't monstrous, put four +1/+1 counters on it and it becomes monstrous.)| Netcaster Spider|Duel Decks: Elspeth vs. Kiora|49|C|{2}{G}|Creature - Spider|2|3|Reach (This creature can block creatures with flying.)$Whenever Netcaster Spider blocks a creature with flying, Netcaster Spider gets +2/+0 until end of turn.| Time to Feed|Duel Decks: Elspeth vs. Kiora|50|C|{2}{G}|Sorcery|||Choose target creature an opponent controls. When that creature dies this turn, you gain 3 life. Target creature you control fights that creature. (Each deals damage equal to its power to the other.)| @@ -26557,7 +26627,7 @@ Day of Judgment|Magic Player Rewards|49|Special|{2}{W}{W}|Sorcery|||Destroy all Brave the Elements|Magic Player Rewards|50|Special|{W}|Instant|||Choose a color. White creatures you control gain protection from the chosen color until end of turn.| Doom Blade|Magic Player Rewards|51|Special|{1}{B}|Instant|||Destroy target nonblack creature.| Treasure Hunt|Magic Player Rewards|52|Special|{1}{U}|Sorcery|||Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand.| -Searing Blaze|Magic Player Rewards|53|Special|{R}{R}|Instant|||Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.$Landfall — If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.| +Searing Blaze|Magic Player Rewards|53|Special|{R}{R}|Instant|||Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.$Landfall — If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.| Angelic Blessing|Tempest Remastered|1|C|{2}{W}|Sorcery|||Target creature gets +3/+3 and gains flying until end of turn.| Angelic Protector|Tempest Remastered|2|U|{3}{W}|Creature - Angel|2|2|Flying$Whenever Angelic Protector becomes the target of a spell or ability, Angelic Protector gets +0/+3 until end of turn.| Anoint|Tempest Remastered|3|C|{W}|Instant|||Buyback {3} (You may pay an additional {3} as you cast this spell. If you do, put this card into your hand as it resolves.)$Prevent the next 3 damage that would be dealt to target creature this turn.| From e8a875b241fc1ff1926e40dc8d573081fc37ccfe Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 13 Jun 2015 23:42:37 +0200 Subject: [PATCH 032/148] Some minor changes. --- Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java | 7 ++----- Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java index 532891ad019..edc6362f7d3 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java +++ b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java @@ -37,7 +37,6 @@ import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.DamageControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.game.Game; @@ -82,9 +81,7 @@ class ErgRaidersCondition implements Condition { public boolean apply(Game game, Ability source) { Permanent raiders = game.getPermanentOrLKIBattlefield(source.getSourceId()); AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn"); - if(raiders.wasControlledFromStartOfControllerTurn() && !watcher.getAttackedThisTurnCreatures().contains(raiders.getId())) { - return true; - } - return false; + // wasControlledFromStartOfControllerTurn should be checked during resolution I guess, but shouldn't be relevant + return raiders.wasControlledFromStartOfControllerTurn() && !watcher.getAttackedThisTurnCreatures().contains(raiders.getId()); } } diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java index 04c41525247..86d7afe6d90 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java @@ -30,7 +30,6 @@ package mage.sets.mercadianmasques; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.DealtDamageToSourceTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -75,7 +74,7 @@ class SaberAntsEffect extends OneShotEffect { public SaberAntsEffect() { super(Outcome.Benefit); - this.staticText = "Whenever Saber Ants is dealt damage, you may put that many 1/1 green Insect creature tokens onto the battlefield."; + this.staticText = "you may put that many 1/1 green Insect creature tokens onto the battlefield"; } public SaberAntsEffect(final SaberAntsEffect effect) { From 526a93df7eb502cb42accebf87baaa9f6457bf1e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 02:42:32 +0200 Subject: [PATCH 033/148] Some fixes to user table. --- Mage.Client/src/main/java/mage/client/chat/ChatPanel.java | 4 ++-- .../mage/client/util/gui/countryBox/CountryCellRenderer.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java index 19b2a67bb11..12b95847501 100644 --- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java +++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java @@ -335,8 +335,8 @@ public class ChatPanel extends javax.swing.JPanel { JTableHeader th = jTablePlayers.getTableHeader(); TableColumnModel tcm = th.getColumnModel(); - tcm.getColumn(1).setHeaderValue("Players (" + this.players.length + ")"); - tcm.getColumn(3).setHeaderValue( + tcm.getColumn(jTablePlayers.convertColumnIndexToView(1)).setHeaderValue("Players (" + this.players.length + ")"); + tcm.getColumn(jTablePlayers.convertColumnIndexToView(3)).setHeaderValue( "Games " + roomUserInfo.getNumberActiveGames() + (roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads():" (") + " limit: " + roomUserInfo.getNumberMaxGames() + ")"); diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java index ddcc10aee5c..cc26e5bedca 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java @@ -35,7 +35,6 @@ import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; -import mage.client.chat.ChatPanel; import org.apache.log4j.Logger; /** @@ -58,7 +57,7 @@ public class CountryCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if(column == 0) { + if(table.convertColumnIndexToView(0) == column) { label.setToolTipText(countryMap.get((String)value)); label.setIcon(getCountryFlagIcon((String)value)); label.setText(""); From 6420666668abceb6662eef6f2351613114240fc4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 02:42:56 +0200 Subject: [PATCH 034/148] Some fixes to player handling. --- .../main/java/mage/client/game/PlayAreaPanel.java | 8 ++++++-- .../main/java/mage/server/game/GameController.java | 4 ++-- Mage/src/mage/players/PlayerImpl.java | 3 +-- Mage/src/mage/players/net/UserData.java | 13 +++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index 8f5a31791f7..f82dda7b13b 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -569,8 +569,12 @@ public class PlayAreaPanel extends javax.swing.JPanel { } public void setMenuStates(boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) { - manaPoolMenuItem1.setSelected(manaPoolAutomatic); - manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted); + if (manaPoolMenuItem1 != null) { + manaPoolMenuItem1.setSelected(manaPoolAutomatic); + } + if (manaPoolMenuItem2 != null) { + manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted); + } } private mage.client.game.BattlefieldPanel battlefieldPanel; diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 5f541cc186b..44f72a2a2a1 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -602,8 +602,8 @@ public class GameController implements GameCallback { if (grantingPlayer.isHuman()) { GameSessionPlayer gameSession = gameSessions.get(userIdGranter); if (gameSession != null) { - UUID requestingPlayer = getPlayerId(userIdRequester); - if (requestingPlayer == null || !requestingPlayer.equals(grantingPlayer.getId())) { // don't allow request for your own cards + UUID requestingPlayerId = getPlayerId(userIdRequester); + if (requestingPlayerId == null || !requestingPlayerId.equals(grantingPlayer.getId())) { // don't allow request for your own cards if (grantingPlayer.isRequestToShowHandCardsAllowed()) { gameSession.requestPermissionToSeeHandCards(userIdRequester); } else { diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 7accbb420a4..d0083372707 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -209,7 +209,6 @@ public abstract class PlayerImpl implements Player, Serializable { protected Set playersUnderYourControl = new HashSet<>(); protected Set usersAllowedToSeeHandCards = new HashSet<>(); - protected boolean requestsAllowedToSeeHandCards = true; protected List attachments = new ArrayList<>(); @@ -3113,7 +3112,7 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean isRequestToShowHandCardsAllowed() { - return userData.allowRequestShowHandCards(); + return userData.isAllowRequestShowHandCards(); } @Override diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java index b1b83a7a7cd..101325ec660 100644 --- a/Mage/src/mage/players/net/UserData.java +++ b/Mage/src/mage/players/net/UserData.java @@ -28,6 +28,7 @@ public class UserData implements Serializable { this.userSkipPrioritySteps = userSkipPrioritySteps; this.confirmEmptyManaPool = confirmEmptyManaPool; this.flagName = flagName; + this.askMoveToGraveOrder = askMoveToGraveOrder; } public void setGroupId(int groupId) { @@ -50,20 +51,16 @@ public class UserData implements Serializable { return showAbilityPickerForced; } - public boolean isAllowRequestShowHandCards() { - return allowRequestShowHandCards; - } - public void setShowAbilityPickerForced(boolean showAbilityPickerForced) { this.showAbilityPickerForced = showAbilityPickerForced; } - public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) { - this.allowRequestShowHandCards = allowRequestShowHandCards; + public boolean isAllowRequestShowHandCards() { + return allowRequestShowHandCards; } - public boolean allowRequestShowHandCards() { - return allowRequestShowHandCards; + public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) { + this.allowRequestShowHandCards = allowRequestShowHandCards; } public UserSkipPrioritySteps getUserSkipPrioritySteps() { From 060a468d4b9cd9ce7ca51e39186340113732d801 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 02:43:16 +0200 Subject: [PATCH 035/148] Update to release 1.4.1. --- Mage.Client/pom.xml | 2 +- Mage.Client/release/readme.txt | 2 +- .../src/main/java/mage/client/dialog/AboutDialog.form | 10 +++++----- .../src/main/java/mage/client/dialog/AboutDialog.java | 10 +++++----- Mage.Common/pom.xml | 2 +- Mage.Common/src/mage/utils/MageVersion.java | 4 ++-- Mage.Plugins/Mage.Counter.Plugin/pom.xml | 2 +- Mage.Plugins/Mage.Theme.Plugin/pom.xml | 4 ++-- Mage.Plugins/pom.xml | 2 +- Mage.Server.Console/pom.xml | 2 +- Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml | 2 +- Mage.Server.Plugins/Mage.Deck.Limited/pom.xml | 2 +- Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml | 2 +- .../Mage.Game.CommanderFreeForAll/pom.xml | 2 +- Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml | 2 +- Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml | 2 +- Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.AI/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml | 2 +- Mage.Server.Plugins/Mage.Player.Human/pom.xml | 2 +- .../Mage.Tournament.BoosterDraft/pom.xml | 2 +- .../Mage.Tournament.Constructed/pom.xml | 2 +- Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml | 2 +- Mage.Server.Plugins/pom.xml | 2 +- Mage.Server/pom.xml | 2 +- Mage.Server/release/server.msg.txt | 4 ++-- Mage.Server/server.msg.txt | 2 +- Mage.Sets/pom.xml | 2 +- Mage.Stats/pom.xml | 2 +- Mage.Tests/pom.xml | 2 +- Mage.Updater/pom.xml | 2 +- Mage/pom.xml | 2 +- Mage/src/mage/cards/repository/CardRepository.java | 4 ++-- .../src/mage/cards/repository/ExpansionRepository.java | 4 ++-- Utils/release/getting_implemented_cards.txt | 3 +++ pom.xml | 4 ++-- 39 files changed, 55 insertions(+), 52 deletions(-) diff --git a/Mage.Client/pom.xml b/Mage.Client/pom.xml index e0387aecee3..c28b20ae2b1 100644 --- a/Mage.Client/pom.xml +++ b/Mage.Client/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 org.mage diff --git a/Mage.Client/release/readme.txt b/Mage.Client/release/readme.txt index eeba07fd9ed..cde5e139c8c 100644 --- a/Mage.Client/release/readme.txt +++ b/Mage.Client/release/readme.txt @@ -11,7 +11,7 @@ You can download this from: http://java.com/ Installing and running XMage You will need to download both the client and the server applications. These can be -obtained from HTTP://XMage.info. +obtained from HTTP://XMage.de. Extact the client and the server to separate folders. To play a game you can either connect to a server or start your own server. To diff --git a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form index 4d3f578895f..f9036d14f48 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form +++ b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form @@ -52,9 +52,9 @@ - + - + @@ -82,17 +82,17 @@ - + - + - + diff --git a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java index 613b928b90b..45a60b45087 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java @@ -88,11 +88,11 @@ public class AboutDialog extends MageDialog { lblVersion.setText("0.0.0"); - jLabel2.setText("Courtesy: BetaSteward@googlemail.com. Site: http://XMage.info/"); + jLabel2.setText("Courtesy: BetaSteward@googlemail.com. Site: http://XMage.de/"); - jLabel3.setText("Devs: BetaSteward, Noxx, Eugen.Rivniy, North, LevelX2, Jeff, Plopman, dustinconrad, emerald000. "); + jLabel3.setText("Devs: BetaSteward, Noxx, Eugen.Rivniy, North, LevelX2, Jeff, Plopman, dustinconrad, emerald000.,"); - jLabel4.setText("Thanks: maurer.it, Rafbill, Alvin, cbt33, Quercitron."); + jLabel4.setText("fireshoes, lunaskyrise, mnapoleon, jgod, LoneFox."); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); @@ -122,9 +122,9 @@ public class AboutDialog extends MageDialog { .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE) .addComponent(btnOk) .addContainerGap()) ); diff --git a/Mage.Common/pom.xml b/Mage.Common/pom.xml index 4fb50ddd530..e804b457548 100644 --- a/Mage.Common/pom.xml +++ b/Mage.Common/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage-common diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 7c4f67d2dfb..79436cc949c 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -41,8 +41,8 @@ public class MageVersion implements Serializable, Comparable { */ public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; - public final static int MAGE_VERSION_PATCH = 0; - public final static String MAGE_VERSION_MINOR_PATCH = "v2"; + public final static int MAGE_VERSION_PATCH = 1; + public final static String MAGE_VERSION_MINOR_PATCH = "v0"; public final static String MAGE_VERSION_INFO = ""; private final int major; diff --git a/Mage.Plugins/Mage.Counter.Plugin/pom.xml b/Mage.Plugins/Mage.Counter.Plugin/pom.xml index a17a51e3693..569f1399beb 100644 --- a/Mage.Plugins/Mage.Counter.Plugin/pom.xml +++ b/Mage.Plugins/Mage.Counter.Plugin/pom.xml @@ -7,7 +7,7 @@ org.mage mage-plugins - 1.4.0 + 1.4.1 mage-counter-plugin diff --git a/Mage.Plugins/Mage.Theme.Plugin/pom.xml b/Mage.Plugins/Mage.Theme.Plugin/pom.xml index e03b2cd956f..053171cd390 100644 --- a/Mage.Plugins/Mage.Theme.Plugin/pom.xml +++ b/Mage.Plugins/Mage.Theme.Plugin/pom.xml @@ -6,7 +6,7 @@ org.mage mage-plugins - 1.4.0 + 1.4.1 mage-theme-plugin @@ -29,7 +29,7 @@ ${project.groupId} mage-client - 1.4.0 + 1.4.1 diff --git a/Mage.Plugins/pom.xml b/Mage.Plugins/pom.xml index 082e3e65096..cc48ed5c7be 100644 --- a/Mage.Plugins/pom.xml +++ b/Mage.Plugins/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage-plugins diff --git a/Mage.Server.Console/pom.xml b/Mage.Server.Console/pom.xml index 89711b9d918..2522cc1d116 100644 --- a/Mage.Server.Console/pom.xml +++ b/Mage.Server.Console/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 org.mage diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml index 17ed6709e3e..eeb227fab7b 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-deck-constructed diff --git a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml index aaf2a0c6c0a..5ba54ada61d 100644 --- a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml +++ b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-deck-limited diff --git a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml index 198839d0f23..21d3ecfae31 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-game-commanderduel diff --git a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml index d83276362cc..f0fa53feb71 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml @@ -6,7 +6,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-game-commanderfreeforall diff --git a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml index d44c53517b5..79201f719e6 100644 --- a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-game-freeforall diff --git a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml index 3ed7020bf77..995624a110d 100644 --- a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-game-tinyleadersduel diff --git a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml index fe7e465d170..822af7beeff 100644 --- a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml +++ b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-game-twoplayerduel diff --git a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml index 13e94e25e60..eb5254b9266 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-ai-draftbot diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml index 8bbe618537c..d905d12ec1b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-ai-ma diff --git a/Mage.Server.Plugins/Mage.Player.AI/pom.xml b/Mage.Server.Plugins/Mage.Player.AI/pom.xml index d4308dc2e4f..6c90d7e1d56 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AI/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-ai diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml index 86f8bf80990..ef53791b090 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-ai-mcts diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml index 5223670dca0..7f31cb06928 100644 --- a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-aiminimax diff --git a/Mage.Server.Plugins/Mage.Player.Human/pom.xml b/Mage.Server.Plugins/Mage.Player.Human/pom.xml index 9e7c35f9d90..d76184bfd64 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/pom.xml +++ b/Mage.Server.Plugins/Mage.Player.Human/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-player-human diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml index a54a82d6f56..897b17155a2 100644 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-tournament-boosterdraft diff --git a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml index 272aa4bdf8f..a4c096d5073 100644 --- a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-tournament-constructed diff --git a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml index 1727046d60a..37b534066be 100644 --- a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml +++ b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml @@ -7,7 +7,7 @@ org.mage mage-server-plugins - 1.4.0 + 1.4.1 mage-tournament-sealed diff --git a/Mage.Server.Plugins/pom.xml b/Mage.Server.Plugins/pom.xml index eb1522dccf4..6aa5662ff10 100644 --- a/Mage.Server.Plugins/pom.xml +++ b/Mage.Server.Plugins/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage-server-plugins diff --git a/Mage.Server/pom.xml b/Mage.Server/pom.xml index 8ca875326bd..ecc375c12d3 100644 --- a/Mage.Server/pom.xml +++ b/Mage.Server/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage-server diff --git a/Mage.Server/release/server.msg.txt b/Mage.Server/release/server.msg.txt index c6bb6c677ec..f9309549e1d 100644 --- a/Mage.Server/release/server.msg.txt +++ b/Mage.Server/release/server.msg.txt @@ -1,4 +1,4 @@ -Welcome! You are playing XMage version 1.3.0 +Welcome! You are playing XMage version 1.4.1 Find what was changed since previous versions on project Wiki https://github.com/magefree/mage/wiki Contact us on the XMAGE board of http://www.slightlymagic.net/forum/viewforum.php?f=70 for bug reports or enhancement requests. -Download newest version from http://XMage.info. \ No newline at end of file +Download newest version from http://XMage.de \ No newline at end of file diff --git a/Mage.Server/server.msg.txt b/Mage.Server/server.msg.txt index 17ea51ac05a..7ef6a5c492c 100644 --- a/Mage.Server/server.msg.txt +++ b/Mage.Server/server.msg.txt @@ -2,5 +2,5 @@ HotKeys: Alt+E - Enlarge card image Wheel zoom in/out - Enlarge card image F4 - end current turn, response to stack F9 - skip all opponents' turns, no response to stack -Welcome! You are playing Mage version 1.4.0 +Welcome! You are playing Mage version 1.4.1 Contact us on www.slightlymagic.net \ No newline at end of file diff --git a/Mage.Sets/pom.xml b/Mage.Sets/pom.xml index 6974f845d0f..e5beb76c890 100644 --- a/Mage.Sets/pom.xml +++ b/Mage.Sets/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 org.mage diff --git a/Mage.Stats/pom.xml b/Mage.Stats/pom.xml index 99fed80daa7..c95eae15158 100644 --- a/Mage.Stats/pom.xml +++ b/Mage.Stats/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 org.mage diff --git a/Mage.Tests/pom.xml b/Mage.Tests/pom.xml index 8b5be68e065..5536e82d55f 100644 --- a/Mage.Tests/pom.xml +++ b/Mage.Tests/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage-tests diff --git a/Mage.Updater/pom.xml b/Mage.Updater/pom.xml index 62b47116dc5..296591999f9 100644 --- a/Mage.Updater/pom.xml +++ b/Mage.Updater/pom.xml @@ -5,7 +5,7 @@ mage-root org.mage - 1.4.0 + 1.4.1 4.0.0 diff --git a/Mage/pom.xml b/Mage/pom.xml index b29479975df..a7336af347f 100644 --- a/Mage/pom.xml +++ b/Mage/pom.xml @@ -7,7 +7,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 mage diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index c9ae81aa612..357e18a204c 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -58,9 +58,9 @@ public enum CardRepository { private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "card"; // raise this if db structure was changed - private static final long CARD_DB_VERSION = 38; + private static final long CARD_DB_VERSION = 39; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 17; + private static final long CARD_CONTENT_VERSION = 18; private final Random random = new Random(); private Dao cardDao; diff --git a/Mage/src/mage/cards/repository/ExpansionRepository.java b/Mage/src/mage/cards/repository/ExpansionRepository.java index 5fb202231b4..6f2e118bec5 100644 --- a/Mage/src/mage/cards/repository/ExpansionRepository.java +++ b/Mage/src/mage/cards/repository/ExpansionRepository.java @@ -26,8 +26,8 @@ public enum ExpansionRepository { private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE"; private static final String VERSION_ENTITY_NAME = "expansion"; - private static final long EXPANSION_DB_VERSION = 4; - private static final long EXPANSION_CONTENT_VERSION = 7; + private static final long EXPANSION_DB_VERSION = 5; + private static final long EXPANSION_CONTENT_VERSION = 8; private Dao expansionDao; diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index 6ef99fa38e8..bf50704b7d0 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -131,6 +131,9 @@ git log e8b2e01cd465f6a8ced2c83ec52a698ee093baa4..HEAD --diff-filter=A --name-st since 1.4.0.v2 git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.1.v0 +git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl diff --git a/pom.xml b/pom.xml index c0468ace043..3eb73e58206 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.mage mage-root - 1.4.0 + 1.4.1 pom Mage Root Mage Root POM @@ -83,7 +83,7 @@ - 1.4.0 + 1.4.1 UTF-8 From c5063182b2c1387e1dc284a14de97b097704e692 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 01:00:17 -0400 Subject: [PATCH 036/148] Adding Living Hive --- .../src/mage/sets/mirrodin/LivingHive.java | 103 ++++++++++++++++++ .../src/mage/sets/planechase/LivingHive.java | 52 +++++++++ 2 files changed, 155 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirrodin/LivingHive.java create mode 100644 Mage.Sets/src/mage/sets/planechase/LivingHive.java diff --git a/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java b/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java new file mode 100644 index 00000000000..d2e38bc750b --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java @@ -0,0 +1,103 @@ +/* + * 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.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.token.InsectToken; +import mage.players.Player; + +/** + * + * @author ilcartographer + */ +public class LivingHive extends CardImpl { + + public LivingHive(UUID ownerId) { + super(ownerId, 124, "Living Hive", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Elemental"); + this.subtype.add("Insect"); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Whenever Living Hive deals combat damage to a player, put that many 1/1 green Insect creature tokens onto the battlefield. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LivingHiveEffect(), false, true)); + } + + public LivingHive(final LivingHive card) { + super(card); + } + + @Override + public LivingHive copy() { + return new LivingHive(this); + } +} + +class LivingHiveEffect extends OneShotEffect { + + public LivingHiveEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "put that many 1/1 green Insect creature tokens onto the battlefield"; + } + + public LivingHiveEffect(final LivingHiveEffect effect) { + super(effect); + } + + @Override + public LivingHiveEffect copy() { + return new LivingHiveEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + if (player != null) { + int amount = (Integer)getValue("damage"); + if (amount > 0) { + return new CreateTokenEffect(new InsectToken(), amount).apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/LivingHive.java b/Mage.Sets/src/mage/sets/planechase/LivingHive.java new file mode 100644 index 00000000000..1b502f6e2eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/LivingHive.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.planechase; + +import java.util.UUID; + +/** + * + * @author ilcartographer + */ +public class LivingHive extends mage.sets.mirrodin.LivingHive { + + public LivingHive(UUID ownerId) { + super(ownerId); + this.cardNumber = 75; + this.expansionSetCode = "HOP"; + } + + public LivingHive(final LivingHive card) { + super(card); + } + + @Override + public LivingHive copy() { + return new LivingHive(this); + } +} From 05b654b5bdbbf98ccc190f9eb435815b3394a79e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 10:27:44 +0200 Subject: [PATCH 037/148] Proliferate - Added object id to the displayed permanent's name if the player has to choose which counter to proliferate. --- .../abilities/effects/common/counter/ProliferateEffect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java index 363012453c2..b85e47bf840 100644 --- a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java +++ b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java @@ -87,7 +87,7 @@ public class ProliferateEffect extends OneShotEffect { choices.add(counter.getName()); } choice.setChoices(choices); - choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")"); + choice.setMessage("Choose a counter to proliferate (" + permanent.getIdName() + ")"); controller.choose(Outcome.Benefit, choice, game); for (Counter counter : permanent.getCounters().values()) { if (counter.getName().equals(choice.getChoice())) { From 6e2441cc42bb0ae6e29e5e24ccb408976b13aae0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 14:52:22 +0200 Subject: [PATCH 038/148] * Apostle's Blessing - Fixed tooltip text. --- Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java index 79bdbcafa4f..1106bb635aa 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java @@ -87,7 +87,7 @@ class ApostlesBlessingEffect extends OneShotEffect { public ApostlesBlessingEffect() { super(Outcome.AddAbility); - this.staticText = "Target artifact or creature gains protection from artifacts or from the color of your choice until end of turn"; + this.staticText = "Target artifact or creature you control gains protection from artifacts or from the color of your choice until end of turn"; } public ApostlesBlessingEffect(final ApostlesBlessingEffect effect) { From 0b2e61081a2f8b2dfa4d5b5ea0c85f02b289be29 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 14:53:23 +0200 Subject: [PATCH 039/148] Fixed a problem with the country flag resource name causing null pointer exceptions and graphical problems on the client side. --- .../src/main/java/mage/client/dialog/PreferencesDialog.java | 2 +- .../mage/client/util/gui/countryBox/CountryCellRenderer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index 1a92477f2fd..c9d2f27d8fa 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -2422,7 +2422,7 @@ public class PreferencesDialog extends javax.swing.JDialog { PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), getUserSkipPrioritySteps(), - MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"), + MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true") ); } diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java index cc26e5bedca..2ee392fe9ea 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java @@ -68,7 +68,7 @@ public class CountryCellRenderer extends DefaultTableCellRenderer { private ImageIcon getCountryFlagIcon(String countryCode) { ImageIcon flagIcon = flagIconCache.get(countryCode); if (flagIcon == null) { - flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode +".png")); + flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode + (countryCode.endsWith(".png") ? "" :".png"))); if (flagIcon.getImage() == null) { logger.warn("Country flag resource not found: " + countryCode); } else { From 725e7c5454b2bf473ee37c18ac9c0891622a2df2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 14:53:57 +0200 Subject: [PATCH 040/148] Update version to 1.4.1v1 to fix the graphical UI problems on the client. --- Mage.Common/src/mage/utils/MageVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 79436cc949c..f30ec277dde 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -42,7 +42,7 @@ public class MageVersion implements Serializable, Comparable { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 1; - public final static String MAGE_VERSION_MINOR_PATCH = "v0"; + public final static String MAGE_VERSION_MINOR_PATCH = "v1"; public final static String MAGE_VERSION_INFO = ""; private final int major; From f6ef6f66673b797cb8fff6c4b2ff8cb07feefd8a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 15:00:51 +0200 Subject: [PATCH 041/148] Updated 1.4.1v1 version id. --- Utils/release/getting_implemented_cards.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index bf50704b7d0..203bc260828 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -134,6 +134,9 @@ git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-st since 1.4.1.v0 git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.1.v1 +git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl From ac5a9435a70ebffdd2bac3a2f8d17684fb3f0d8d Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 11:48:01 -0400 Subject: [PATCH 042/148] Elvish Berserker added --- .../src/mage/sets/exodus/ElvishBerserker.java | 52 +++++++++++++++ .../sets/ninthedition/ElvishBerserker.java | 65 +++++++++++++++++++ .../sets/tenthedition/ElvishBerserker.java | 52 +++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java diff --git a/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java new file mode 100644 index 00000000000..a5b0844e716 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.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.exodus; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker { + + public ElvishBerserker(UUID ownerId) { + super(ownerId); + this.cardNumber = 110; + this.expansionSetCode = "EXO"; + } + + public ElvishBerserker(final ElvishBerserker card) { + super(card); + } + + @Override + public ElvishBerserker copy() { + return new ElvishBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java new file mode 100644 index 00000000000..67397948b20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.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.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class ElvishBerserker extends CardImpl { + + public ElvishBerserker(UUID ownerId) { + super(ownerId, 237, "Elvish Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Elf"); + this.subtype.add("Berserker"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Elvish Berserker becomes blocked, it gets +1/+1 until end of turn for each creature blocking it. + this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public ElvishBerserker(final ElvishBerserker card) { + super(card); + } + + @Override + public ElvishBerserker copy() { + return new ElvishBerserker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java new file mode 100644 index 00000000000..3ff69c63076 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.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.tenthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker { + + public ElvishBerserker(UUID ownerId) { + super(ownerId); + this.cardNumber = 260; + this.expansionSetCode = "10E"; + } + + public ElvishBerserker(final ElvishBerserker card) { + super(card); + } + + @Override + public ElvishBerserker copy() { + return new ElvishBerserker(this); + } +} From 617e00cee4009563e28e8632b22b57b1ddaeafd1 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 12:30:57 -0400 Subject: [PATCH 043/148] Fertilid added --- .../src/mage/sets/archenemy/Fertilid.java | 52 ++++++++++++++++ .../src/mage/sets/commander/Fertilid.java | 61 +++++++++++++++++++ .../src/mage/sets/morningtide/Fertilid.java | 52 ++++++++++++++++ .../src/mage/sets/planechase/Fertilid.java | 52 ++++++++++++++++ 4 files changed, 217 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/archenemy/Fertilid.java create mode 100644 Mage.Sets/src/mage/sets/commander/Fertilid.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/Fertilid.java create mode 100644 Mage.Sets/src/mage/sets/planechase/Fertilid.java diff --git a/Mage.Sets/src/mage/sets/archenemy/Fertilid.java b/Mage.Sets/src/mage/sets/archenemy/Fertilid.java new file mode 100644 index 00000000000..14679543053 --- /dev/null +++ b/Mage.Sets/src/mage/sets/archenemy/Fertilid.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.archenemy; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Fertilid extends mage.sets.commander.Fertilid { + + public Fertilid(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "ARC"; + } + + public Fertilid(final Fertilid card) { + super(card); + } + + @Override + public Fertilid copy() { + return new Fertilid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java new file mode 100644 index 00000000000..4c829685076 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -0,0 +1,61 @@ +/* + * 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.commander; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Fertilid extends CardImpl { + + public Fertilid(UUID ownerId) { + super(ownerId, 154, "Fertilid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "CMD"; + this.subtype.add("Elemental"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Fertilid enters the battlefield with two +1/+1 counters on it. + // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. + } + + public Fertilid(final Fertilid card) { + super(card); + } + + @Override + public Fertilid copy() { + return new Fertilid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/morningtide/Fertilid.java b/Mage.Sets/src/mage/sets/morningtide/Fertilid.java new file mode 100644 index 00000000000..6b710ba91c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/Fertilid.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.morningtide; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Fertilid extends mage.sets.commander.Fertilid { + + public Fertilid(UUID ownerId) { + super(ownerId); + this.cardNumber = 122; + this.expansionSetCode = "MOR"; + } + + public Fertilid(final Fertilid card) { + super(card); + } + + @Override + public Fertilid copy() { + return new Fertilid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/Fertilid.java b/Mage.Sets/src/mage/sets/planechase/Fertilid.java new file mode 100644 index 00000000000..400a940838b --- /dev/null +++ b/Mage.Sets/src/mage/sets/planechase/Fertilid.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.planechase; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Fertilid extends mage.sets.commander.Fertilid { + + public Fertilid(UUID ownerId) { + super(ownerId); + this.cardNumber = 72; + this.expansionSetCode = "HOP"; + } + + public Fertilid(final Fertilid card) { + super(card); + } + + @Override + public Fertilid copy() { + return new Fertilid(this); + } +} From 505cd944a0938dc86b58af0bd5f612f6c9bf8600 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 12:38:30 -0400 Subject: [PATCH 044/148] Fertilid implementation --- Mage.Sets/src/mage/sets/commander/Fertilid.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java index 4c829685076..310895d17a0 100644 --- a/Mage.Sets/src/mage/sets/commander/Fertilid.java +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -29,9 +29,21 @@ package mage.sets.commander; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.RemoveCountersSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterBasicLandCard; +import mage.target.TargetPlayer; +import mage.target.common.TargetCardInLibrary; /** * @@ -47,7 +59,12 @@ public class Fertilid extends CardImpl { this.toughness = new MageInt(0); // Fertilid enters the battlefield with two +1/+1 counters on it. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); + ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.addAbility(ability); } public Fertilid(final Fertilid card) { From 35654a5ca8520930bb58ad4837e2099a0f9cdbf0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 18:39:01 +0200 Subject: [PATCH 045/148] Fixed that by some effects that move permanents from battlefield to other zones, the object was not moved and was still on the battlefield but also shown in the target zone. --- Mage/src/mage/players/PlayerImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index d0083372707..732fe47137e 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2839,7 +2839,19 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) { ArrayList cardList = new ArrayList<>(); - cardList.addAll(cards.getCards(game)); + for (UUID cardId: cards) { + if (fromZone.equals(Zone.BATTLEFIELD)) { + Permanent permanent = game.getPermanent(cardId); + if (permanent != null) { + cardList.add(permanent); + } + } else { + Card card = game.getCard(cardId); + if (card != null) { + cardList.add(card); + } + } + } return moveCards(cardList, fromZone, toZone, source, game); } From 0194cfa8b199b4f005ad6094b2b89932e5382e35 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 13:02:58 -0400 Subject: [PATCH 046/148] Pain Magnification added --- .../sets/dissension/PainMagnification.java | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/PainMagnification.java diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java new file mode 100644 index 00000000000..fbc90a4263a --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java @@ -0,0 +1,96 @@ +/* + * 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.dissension; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author anonymous + */ +public class PainMagnification extends CardImpl { + + public PainMagnification(UUID ownerId) { + super(ownerId, 121, "Pain Magnification", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{R}"); + this.expansionSetCode = "DIS"; + + // Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card. + this.addAbility(new PainMagnificationTriggeredAbility()); + } + + public PainMagnification(final PainMagnification card) { + super(card); + } + + @Override + public PainMagnification copy() { + return new PainMagnification(this); + } +} + +class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl { + + public PainMagnificationTriggeredAbility() { + super(Zone.BATTLEFIELD, new DiscardTargetEffect(1, false), false); + } + + public PainMagnificationTriggeredAbility(final PainMagnificationTriggeredAbility ability) { + super(ability); + } + + @Override + public PainMagnificationTriggeredAbility copy() { + return new PainMagnificationTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + int amount = event.getAmount(); + if(amount >= 3) { + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card."; + } +} From 36a703f21d423cb6acd63e21c717865756e5d811 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 14:01:22 -0400 Subject: [PATCH 047/148] Pain Magnification fix to set the opponent as the target for the discard ability --- .../src/mage/sets/dissension/PainMagnification.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java index fbc90a4263a..2c771c192d2 100644 --- a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java +++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java @@ -29,6 +29,7 @@ package mage.sets.dissension; import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -36,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; /** * @@ -64,7 +66,7 @@ public class PainMagnification extends CardImpl { class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl { public PainMagnificationTriggeredAbility() { - super(Zone.BATTLEFIELD, new DiscardTargetEffect(1, false), false); + super(Zone.BATTLEFIELD, new DiscardTargetEffect(1), false); } public PainMagnificationTriggeredAbility(final PainMagnificationTriggeredAbility ability) { @@ -79,9 +81,14 @@ class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { + // If the damaged player is an opponent if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { int amount = event.getAmount(); if(amount >= 3) { + // If at least 3 damage is dealt, set the the opponent as the Discard target + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } return true; } } From 5f582e59d3dd11f6d5d16c6432b9de402983da58 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 14:13:45 -0400 Subject: [PATCH 048/148] Fixed ability target for Fertilid --- Mage.Sets/src/mage/sets/commander/Fertilid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java index 310895d17a0..2ad4df84788 100644 --- a/Mage.Sets/src/mage/sets/commander/Fertilid.java +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -63,7 +63,7 @@ public class Fertilid extends CardImpl { // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); - this.getSpellAbility().addTarget(new TargetPlayer()); + ability.addTarget(new TargetPlayer()); this.addAbility(ability); } From 77c66d6a84712815b46cbdc821c6fe111465fd0f Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 14:27:21 -0400 Subject: [PATCH 049/148] Comment typo --- Mage.Sets/src/mage/sets/dissension/PainMagnification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java index 2c771c192d2..3846e509d62 100644 --- a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java +++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java @@ -85,7 +85,7 @@ class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl { if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { int amount = event.getAmount(); if(amount >= 3) { - // If at least 3 damage is dealt, set the the opponent as the Discard target + // If at least 3 damage is dealt, set the opponent as the Discard target for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } From f1dad0994aa2b66f7ea8b32efca62fcb4bc5c9f9 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 14:32:12 -0400 Subject: [PATCH 050/148] Comment updates --- Mage.Sets/src/mage/sets/archenemy/Fertilid.java | 2 +- Mage.Sets/src/mage/sets/commander/Fertilid.java | 2 +- Mage.Sets/src/mage/sets/dissension/PainMagnification.java | 2 +- Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java | 2 +- Mage.Sets/src/mage/sets/morningtide/Fertilid.java | 2 +- Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java | 2 +- Mage.Sets/src/mage/sets/planechase/Fertilid.java | 2 +- Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/archenemy/Fertilid.java b/Mage.Sets/src/mage/sets/archenemy/Fertilid.java index 14679543053..df59cab005e 100644 --- a/Mage.Sets/src/mage/sets/archenemy/Fertilid.java +++ b/Mage.Sets/src/mage/sets/archenemy/Fertilid.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author ilcartographer */ public class Fertilid extends mage.sets.commander.Fertilid { diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java index 2ad4df84788..ea820f44fed 100644 --- a/Mage.Sets/src/mage/sets/commander/Fertilid.java +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -47,7 +47,7 @@ import mage.target.common.TargetCardInLibrary; /** * - * @author anonymous + * @author ilcartographer */ public class Fertilid extends CardImpl { diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java index 3846e509d62..bed43711a4f 100644 --- a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java +++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java @@ -41,7 +41,7 @@ import mage.target.targetpointer.FixedTarget; /** * - * @author anonymous + * @author ilcartographer */ public class PainMagnification extends CardImpl { diff --git a/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java index a5b0844e716..1f8625c7cf2 100644 --- a/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java +++ b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author ilcartographer */ public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker { diff --git a/Mage.Sets/src/mage/sets/morningtide/Fertilid.java b/Mage.Sets/src/mage/sets/morningtide/Fertilid.java index 6b710ba91c0..3a9e5670b46 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Fertilid.java +++ b/Mage.Sets/src/mage/sets/morningtide/Fertilid.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author ilcartographer */ public class Fertilid extends mage.sets.commander.Fertilid { diff --git a/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java index 67397948b20..b111c600ed6 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java @@ -38,7 +38,7 @@ import mage.constants.Rarity; /** * - * @author anonymous + * @author ilcartographer */ public class ElvishBerserker extends CardImpl { diff --git a/Mage.Sets/src/mage/sets/planechase/Fertilid.java b/Mage.Sets/src/mage/sets/planechase/Fertilid.java index 400a940838b..6a3a8489195 100644 --- a/Mage.Sets/src/mage/sets/planechase/Fertilid.java +++ b/Mage.Sets/src/mage/sets/planechase/Fertilid.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author ilcartographer */ public class Fertilid extends mage.sets.commander.Fertilid { diff --git a/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java index 3ff69c63076..83ff3259f95 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java +++ b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java @@ -31,7 +31,7 @@ import java.util.UUID; /** * - * @author anonymous + * @author ilcartographer */ public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker { From 324188a86e6440b3bcba08c5d89eaeefe63cf2cb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:22:38 +0200 Subject: [PATCH 051/148] Fixed missing copy statements of cardAttribute in game state. --- Mage.Sets/src/mage/sets/gatecrash/Bioshift.java | 1 - Mage/src/mage/game/CardAttribute.java | 8 ++++++++ Mage/src/mage/game/GameState.java | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java index 27cb238c2fc..01764c518ab 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java +++ b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java @@ -52,7 +52,6 @@ public class Bioshift extends CardImpl { super(ownerId, 214, "Bioshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/U}"); this.expansionSetCode = "GTC"; - // Move any number of +1/+1 counters from target creature onto another target creature with the same controller. getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect()); getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false)); diff --git a/Mage/src/mage/game/CardAttribute.java b/Mage/src/mage/game/CardAttribute.java index 95b4659ab7d..49cbf8dce27 100644 --- a/Mage/src/mage/game/CardAttribute.java +++ b/Mage/src/mage/game/CardAttribute.java @@ -21,6 +21,14 @@ public class CardAttribute implements Serializable { public CardAttribute(Card card) { color = card.getColor(null).copy(); } + + public CardAttribute(CardAttribute cardAttribute) { + this.color = cardAttribute.color; + } + + public CardAttribute copy() { + return new CardAttribute(this); + } public ObjectColor getColor() { return color; diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java index ebfdc555a19..83236ef4e69 100644 --- a/Mage/src/mage/game/GameState.java +++ b/Mage/src/mage/game/GameState.java @@ -171,6 +171,9 @@ public class GameState implements Serializable, Copyable { for (Map.Entry entry: state.cardState.entrySet()) { cardState.put(entry.getKey(), entry.getValue().copy()); } + for (Map.Entry entry: state.cardAttribute.entrySet()) { + cardAttribute.put(entry.getKey(), entry.getValue().copy()); + } this.zoneChangeCounter.putAll(state.zoneChangeCounter); this.copiedCards.putAll(state.copiedCards); this.permanentOrderNumber = state.permanentOrderNumber; @@ -208,6 +211,7 @@ public class GameState implements Serializable, Copyable { this.zones = state.zones; this.simultaneousEvents = state.simultaneousEvents; this.cardState = state.cardState; + this.cardAttribute = state.cardAttribute; this.zoneChangeCounter = state.zoneChangeCounter; this.copiedCards = state.copiedCards; this.permanentOrderNumber = state.permanentOrderNumber; From 135c76ed71bf64c9e0037462bfc862c7bfa1ac74 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:23:26 +0200 Subject: [PATCH 052/148] Added possibility to set a specific deck for a test. --- Mage.Tests/CommanderDuel_UW.dck | 70 +++++++++++++++++++ .../base/CardTestCommanderDuelBase.java | 10 ++- .../serverside/base/CardTestPlayerBase.java | 9 ++- .../base/impl/CardTestPlayerAPIImpl.java | 11 +++ 4 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 Mage.Tests/CommanderDuel_UW.dck diff --git a/Mage.Tests/CommanderDuel_UW.dck b/Mage.Tests/CommanderDuel_UW.dck new file mode 100644 index 00000000000..795b083a073 --- /dev/null +++ b/Mage.Tests/CommanderDuel_UW.dck @@ -0,0 +1,70 @@ +NAME:Geoff's Daxos of Meletis +1 [THS:58] Ordeal of Thassa +1 [5ED:388] Mana Vault +1 [THS:14] Gift of Immortality +1 [PC2:12] Spirit Mantle +1 [M13:36] Sublime Archangel +1 [M13:206] Gilded Lotus +1 [M11:5] Armored Ascension +1 [ALA:27] Sigiled Paladin +1 [ALA:26] Sighted-Caste Sorcerer +1 [CON:2] Asha's Favor +1 [M14:210] Fireshrieker +1 [GTC:17] Holy Mantle +1 [CHK:65] Hinder +1 [DGM:96] Render Silent +1 [M13:74] Tricks of the Trade +1 [ISD:229] Mask of Avacyn +1 [GPT:28] Infiltrator's Magemark +14 [THS:234] Island +1 [CMD:261] Sol Ring +1 [THS:25] Ordeal of Heliod +1 [5DN:131] Helm of Kaldra +1 [M12:24] Lifelink +1 [AVR:50] Elgaud Shieldmate +19 [THS:230] Plains +1 [M14:23] Indestructibility +1 [M14:5] Archangel of Thune +1 [CMD:265] Azorius Chancery +1 [ARB:3] Ethercaste Knight +1 [ARB:1] Ardent Plea +1 [M13:18] Guardians of Akrasa +1 [CMD:40] Brainstorm +1 [UDS:139] Thran Dynamo +1 [M12:219] Swiftfoot Boots +1 [THS:39] Aqueous Form +1 [M13:6] Aven Squire +1 [MMA:25] Path to Exile +1 [M13:4] Angelic Benediction +1 [CMD:253] Lightning Greaves +1 [SHM:150] Steel of the Godhead +1 [M13:225] Glacial Fortress +1 [10E:40] Serra's Embrace +1 [JUD:31] Unquestioned Authority +1 [M13:221] Cathedral of War +1 [RTR:9] Ethereal Armor +1 [DDL:27] Battle Mastery +1 [DDL:24] Bonds of Faith +1 [ISD:53] Dissipate +1 [DKA:148] Executioner's Hood +1 [DIS:159] Azorius Signet +1 [GTC:37] Hands of Binding +1 [PC2:112] Quietus Spike +1 [MRD:144] Banshee's Blade +1 [AVR:36] Silverblade Paladin +1 [PC2:115] Whispersilk Cloak +1 [M12:73] Ponder +1 [M13:29] Rhox Faithmender +1 [ALA:1] Akrasan Squire +1 [M13:213] Ring of Thune +1 [UDS:46] Sigil of Sleep +1 [M13:211] Ring of Evos Isle +1 [RTR:241] Hallowed Fountain +1 [7ED:67] Counterspell +1 [ISD:49] Curiosity +1 [SOM:229] Seachrome Coast +1 [PC2:10] Mammoth Umbra +1 [MBS:104] Darksteel Plate +1 [M13:21] Knight of Glory +1 [M13:22] Oblivion Ring +SB: 1 [THS:191] Daxos of Meletis diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java index c31449aa0e8..df244f549d7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java @@ -42,12 +42,18 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; public abstract class CardTestCommanderDuelBase extends CardTestPlayerAPIImpl { + public CardTestCommanderDuelBase() { + super(); + this.deckNameA = "CommanderDuel.dck"; + this.deckNameB = "CommanderDuel.dck"; + } + @Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { Game game = new CommanderDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 40); - playerA = createPlayer(game, playerA, "PlayerA","CommanderDuel.dck"); - playerB = createPlayer(game, playerB, "PlayerB","CommanderDuel.dck"); + playerA = createPlayer(game, playerA, "PlayerA",deckNameA); + playerB = createPlayer(game, playerB, "PlayerB",deckNameB); return game; } diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java index e3435c3d3f4..5c92e590068 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java @@ -15,12 +15,17 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl; */ public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl { + public CardTestPlayerBase() { + deckNameA = "RB Aggro.dck"; + deckNameB = "RB Aggro.dck"; + } + @Override protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { Game game = new TwoPlayerDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20); - playerA = createPlayer(game, playerA, "PlayerA"); - playerB = createPlayer(game, playerB, "PlayerB"); + playerA = createPlayer(game, playerA, "PlayerA", deckNameA); + playerB = createPlayer(game, playerB, "PlayerB", deckNameB); return game; } 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 dc059ca7cf6..8b910600cb8 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 @@ -44,6 +44,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement protected GameOptions gameOptions; + protected String deckNameA; + protected String deckNameB; + protected enum ExpectedType { TURN_NUMBER, RESULT, @@ -1009,6 +1012,14 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement player.addTarget("targetPlayer="+targetPlayer.getName()); } + public void setDecknamePlayerA(String deckname) { + deckNameA = deckname; + } + + public void setDecknamePlayerB(String deckname) { + deckNameB = deckname; + } + protected void skipInitShuffling() { gameOptions.skipInitShuffling = true; } From 516b6ea8e777f8b3a4b03a9c929525594819f937 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:24:15 +0200 Subject: [PATCH 053/148] * Teferi, Mage of Zhalfir - Fixed that the flash ability was not applied to commander in command zone. --- .../sets/timespiral/TeferiMageOfZhalfir.java | 9 ++- .../duel/TeferiMageOfZhalfirTest.java | 70 +++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java diff --git a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java index 12ce53027ff..26395fa7c3a 100644 --- a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java +++ b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java @@ -131,7 +131,14 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl { if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) { game.getState().addOtherAbility(card, FlashAbility.getInstance()); } - } + } + // commander in command zone + if (controller.getCommanderId() != null && game.getState().getZone(controller.getCommanderId()).equals(Zone.COMMAND)) { + Card card = game.getCard(controller.getCommanderId()); + if (card.getCardType().contains(CardType.CREATURE)) { + game.getState().addOtherAbility(card, FlashAbility.getInstance()); + } + } return true; } return false; diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java new file mode 100644 index 00000000000..9171cb94a0b --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java @@ -0,0 +1,70 @@ +/* + * 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.commander.duel; + + +import java.io.FileNotFoundException; +import mage.abilities.keyword.FlashAbility; +import mage.constants.CardType; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.GameException; +import mage.game.command.CommandObject; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestCommanderDuelBase; + +/** + * + * @author LevelX2 + */ + +public class TeferiMageOfZhalfirTest extends CardTestCommanderDuelBase { + + @Override + protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException { + setDecknamePlayerA("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis + return super.createNewGameAndPlayers(); + } + + @Test + public void castCommanderWithFlash() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir"); + + castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Daxos of Meletis"); + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Daxos of Meletis", 1); + + } +} \ No newline at end of file From 75645946e0f5c88badd33327f8ad5e364c19f198 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 14 Jun 2015 23:56:23 +0200 Subject: [PATCH 054/148] * Searing Blaze - Fixed that damage was not raised to 3 if the controller played a land before. --- .../src/mage/sets/worldwake/SearingBlaze.java | 26 ++++++-------- .../abilities/keywords/LandfallTest.java | 35 +++++++++++++++++++ 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java index c5b2b73ac36..2cccea80098 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java +++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java @@ -96,24 +96,18 @@ class SearingBlazeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId()); + LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get("LandPlayed"); Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget()); Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget()); - if (watcher != null && watcher.conditionMet()) { - if (player != null) { - player.damage(3, source.getSourceId(), game, false, true); - } - if (creature != null) { - creature.damage(3, source.getSourceId(), game, false, true); - } + int damage = 1; + if (watcher != null && watcher.landPlayed(source.getControllerId())) { + damage = 3; } - else { - if (player != null) { - player.damage(1, source.getSourceId(), game, false, true); - } - if (creature != null) { - creature.damage(1, source.getSourceId(), game, false, true); - } + if (player != null) { + player.damage(damage, source.getSourceId(), game, false, true); + } + if (creature != null) { + creature.damage(damage, source.getSourceId(), game, false, true); } return true; } @@ -143,7 +137,7 @@ class SearingBlazeTarget extends TargetPermanent { @Override public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game); - Set possibleTargets = new HashSet(); + Set possibleTargets = new HashSet<>(); MageObject object = game.getObject(sourceId); if (object instanceof StackObject) { UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java index ef5349b9ae8..0f4ab1f663b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java @@ -111,5 +111,40 @@ public class LandfallTest extends CardTestPlayerBase { assertLife(playerB, 20); } + + /** + * Searing Blaze's landfall doesn't appear to be working. My opponent played + * a mountain, then played searing blaze targeting my Tasigur, the Golden + * Fang. It only dealt 1 damage to me, where it should've dealt 3, because + * my opponent had played a land. + */ + @Test + public void testSearingBlaze() { + // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls. + // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead. + addCard(Zone.HAND, playerA, "Searing Blaze",1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain",1); + addCard(Zone.HAND, playerA, "Mountain"); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); + + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze"); + + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Mountain", 2); + assertGraveyardCount(playerA, "Searing Blaze" , 1); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + assertGraveyardCount(playerB, "Silvercoat Lion" , 1); + + } } From a0333eef8ff098e50c897a85fcd4756120149264 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 18:06:04 -0400 Subject: [PATCH 055/148] Aquitect's Will implemented --- .../src/mage/sets/lorwyn/AquitectsWill.java | 131 ++++++++++++++++++ Mage/src/mage/counters/CounterType.java | 1 + 2 files changed, 132 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java new file mode 100644 index 00000000000..9f700ffa37e --- /dev/null +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -0,0 +1,131 @@ +/* + * 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.lorwyn; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author ilcartographer + */ +public class AquitectsWill extends CardImpl { + private static final String rule = "land is an Island in addition to its other types for as long as it has a flood counter on it."; + + public AquitectsWill(UUID ownerId) { + super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}"); + this.expansionSetCode = "LRW"; + this.subtype.add("Merfolk"); + + // Put a flood counter on target land. That land is an Island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. + this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance())); + this.getSpellAbility().addTarget(new TargetLandPermanent()); + Effect effect = new AquitectsWillGainAbilityEffect( + new BlueManaAbility(), + Duration.Custom, rule); + this.getSpellAbility().addEffect(effect); + //this.getSpellAbility().addEffect(new AquitectsWillEffect()); + this.getSpellAbility().addEffect(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), + new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")), + "If you control a Merfolk, draw a card")); + } + + public AquitectsWill(final AquitectsWill card) { + super(card); + } + + @Override + public AquitectsWill copy() { + return new AquitectsWill(this); + } +} + +class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { + + public AquitectsWillGainAbilityEffect(Ability ability, Duration duration, String rule) { + super(ability, duration, rule); + } + + public AquitectsWillGainAbilityEffect(final AquitectsWillGainAbilityEffect effect) { + super(effect); + } + + @Override + public boolean isInactive(Ability source, Game game) { + Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); + if (land != null && land.getCounters().getCount(CounterType.FLOOD) < 1) { + return true; + } + return false; + } + + @Override + public AquitectsWillGainAbilityEffect copy() { + return new AquitectsWillGainAbilityEffect(this); + } +} + +/* +class AquitectsWillEffect extends OneShotEffect { + + public AquitectsWillEffect() { + super(Outcome.DrawCard); + this.staticText = "If you control a Merfolk, draw a card."; + } + + public AquitectsWillEffect(final AquitectsWillEffect effect) { + super(effect); + } + + @Override + public AquitectsWillEffect copy() { + return new AquitectsWillEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } +}*/ diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 00e2fe3b4bf..e446016fa61 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -53,6 +53,7 @@ public enum CounterType { FADE("fade"), FATE("fate"), FEATHER("feather"), + FLOOD("flood"), FUSE("fuse"), HATCHLING("hatchling"), HOOFPRINT("hoofprint"), From 6d036a60851ef621a01b90e500a7b82ea48d251f Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 18:10:46 -0400 Subject: [PATCH 056/148] Removed unused code --- .../src/mage/sets/lorwyn/AquitectsWill.java | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index 9f700ffa37e..fa895875945 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -59,13 +59,17 @@ public class AquitectsWill extends CardImpl { this.subtype.add("Merfolk"); // Put a flood counter on target land. That land is an Island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. + // Add the flood counter to target land this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance())); this.getSpellAbility().addTarget(new TargetLandPermanent()); + + // Add the Flood counter effect Effect effect = new AquitectsWillGainAbilityEffect( new BlueManaAbility(), Duration.Custom, rule); this.getSpellAbility().addEffect(effect); - //this.getSpellAbility().addEffect(new AquitectsWillEffect()); + + // Draw if you control a Merfolk this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DrawCardSourceControllerEffect(1), new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")), @@ -105,27 +109,4 @@ class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { public AquitectsWillGainAbilityEffect copy() { return new AquitectsWillGainAbilityEffect(this); } -} - -/* -class AquitectsWillEffect extends OneShotEffect { - - public AquitectsWillEffect() { - super(Outcome.DrawCard); - this.staticText = "If you control a Merfolk, draw a card."; - } - - public AquitectsWillEffect(final AquitectsWillEffect effect) { - super(effect); - } - - @Override - public AquitectsWillEffect copy() { - return new AquitectsWillEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } -}*/ +} \ No newline at end of file From e5ef66a3cff7ed8a4c2d6554ec4eef0fd6b99b18 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 19:24:31 -0400 Subject: [PATCH 057/148] Added an additional parameter to BecomesBasicLandTargetEffect to allow it to keep it's other land types; Updated Aquitect's Will to actually make the card an island, not just granting it the mana ability --- .../src/mage/sets/lorwyn/AquitectsWill.java | 18 ++++++++---------- .../BecomesBasicLandTargetEffect.java | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index fa895875945..ab30e1e44f1 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -33,6 +33,7 @@ import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.mana.BlueManaAbility; @@ -64,10 +65,7 @@ public class AquitectsWill extends CardImpl { this.getSpellAbility().addTarget(new TargetLandPermanent()); // Add the Flood counter effect - Effect effect = new AquitectsWillGainAbilityEffect( - new BlueManaAbility(), - Duration.Custom, rule); - this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island")); // Draw if you control a Merfolk this.getSpellAbility().addEffect(new ConditionalOneShotEffect( @@ -86,13 +84,13 @@ public class AquitectsWill extends CardImpl { } } -class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { +class AquitectsWillEffect extends BecomesBasicLandTargetEffect { - public AquitectsWillGainAbilityEffect(Ability ability, Duration duration, String rule) { - super(ability, duration, rule); + public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) { + super(duration, chooseLandType, loseType, landNames); } - public AquitectsWillGainAbilityEffect(final AquitectsWillGainAbilityEffect effect) { + public AquitectsWillEffect(final AquitectsWillEffect effect) { super(effect); } @@ -106,7 +104,7 @@ class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { } @Override - public AquitectsWillGainAbilityEffect copy() { - return new AquitectsWillGainAbilityEffect(this); + public AquitectsWillEffect copy() { + return new AquitectsWillEffect(this); } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 134bae46168..3cd7a1f11cd 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -59,6 +59,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { protected boolean chooseLandType; protected ArrayList landTypes = new ArrayList(); + protected boolean loseOther; // loses all other abilities, card types, and creature types public BecomesBasicLandTargetEffect(Duration duration) { this(duration, true, new String[0]); @@ -69,10 +70,15 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, String... landNames) { + this(duration, chooseLandType, true, landNames); + } + + public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, boolean loseOther, String... landNames) { super(duration, Outcome.Detriment); this.landTypes.addAll(Arrays.asList(landNames)); this.chooseLandType = chooseLandType; this.staticText = setText(); + this.loseOther = loseOther; } @@ -105,6 +111,19 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { this.discard(); } } + + if(!loseOther) { + for (UUID targetPermanent : targetPointer.getTargets(game, source)) { + Permanent land = game.getPermanent(targetPermanent); + if (land != null) { + for(String type : land.getSubtype()) { + if(!landTypes.contains(type)) { + landTypes.add(type); + } + } + } + } + } } @Override From bd4a0e7177fc04f037617ba4b2ca9f66667251c7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jun 2015 07:44:34 +0200 Subject: [PATCH 058/148] * Added test for commander damage wind condition. --- .../commander/duel/CastCommanderTest.java | 4 +-- .../duel/TeferiMageOfZhalfirTest.java | 34 +++++++++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java index 33bbc816b54..6af9e08c961 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java @@ -38,7 +38,7 @@ import org.mage.test.serverside.base.CardTestCommanderDuelBase; */ public class CastCommanderTest extends CardTestCommanderDuelBase { @Test - public void testFirstAbility() { + public void testCastCommander() { addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath"); @@ -50,5 +50,5 @@ public class CastCommanderTest extends CardTestCommanderDuelBase { assertLife(playerB, 40); assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1); - } + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java index 9171cb94a0b..08c03b60468 100644 --- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java @@ -29,13 +29,10 @@ package org.mage.test.commander.duel; import java.io.FileNotFoundException; -import mage.abilities.keyword.FlashAbility; -import mage.constants.CardType; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.game.Game; import mage.game.GameException; -import mage.game.command.CommandObject; import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestCommanderDuelBase; @@ -67,4 +64,35 @@ public class TeferiMageOfZhalfirTest extends CardTestCommanderDuelBase { assertPermanentCount(playerA, "Daxos of Meletis", 1); } + + @Test + public void testCommanderDamage() { + addCard(Zone.BATTLEFIELD, playerA, "Plains", 6); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Enchant creature + // Enchanted creature gets +4/+4, has flying and first strike, and is an Angel in addition to its other types. + // When enchanted creature dies, return Angelic Destiny to its owner's hand. + addCard(Zone.HAND, playerA, "Angelic Destiny"); + + addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir"); + + // Daxos of Meletis can't be blocked by creatures with power 3 or greater. + // Whenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Destiny","Daxos of Meletis"); + + attack(3, playerA, "Daxos of Meletis"); + attack(5, playerA, "Daxos of Meletis"); + attack(7, playerA, "Daxos of Meletis"); + attack(9, playerA, "Daxos of Meletis"); + + setStopAt(9, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerA, "Daxos of Meletis", 1); + assertPowerToughness(playerA, "Daxos of Meletis", 6, 6); + + Assert.assertEquals("Player A has won because of commander damage", true, playerA.hasWon()); + Assert.assertEquals("Player A has lost because of commander damage", true, playerB.hasLost()); + } } \ No newline at end of file From ca19cd95f204916cc0bcdeaefe1c6b088f0fe4ff Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jun 2015 08:25:13 +0200 Subject: [PATCH 059/148] Mage release 1.4.1v2 --- Mage.Common/src/mage/utils/MageVersion.java | 2 +- Mage/src/mage/cards/repository/CardRepository.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index f30ec277dde..5a9acc7466c 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -42,7 +42,7 @@ public class MageVersion implements Serializable, Comparable { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 1; - public final static String MAGE_VERSION_MINOR_PATCH = "v1"; + public final static String MAGE_VERSION_MINOR_PATCH = "v2"; public final static String MAGE_VERSION_INFO = ""; private final int major; diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 357e18a204c..6cfd22889bb 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -60,7 +60,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 39; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 18; + private static final long CARD_CONTENT_VERSION = 19; private final Random random = new Random(); private Dao cardDao; From 8443b5ede113a94fd56956912795f3b1452662a6 Mon Sep 17 00:00:00 2001 From: wanderer120 Date: Mon, 15 Jun 2015 22:44:17 +0800 Subject: [PATCH 060/148] added greater harvester card. (p.s: i need this card, will add newer ones start from mirrodin after this ) --- .../mage/sets/darksteel/GreaterHarvester.java | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java diff --git a/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java new file mode 100644 index 00000000000..820cbf29fdd --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java @@ -0,0 +1,100 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author wanderer120 + */ +public class GreaterHarvester extends CardImpl { + + public static final FilterPermanent filter = new FilterPermanent("a permanent"); + + static{ + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.PLANESWALKER), + new CardTypePredicate(CardType.LAND))); + } + + public GreaterHarvester(UUID ownerId) { + super(ownerId, 44, "Greater Harvester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{B}"); + this.expansionSetCode = "DST"; + this.subtype.add("Horror"); + + this.power = new MageInt(5); + this.toughness = new MageInt(6); + + // At the beginning of your upkeep, sacrifice a permanent. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, ""), TargetController.YOU, false)); + + //Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents. + this.addAbility(new GreaterHarvesterAbility()); + } + + public GreaterHarvester(final GreaterHarvester card) { + super(card); + } + + @Override + public GreaterHarvester copy() { + return new GreaterHarvester(this); + } +} +class GreaterHarvesterAbility extends TriggeredAbilityImpl { + + public GreaterHarvesterAbility() { + super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 2, "")); + } + + public GreaterHarvesterAbility(final GreaterHarvesterAbility ability) { + super(ability); + } + + @Override + public GreaterHarvesterAbility copy() { + return new GreaterHarvesterAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event instanceof DamagedPlayerEvent) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage to a player, that player sacrifices two permanent."; + } +} \ No newline at end of file From cd0f273122300e9c8dd0c6d740966089e59e3dcc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jun 2015 17:35:48 +0200 Subject: [PATCH 061/148] Fixed a bug that if a human player had to discard more cards than he had on hand, the game UI was blocked. --- .../java/mage/client/table/TablesPanel.java | 1 + .../java/mage/player/ai/ComputerPlayer.java | 2 +- .../abilities/activated/ReturnToHandTest.java | 1 - .../cards/abilities/keywords/DiscardTest.java | 39 ++++++++++++++----- Mage/src/mage/players/PlayerImpl.java | 3 +- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java index 62b0294b4cb..a92e06a60f0 100644 --- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java @@ -1146,6 +1146,7 @@ public class TablesPanel extends javax.swing.JPanel { options.setMatchTimeLimit(MatchTimeLimit.NONE); options.setFreeMulligans(2); options.setSkillLevel(SkillLevel.CASUAL); + options.setRollbackTurnsAllowed(true); table = session.createTable(roomId, options); session.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck"),""); diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 7daf4cb517b..49399a7889b 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -208,7 +208,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (log.isDebugEnabled()) { log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString()); } - // sometimes a target aelection can be made from a player that does not control the ability + // sometimes a target selection can be made from a player that does not control the ability UUID abilityControllerId = playerId; if (target.getTargetController() != null && target.getAbilityController() != null) { abilityControllerId = target.getAbilityController(); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java index 3b87ec843a1..7d4ea0d43cd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java @@ -27,7 +27,6 @@ */ package org.mage.test.cards.abilities.activated; -import mage.abilities.keyword.BloodthirstAbility; import mage.constants.PhaseStep; import mage.constants.Zone; import org.junit.Test; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java index f9dcd57ecdd..146a5eb9256 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; @@ -37,16 +36,14 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class DiscardTest extends CardTestPlayerBase { - /* - * If Rest in Peace is in play, every card going to the graveyard goes to exile instead. - * If a card is discarded while Rest in Peace is on the battlefield, abilities that function - * when a card is discarded (such as madness) still work, even though that card never reaches - * a graveyard. - */ - + /* + * If Rest in Peace is in play, every card going to the graveyard goes to exile instead. + * If a card is discarded while Rest in Peace is on the battlefield, abilities that function + * when a card is discarded (such as madness) still work, even though that card never reaches + * a graveyard. + */ @Test public void testRestInPeaceAndCycle() { @@ -67,4 +64,26 @@ public class DiscardTest extends CardTestPlayerBase { assertHandCount(playerA, 1); // the card drawn by Cycling } -} \ No newline at end of file + /** + * With Bazaar of Baghdad, if you use it when you have no cards in hand, you + * draw 2, it asks for you to discard 3, but you can't. So the game can't + * progress and you lose on time. + */ + @Test + public void testBazaarOfBaghdad() { + // {T}: Draw two cards, then discard three cards. + addCard(Zone.BATTLEFIELD, playerA, "Bazaar of Baghdad", 1); + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw two cards, then discard three cards"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertHandCount(playerA, 0); + assertGraveyardCount(playerA, 2); + + } +} diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 732fe47137e..65228de1e6b 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -709,7 +709,8 @@ public abstract class PlayerImpl implements Player, Serializable { } } } else { - TargetDiscard target = new TargetDiscard(amount, amount, new FilterCard(CardUtil.numberToText(amount, "a") + " card" + (amount > 1 ? "s" : "")), playerId); + int possibleAmount = Math.min(getHand().size(), amount); + TargetDiscard target = new TargetDiscard(possibleAmount, possibleAmount, new FilterCard(CardUtil.numberToText(possibleAmount, "a") + " card" + (possibleAmount > 1 ? "s" : "")), playerId); choose(Outcome.Discard, target, source == null ? null : source.getSourceId(), game); for (UUID cardId : target.getTargets()) { Card card = this.getHand().get(cardId, game); From 9361b1c2e4c81388f0b23ce2887b1ba928c13c28 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jun 2015 20:09:33 +0200 Subject: [PATCH 062/148] [ORI] Updated mtg-cards-data.txt (80 cards). --- Utils/mtg-cards-data.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 3ae82c3d2eb..a2209b00837 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -26204,10 +26204,14 @@ Eagle of the Watch|Magic Origins|275|C|{2}{W}|Creature - Bird|2|1|Flying, vigila Serra Angel|Magic Origins|276|U|{3}{W}{W}{3}{W}{W}|Creature - Angel|4|44|4|Flying$Vigilance$Flying$Vigilance| Claustrophobia|Magic Origins|?|C|{1}{U}{U}{1}{U}{U}|Enchantment - Aura|||$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.| Disperse|Magic Origins|?|C|{1}{U}{1}{U}|Instant|||Return target nonland permanent to its owner's hand.$Return target nonland permanent to its owner's hand.| +Displacement Wave|Magic Origins|?|?mtg-set-icon mtg-set-magic-origins-unknown|{X}{U}{U}{X}{U}{U}|Sorcery|||Return all nonland permanents with converted mana cost X or less to their owners' hands.$Return all nonland permanents with converted mana cost X or less to their owners' hands.| Maritime Guard|Magic Origins|?|C|{1}{U}{1}{U}|Creature - Merfolk Soldier|1|31|3|| +Mizzium Meddler|Magic Origins|?|R|{2}{U}{2}{U}|Creature - Vedalken Wizard|1|41|4|Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.$Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.| Scrapskin Drake|Magic Origins|?|C|{2}{U}{2}{U}|Creature - Zombie Drake|2|32|3|Flying$Scrapskin Drake can block only creatures with flying.$Flying$Scrapskin Drake can block only creatures with flying.| Tower Geist|Magic Origins|?|U|{3}{U}{3}{U}|Creature - Spirit|2|22|2|Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.| Hydrolash|Magic Origins|59|U|{2}{U}|Instant|||Attacking creatures get -2/-0 until end of turn.$Draw a card.| +Jace, Telepath Unbound|Magic Origins|60|M||Planeswalker - Jace|55|+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". $+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". | +Jace, Vryn's Prodigy|Magic Origins|60|M|{1}{U}{1}{U}|Legendary Creature - Human Wizard|0|20|2|{T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. ${T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. | Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$Whenever Jhessian Thief deals combat damage to a player, draw a card.| Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying (This creature can't be blocked except by creatures with flying or reach.)$Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)| Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.| @@ -26237,6 +26241,8 @@ Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 u Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.| Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace (This creature can't be blocked except by two or more creatures.)| +Chandra, Fire of Kaladesh|Magic Origins|135|M|{1}{R}{R}{1}{R}{R}|Legendary Creature - Human Shaman|2|22|2|Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.$Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.| +Chandra, Roaring Flame|Magic Origins|135|M||Planeswalker - Chandra|44|+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."$+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."| Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.| Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.| Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.| @@ -26253,6 +26259,8 @@ Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Concla Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach| Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.| Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.| +Nissa, Sage Animist|Magic Origins|189|M||Planeswalker - Nissa|33|+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.$+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.| +Nissa, Vastwood Seer|Magic Origins|189|M|{2}{G}{2}{G}|Legendary Creature - Elf Scout|2|22|2|When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.$When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.| Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.| Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.| Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample| @@ -26260,7 +26268,7 @@ Meteorite|Magic Origins|?|U|{5}{5}|Artifact|||When Meteorite enters the battlefi Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying| Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.| Jayemdae Tome|Magic Origins|?|U|{4}{4}|Artifact|||{4}, {T}: Draw a card.${4}, {T}: Draw a card.| -Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}| +Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}| Ambush Commander|Duel Decks: Anthology, Elves vs. Goblins|1|R|{3}{G}{G}|Creature - Elf|2|2|Forests you control are 1/1 green Elf creatures that are still lands.${1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.| Lys Alana Huntmaster|Duel Decks: Anthology, Elves vs. Goblins|10|C|{2}{G}{G}|Creature - Elf Warrior|3|3|Whenever you cast an Elf spell, you may put a 1/1 green Elf Warrior creature token onto the battlefield.| Stonewood Invoker|Duel Decks: Anthology, Elves vs. Goblins|11|C|{1}{G}|Creature - Elf Mutant|2|2|{7}{G}: Stonewood Invoker gets +5/+5 until end of turn.| From 7860c87dd996f5af3407a7dca0def4b51df9ffaa Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 16 Jun 2015 00:01:39 +0300 Subject: [PATCH 063/148] Implement cards: Ana Battlemage, Flowstone Overseer, Harbinger of Night, Kaervek's Torch, and Rootwater Thief --- .../mage/sets/mirage/HarbingerOfNight.java | 68 +++++++++ .../src/mage/sets/mirage/KaerveksTorch.java | 55 ++++++++ .../mage/sets/nemesis/FlowstoneOverseer.java | 71 ++++++++++ .../src/mage/sets/nemesis/RootwaterThief.java | 124 +++++++++++++++++ .../mage/sets/planarchaos/AnaBattlemage.java | 129 ++++++++++++++++++ .../sets/vintagemasters/KaerveksTorch.java | 115 ++++++++++++++++ 6 files changed, 562 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java create mode 100644 Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java create mode 100644 Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java create mode 100644 Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java create mode 100644 Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java diff --git a/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java b/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java new file mode 100644 index 00000000000..fc31ace1c0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.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.common.OnEventTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.events.GameEvent.EventType; + +/** + * + * @author LoneFox + + */ +public class HarbingerOfNight extends CardImpl { + + public HarbingerOfNight(UUID ownerId) { + super(ownerId, 26, "Harbinger of Night", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // At the beginning of your upkeep, put a -1/-1 counter on each creature. + this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", + new AddCountersAllEffect(CounterType.M1M1.createInstance(), new FilterCreaturePermanent()), false)); + } + + public HarbingerOfNight(final HarbingerOfNight card) { + super(card); + } + + @Override + public HarbingerOfNight copy() { + return new HarbingerOfNight(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java b/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java new file mode 100644 index 00000000000..c9c1c4b1a28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java @@ -0,0 +1,55 @@ +/* + * 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.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class KaerveksTorch extends mage.sets.vintagemasters.KaerveksTorch { + + public KaerveksTorch(UUID ownerId) { + super(ownerId); + this.cardNumber = 185; + this.expansionSetCode = "MIR"; + this.rarity = Rarity.COMMON; + } + + public KaerveksTorch(final KaerveksTorch card) { + super(card); + } + + @Override + public KaerveksTorch copy() { + return new KaerveksTorch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java b/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java new file mode 100644 index 00000000000..27b1985b6bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.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.nemesis; + +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.common.continuous.BoostTargetEffect; +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 FlowstoneOverseer extends CardImpl { + + public FlowstoneOverseer(UUID ownerId) { + super(ownerId, 82, "Flowstone Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {R}{R}: Target creature gets +1/-1 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}{R}")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FlowstoneOverseer(final FlowstoneOverseer card) { + super(card); + } + + @Override + public FlowstoneOverseer copy() { + return new FlowstoneOverseer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java b/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java new file mode 100644 index 00000000000..7329fbab21e --- /dev/null +++ b/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java @@ -0,0 +1,124 @@ +/* + * 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.nemesis; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +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.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + + */ +public class RootwaterThief extends CardImpl { + + public RootwaterThief(UUID ownerId) { + super(ownerId, 40, "Rootwater Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "NMS"; + this.subtype.add("Merfolk"); + this.subtype.add("Rogue"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {U}: Rootwater Thief gains flying until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}"))); + // Whenever Rootwater Thief deals combat damage to a player, you may pay {2}. If you do, search that player's library for a card and exile it, then the player shuffles his or her library. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new RootwaterThiefEffect(), false, true)); + } + + public RootwaterThief(final RootwaterThief card) { + super(card); + } + + @Override + public RootwaterThief copy() { + return new RootwaterThief(this); + } +} + +class RootwaterThiefEffect extends OneShotEffect { + + RootwaterThiefEffect() { + super(Outcome.Exile); + staticText = "you may pay {2}. If you do, search that player's library for a card and exile it, then the player shuffles his or her library."; + } + + RootwaterThiefEffect(final RootwaterThiefEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (controller == null || damagedPlayer == null) { + return false; + } + String message = "Pay {2} to exile a card from damaged player's library?"; + Cost cost = new ManaCostsImpl("{2}"); + if(controller.chooseUse(Outcome.Benefit, message, game) && cost.pay(source, game, source.getSourceId(), controller.getId(), false)) + { + TargetCardInLibrary target = new TargetCardInLibrary(); + if (controller.searchLibrary(target, game, damagedPlayer.getId())) { + if (target.getTargets().size() > 0) { + Card card = damagedPlayer.getLibrary().remove(target.getFirstTarget(), game); + if (card != null) { + controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); + } + } + } + + damagedPlayer.shuffleLibrary(game); + return true; + } + return false; + } + + @Override + public RootwaterThiefEffect copy() { + return new RootwaterThiefEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java b/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java new file mode 100644 index 00000000000..3bb4ab66ce5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java @@ -0,0 +1,129 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.planarchaos; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCostCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + + */ +public class AnaBattlemage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creature"); + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public AnaBattlemage(UUID ownerId) { + super(ownerId, 124, "Ana Battlemage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PLC"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Kicker {2}{U} and/or {1}{B} + KickerAbility kickerAbility = new KickerAbility("{2}{U}"); + kickerAbility.addKickerCost("{1}{B}"); + this.addAbility(kickerAbility); + // When Ana Battlemage enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards. + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(3)); + ability.addTarget(new TargetOpponent()); + this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{2}{U}"), + "When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards.")); + // When Ana Battlemage enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller. + ability = new EntersBattlefieldTriggeredAbility(new AnaBattlemageKickerEffect()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{1}{B}"), + "When {this} enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller.")); + } + + public AnaBattlemage(final AnaBattlemage card) { + super(card); + } + + @Override + public AnaBattlemage copy() { + return new AnaBattlemage(this); + } +} + +class AnaBattlemageKickerEffect extends OneShotEffect { + + public AnaBattlemageKickerEffect() { + super(Outcome.Detriment); + this.staticText = "tap target untapped creature and it deals damage equal to its power to its controller"; + } + + public AnaBattlemageKickerEffect(final AnaBattlemageKickerEffect effect) { + super(effect); + } + + @Override + public AnaBattlemageKickerEffect copy() { + return new AnaBattlemageKickerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean applied = false; + Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source)); + if (targetCreature != null) { + applied = targetCreature.tap(game); + Player controller = game.getPlayer(targetCreature.getControllerId()); + if (controller != null) { + controller.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true); + applied = true; + } + } + return applied; + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java new file mode 100644 index 00000000000..8536466c70b --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java @@ -0,0 +1,115 @@ +/* + * 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.vintagemasters; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.CostModificationType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.target.Target; +import mage.target.Targets; +import mage.target.common.TargetCreatureOrPlayer; +import mage.util.CardUtil; + +/** + * + * @author LoneFox + + */ +public class KaerveksTorch extends CardImpl { + + public KaerveksTorch(UUID ownerId) { + super(ownerId, 175, "Kaervek's Torch", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}"); + this.expansionSetCode = "VMA"; + + // As long as Kaervek's Torch is on the stack, spells that target it cost {2} more to cast. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaerveksTorchCostIncreaseEffect())); + // Kaervek's Torch deals X damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public KaerveksTorch(final KaerveksTorch card) { + super(card); + } + + @Override + public KaerveksTorch copy() { + return new KaerveksTorch(this); + } +} + +class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl { + + KaerveksTorchCostIncreaseEffect() { + super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.INCREASE_COST); + staticText = "Spells that target Kaervek's Torch cost {2} more to cast"; + } + + KaerveksTorchCostIncreaseEffect(KaerveksTorchCostIncreaseEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source, Ability abilityToModify) { + CardUtil.increaseCost(abilityToModify, 2); + return true; + } + + @Override + public boolean applies(Ability abilityToModify, Ability source, Game game) { + if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) + { + for(Target target: abilityToModify.getTargets()) { + for(UUID id: target.getTargets()) { + if(id.equals(source.getSourceObject(game).getId())) { + return true; + } + } + } + } + return false; + } + + @Override + public KaerveksTorchCostIncreaseEffect copy() { + return new KaerveksTorchCostIncreaseEffect(this); + } +} From 0e72d4a93f14705e68bb90328f96e7d03b7cab6a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Jun 2015 23:45:07 +0200 Subject: [PATCH 064/148] [ORI] Added Sentinel of the Eternal Watch. --- .../SentinelOfTheEternalWatch.java | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java b/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java new file mode 100644 index 00000000000..7571edab198 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java @@ -0,0 +1,98 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FirstTargetPointer; + +/** + * + * @author LevelX2 + */ +public class SentinelOfTheEternalWatch extends CardImpl { + + public SentinelOfTheEternalWatch(UUID ownerId) { + super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Giant"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(6); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // At the beginning of combat on each opponent's turn, tap target creature that player controls. + this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true)); + + } + + public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) { + super(card); + } + + @Override + public SentinelOfTheEternalWatch copy() { + return new SentinelOfTheEternalWatch(this); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof BeginningOfCombatTriggeredAbility) { + for (Effect effect: ability.getEffects()) { + UUID opponentId = effect.getTargetPointer().getFirst(game, ability); + Player opponent = game.getPlayer(opponentId); + if (opponent != null) { + effect.setTargetPointer(new FirstTargetPointer()); + FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature from the active opponent"); + filter.add(new ControllerIdPredicate(opponentId)); + Target target = new TargetCreaturePermanent(filter); + ability.addTarget(target); + } + } + } + } + + +} From 40e22d9f497123a11d9f4d00131d6ef6dbec6cee Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 16 Jun 2015 00:03:17 +0200 Subject: [PATCH 065/148] Some minor changes. --- .../mage/sets/darksteel/GreaterHarvester.java | 46 +++++++++++-------- .../sets/dragonsmaze/TeysaEnvoyOfGhosts.java | 19 ++++---- .../mirrodinbesieged/ContestedWarZone.java | 2 - 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java index 820cbf29fdd..b5dc2a20201 100644 --- a/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java +++ b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java @@ -22,6 +22,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -29,17 +30,17 @@ import mage.target.targetpointer.FixedTarget; * @author wanderer120 */ public class GreaterHarvester extends CardImpl { - - public static final FilterPermanent filter = new FilterPermanent("a permanent"); - - static{ - filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), - new CardTypePredicate(CardType.CREATURE), - new CardTypePredicate(CardType.ENCHANTMENT), - new CardTypePredicate(CardType.PLANESWALKER), - new CardTypePredicate(CardType.LAND))); - } - + + public static final FilterPermanent filter = new FilterPermanent("a permanent"); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.PLANESWALKER), + new CardTypePredicate(CardType.LAND))); + } + public GreaterHarvester(UUID ownerId) { super(ownerId, 44, "Greater Harvester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{B}"); this.expansionSetCode = "DST"; @@ -50,7 +51,7 @@ public class GreaterHarvester extends CardImpl { // At the beginning of your upkeep, sacrifice a permanent. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, ""), TargetController.YOU, false)); - + //Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents. this.addAbility(new GreaterHarvesterAbility()); } @@ -64,6 +65,7 @@ public class GreaterHarvester extends CardImpl { return new GreaterHarvester(this); } } + class GreaterHarvesterAbility extends TriggeredAbilityImpl { public GreaterHarvesterAbility() { @@ -79,16 +81,20 @@ class GreaterHarvesterAbility extends TriggeredAbilityImpl { return new GreaterHarvesterAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return EventType.DAMAGED_PLAYER.equals(event.getType()); + } + + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } @@ -97,4 +103,4 @@ class GreaterHarvesterAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever {this} deals combat damage to a player, that player sacrifices two permanent."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java b/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java index 720cbf0e21c..bab770d4b87 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java @@ -100,16 +100,19 @@ class TeysaEnvoyOfGhostsTriggeredAbility extends TriggeredAbilityImpl { return new TeysaEnvoyOfGhostsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.getPlayerId().equals(controllerId) && damageEvent.isCombatDamage() && p != null && p.getCardType().contains(CardType.CREATURE)) { - game.getState().setValue(sourceId.toString(), p.getControllerId()); - getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent sourcePermanent = game.getPermanent(event.getSourceId()); + if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null && sourcePermanent.getCardType().contains(CardType.CREATURE)) { + game.getState().setValue(sourceId.toString(), sourcePermanent.getControllerId()); + getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java index 18aa0237fd6..1558ed15381 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java @@ -28,7 +28,6 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.Mana; import mage.constants.CardType; import mage.constants.Duration; @@ -46,7 +45,6 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.abilities.mana.ColorlessManaAbility; -import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterAttackingCreature; import mage.game.Game; From 5cf5990251d24397ebfb8c8c4b609126df3ed145 Mon Sep 17 00:00:00 2001 From: Marshall Date: Mon, 15 Jun 2015 20:48:56 -0400 Subject: [PATCH 066/148] Fertilid fix that actually lets the target player search library, not Fertilid's controller --- .../src/mage/sets/commander/Fertilid.java | 49 ++++++++++++++++++- .../search/SearchLibraryPutInPlayEffect.java | 4 +- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java index ea820f44fed..fd4d14ce21a 100644 --- a/Mage.Sets/src/mage/sets/commander/Fertilid.java +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -36,12 +36,15 @@ import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterBasicLandCard; +import mage.game.Game; +import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; @@ -61,7 +64,7 @@ public class Fertilid extends CardImpl { // Fertilid enters the battlefield with two +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new FertilidEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); @@ -76,3 +79,47 @@ public class Fertilid extends CardImpl { return new Fertilid(this); } } + +class FertilidEffect extends SearchLibraryPutInPlayEffect { + + public FertilidEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) { + super(target, tapped, forceShuffle); + + this.staticText = "Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library."; + } + + public FertilidEffect(final FertilidEffect effect) { + super(effect); + } + + @Override + public FertilidEffect copy() { + return new FertilidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(targetPointer.getFirst(game, source)); + + if (player != null) { + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + for (UUID cardId: target.getTargets()) { + Card card = player.getLibrary().getCard(cardId, game); + if (card != null) { + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped); + } + } + } + player.shuffleLibrary(game); + return true; + } + + if (forceShuffle) { + player.shuffleLibrary(game); + } + } + + return false; + } +} diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java index 01014677be6..6776adcc8ea 100644 --- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java @@ -45,8 +45,8 @@ import mage.target.common.TargetCardInLibrary; */ public class SearchLibraryPutInPlayEffect extends SearchEffect { - private boolean tapped; - private boolean forceShuffle; + protected boolean tapped; + protected boolean forceShuffle; public SearchLibraryPutInPlayEffect(TargetCardInLibrary target) { this(target, false, true, Outcome.PutCardInPlay); From 823002984afeb1ce9f6156dc5ff73d7f218eed57 Mon Sep 17 00:00:00 2001 From: Marshall Date: Mon, 15 Jun 2015 21:06:19 -0400 Subject: [PATCH 067/148] Discarding the effect once the land has no more flood counters --- Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index ab30e1e44f1..7aeb2332866 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -98,8 +98,10 @@ class AquitectsWillEffect extends BecomesBasicLandTargetEffect { public boolean isInactive(Ability source, Game game) { Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); if (land != null && land.getCounters().getCount(CounterType.FLOOD) < 1) { + this.discard(); return true; } + return false; } From 27880a59b4e18c81094a1db999fdc550be59f415 Mon Sep 17 00:00:00 2001 From: Marshall Date: Mon, 15 Jun 2015 21:09:12 -0400 Subject: [PATCH 068/148] Removed unused imports --- Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index 7aeb2332866..b78e153907e 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -31,12 +31,9 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; -import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; From bb4f145bb6e8b6d84512e89423d5936d43e73089 Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Fri, 12 Jun 2015 10:22:28 -0400 Subject: [PATCH 069/148] Initial work on Dreamborn Muse --- .../mage/sets/commander/DreambornMuse.java | 52 ++++++++++++++ .../src/mage/sets/legions/DreambornMuse.java | 69 +++++++++++++++++++ .../mage/sets/tenthedition/DreambornMuse.java | 52 ++++++++++++++ .../common/CardsInTargetHandCount.java | 31 +++++++++ 4 files changed, 204 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/DreambornMuse.java create mode 100644 Mage.Sets/src/mage/sets/legions/DreambornMuse.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java create mode 100644 Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java diff --git a/Mage.Sets/src/mage/sets/commander/DreambornMuse.java b/Mage.Sets/src/mage/sets/commander/DreambornMuse.java new file mode 100644 index 00000000000..93fbd3f00b2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/DreambornMuse.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.commander; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class DreambornMuse extends mage.sets.legions.DreambornMuse { + + public DreambornMuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "CMD"; + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java new file mode 100644 index 00000000000..418e75355ec --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author cbrianhill + */ +public class DreambornMuse extends CardImpl { + + public DreambornMuse(UUID ownerId) { + super(ownerId, 36, "Dreamborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutLibraryIntoGraveTargetEffect(new CardsInTargetHandCount()), TargetController.ANY, false)); + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} + +class DreambornMuseEffect { + +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java new file mode 100644 index 00000000000..5971c0c184c --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.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.tenthedition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class DreambornMuse extends mage.sets.legions.DreambornMuse { + + public DreambornMuse(UUID ownerId) { + super(ownerId); + this.cardNumber = 82; + this.expansionSetCode = "10E"; + } + + public DreambornMuse(final DreambornMuse card) { + super(card); + } + + @Override + public DreambornMuse copy() { + return new DreambornMuse(this); + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java new file mode 100644 index 00000000000..4bff7fb7995 --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java @@ -0,0 +1,31 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author cbrianhill + */ +public class CardsInTargetHandCount implements DynamicValue { + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getFirstTarget()); + return player.getHand().size(); + } + + @Override + public DynamicValue copy() { + return new CardsInTargetHandCount(); + } + + @Override + public String getMessage() { + return "cards in target player's hand"; + } + +} From b29bb5ac155d48f1d08fa3849573fb492b0e560b Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Mon, 15 Jun 2015 22:09:31 -0400 Subject: [PATCH 070/148] Finish adding Dreamborn Muse --- Mage.Sets/src/mage/sets/legions/DreambornMuse.java | 12 ++++++------ ...dCount.java => CardsInTargetPlayerHandCount.java} | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) rename Mage/src/mage/abilities/dynamicvalue/common/{CardsInTargetHandCount.java => CardsInTargetPlayerHandCount.java} (71%) diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java index 418e75355ec..15de5eceeb1 100644 --- a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java @@ -30,7 +30,7 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; +import mage.abilities.dynamicvalue.common.CardsInTargetPlayerHandCount; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -49,9 +49,13 @@ public class DreambornMuse extends CardImpl { this.subtype.add("Spirit"); this.power = new MageInt(2); this.toughness = new MageInt(2); + + PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount()); + effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand."); // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PutLibraryIntoGraveTargetEffect(new CardsInTargetHandCount()), TargetController.ANY, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false)); + } public DreambornMuse(final DreambornMuse card) { @@ -63,7 +67,3 @@ public class DreambornMuse extends CardImpl { return new DreambornMuse(this); } } - -class DreambornMuseEffect { - -} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java similarity index 71% rename from Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java rename to Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java index 4bff7fb7995..8c7807eb0db 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java @@ -10,17 +10,17 @@ import mage.players.Player; * * @author cbrianhill */ -public class CardsInTargetHandCount implements DynamicValue { +public class CardsInTargetPlayerHandCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - Player player = game.getPlayer(sourceAbility.getFirstTarget()); + Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility)); return player.getHand().size(); } @Override public DynamicValue copy() { - return new CardsInTargetHandCount(); + return new CardsInTargetPlayerHandCount(); } @Override From d195c1e207d8a83b4937b192b75d884cafb2e0b0 Mon Sep 17 00:00:00 2001 From: emerald000 Date: Tue, 16 Jun 2015 02:10:26 -0400 Subject: [PATCH 071/148] Added Conclave Naturalists, Mantle of Webs and Veteran's Sidearm. --- .../magicorigins/ConclaveNaturalists.java | 68 +++++++++++++++ .../mage/sets/magicorigins/MantleOfWebs.java | 82 +++++++++++++++++++ .../sets/magicorigins/VeteransSidearm.java | 67 +++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java b/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java new file mode 100644 index 00000000000..d7e12aefcca --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author emerald000 + */ +public class ConclaveNaturalists extends CardImpl { + + public ConclaveNaturalists(UUID ownerId) { + super(ownerId, 171, "Conclave Naturalists", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Dryad"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true); + ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + this.addAbility(ability); + } + + public ConclaveNaturalists(final ConclaveNaturalists card) { + super(card); + } + + @Override + public ConclaveNaturalists copy() { + return new ConclaveNaturalists(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java b/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java new file mode 100644 index 00000000000..5cd47e569ba --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java @@ -0,0 +1,82 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +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 emerald000 + */ +public class MantleOfWebs extends CardImpl { + + public MantleOfWebs(UUID ownerId) { + super(ownerId, 187, "Mantle of Webs", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + this.expansionSetCode = "ORI"; + 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/+3 and has reach. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield))); + Effect effect = new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA); + effect.setText("and has reach"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + } + + public MantleOfWebs(final MantleOfWebs card) { + super(card); + } + + @Override + public MantleOfWebs copy() { + return new MantleOfWebs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java b/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java new file mode 100644 index 00000000000..554ce687644 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java @@ -0,0 +1,67 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author emerald000 + */ +public class VeteransSidearm extends CardImpl { + + public VeteransSidearm(UUID ownerId) { + super(ownerId, 242, "Veteran's Sidearm", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Equipment"); + + // Equipped creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); + + // Equip {1} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1))); + } + + public VeteransSidearm(final VeteransSidearm card) { + super(card); + } + + @Override + public VeteransSidearm copy() { + return new VeteransSidearm(this); + } +} From 9ddba9802f1a09920c7a8540abd9bd1cb8fec6be Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 16 Jun 2015 08:28:06 +0200 Subject: [PATCH 072/148] [ORI] Added Hixus, Prison Warden. --- .../sets/magicorigins/HixusPrisonWarden.java | 159 ++++++++++++++++++ Mage/src/mage/abilities/AbilityImpl.java | 2 +- 2 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java new file mode 100644 index 00000000000..acdb852b8b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java @@ -0,0 +1,159 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.FlashAbility; +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.events.DamagedPlayerEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +/** + * + * @author LevelX2 + */ +public class HixusPrisonWarden extends CardImpl { + + public HixusPrisonWarden(UUID ownerId) { + super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{3}{W}{W}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(44); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield. + this.addAbility(new HixusPrisonWardenTriggeredAbility(new HixusPrisonWardenExileEffect())); + } + + public HixusPrisonWarden(final HixusPrisonWarden card) { + super(card); + } + + @Override + public HixusPrisonWarden copy() { + return new HixusPrisonWarden(this); + } +} + +class HixusPrisonWardenTriggeredAbility extends TriggeredAbilityImpl { + + public HixusPrisonWardenTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + this.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + } + + public HixusPrisonWardenTriggeredAbility(final HixusPrisonWardenTriggeredAbility ability) { + super(ability); + } + + @Override + public HixusPrisonWardenTriggeredAbility copy() { + return new HixusPrisonWardenTriggeredAbility(this); + } + + @Override + public boolean checkInterveningIfClause(Game game) { + MageObject mageObject = getSourceObject(game); + return (mageObject instanceof Permanent) && ((Permanent)mageObject).getTurnsOnBattlefield() ==1; + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent sourcePermanent = game.getPermanent(event.getSourceId()); + if (damageEvent.getPlayerId().equals(getControllerId()) && + damageEvent.isCombatDamage() && + sourcePermanent != null && + sourcePermanent.getCardType().contains(CardType.CREATURE)) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever a creature deals combat damage to you, if {this} entered the battlefield this turn, exile that creature until {this} leaves the battlefield."; + } + +} + +class HixusPrisonWardenExileEffect extends OneShotEffect { + + public HixusPrisonWardenExileEffect() { + super(Outcome.Benefit); + this.staticText = "exile that creature until {this} leaves the battlefield"; + } + + public HixusPrisonWardenExileEffect(final HixusPrisonWardenExileEffect effect) { + super(effect); + } + + @Override + public HixusPrisonWardenExileEffect copy() { + return new HixusPrisonWardenExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + // If Prison Warden leaves the battlefield before its triggered ability resolves, + // the target creature won't be exiled. + if (permanent != null) { + return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source); + } + return false; + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index c7bbd061e53..bfc6bcd22bd 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -329,7 +329,7 @@ public abstract class AbilityImpl implements Ability { // and/or zones become the target of a spell trigger at this point; they'll wait to be put on // the stack until the spell has finished being cast.) - if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already TriggeredAbilities.checkTriggers() + if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already in playerImpl.triggerAbility sourceObject.adjustTargets(this, game); } if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { From f075e78967f6f96aa9b735e73adc2001139ef52b Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 16 Jun 2015 12:41:54 +0300 Subject: [PATCH 073/148] Implement cards: Errantry, Llanowar Empath, Soul Snare, and Sprite Noble --- .../src/mage/sets/commander/SoulSnare.java | 117 ++++++++++++++++++ .../src/mage/sets/fifthedition/Errantry.java | 53 ++++++++ .../mage/sets/futuresight/LlanowarEmpath.java | 113 +++++++++++++++++ Mage.Sets/src/mage/sets/iceage/Errantry.java | 53 ++++++++ .../mage/sets/masterseditionii/Errantry.java | 79 ++++++++++++ .../src/mage/sets/timespiral/SpriteNoble.java | 83 +++++++++++++ 6 files changed, 498 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/commander/SoulSnare.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/Errantry.java create mode 100644 Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java create mode 100644 Mage.Sets/src/mage/sets/iceage/Errantry.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/Errantry.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java diff --git a/Mage.Sets/src/mage/sets/commander/SoulSnare.java b/Mage.Sets/src/mage/sets/commander/SoulSnare.java new file mode 100644 index 00000000000..bd09b426142 --- /dev/null +++ b/Mage.Sets/src/mage/sets/commander/SoulSnare.java @@ -0,0 +1,117 @@ +/* + * 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.commander; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.combat.CombatGroup; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class SoulSnare extends CardImpl { + + public SoulSnare(UUID ownerId) { + super(ownerId, 32, "Soul Snare", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "CMD"; + + // {W}, Sacrifice Soul Snare: Exile target creature that's attacking you or a planeswalker you control. + Effect effect = new ExileTargetEffect(); + effect.setText("Exile target creature that's attacking you or a planeswalker you control."); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new SoulSnareTarget()); + this.addAbility(ability); + } + + public SoulSnare(final SoulSnare card) { + super(card); + } + + @Override + public SoulSnare copy() { + return new SoulSnare(this); + } +} + +class SoulSnareTarget extends TargetCreaturePermanent { + + public SoulSnareTarget() { + super(); + } + + public SoulSnareTarget(final SoulSnareTarget target) { + super(target); + } + + @Override + public SoulSnareTarget copy() { + return new SoulSnareTarget(this); + } + + @Override + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + if(!super.canTarget(controllerId, id, source, game)) { + return false; + } + + for(CombatGroup group : game.getCombat().getGroups()) { + for(UUID attacker : group.getAttackers()) { + if(attacker.equals(id)) { + UUID defenderId = group.getDefenderId(); + if(defenderId.equals(controllerId)) { + return true; + } + else { + Permanent permanent = game.getPermanent(defenderId); + if(permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) + && permanent.getControllerId().equals(controllerId)) { + return true; + } + } + } + } + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Errantry.java b/Mage.Sets/src/mage/sets/fifthedition/Errantry.java new file mode 100644 index 00000000000..2c8cec04d91 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Errantry.java @@ -0,0 +1,53 @@ +/* + * 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 Errantry extends mage.sets.masterseditionii.Errantry { + + public Errantry(UUID ownerId) { + super(ownerId); + this.cardNumber = 224; + this.expansionSetCode = "5ED"; + } + + public Errantry(final Errantry card) { + super(card); + } + + @Override + public Errantry copy() { + return new Errantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java new file mode 100644 index 00000000000..d736ece2f8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java @@ -0,0 +1,113 @@ +/* + * 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.futuresight; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LoneFox + + */ +public class LlanowarEmpath extends CardImpl { + + public LlanowarEmpath(UUID ownerId) { + super(ownerId, 130, "Llanowar Empath", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "FUT"; + this.subtype.add("Elf"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Llanowar Empath enters the battlefield, scry 2, then reveal the top card of your library. If it's a creature card, put it into your hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ScryEffect(2)); + ability.addEffect(new LlanowarEmpathEffect()); + this.addAbility(ability); + } + + public LlanowarEmpath(final LlanowarEmpath card) { + super(card); + } + + @Override + public LlanowarEmpath copy() { + return new LlanowarEmpath(this); + } +} + +class LlanowarEmpathEffect extends OneShotEffect { + + public LlanowarEmpathEffect() { + super(Outcome.Benefit); + this.staticText = "reveal the top card of your library. If it's a creature card, put it into your hand."; + } + + public LlanowarEmpathEffect(final LlanowarEmpathEffect effect) { + super(effect); + } + + @Override + public LlanowarEmpathEffect copy() { + return new LlanowarEmpathEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = game.getObject(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); + if(controller == null || sourceObject == null) { + return false; + } + Cards cards = new CardsImpl(); + Card card = controller.getLibrary().getFromTop(game); + if(card != null) { + cards.add(card); + controller.revealCards(sourceObject.getName(), cards, game); + if(card.getCardType().contains(CardType.CREATURE)) { + card.moveToZone(Zone.HAND, source.getSourceId(), game, true); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Errantry.java b/Mage.Sets/src/mage/sets/iceage/Errantry.java new file mode 100644 index 00000000000..72fe3f5d1dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Errantry.java @@ -0,0 +1,53 @@ +/* + * 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.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + + */ +public class Errantry extends mage.sets.masterseditionii.Errantry { + + public Errantry(UUID ownerId) { + super(ownerId); + this.cardNumber = 183; + this.expansionSetCode = "ICE"; + } + + public Errantry(final Errantry card) { + super(card); + } + + @Override + public Errantry copy() { + return new Errantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java new file mode 100644 index 00000000000..923902b513c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.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.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.CanAttackOnlyAloneAbility; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +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 Errantry extends CardImpl { + + public Errantry(UUID ownerId) { + super(ownerId, 124, "Errantry", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +3/+0 and can only attack alone. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(CanAttackOnlyAloneAbility.getInstance(), AttachmentType.AURA))); + } + + public Errantry(final Errantry card) { + super(card); + } + + @Override + public Errantry copy() { + return new Errantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java b/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java new file mode 100644 index 00000000000..325cae7b656 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java @@ -0,0 +1,83 @@ +/* + * 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.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.FlyingAbility; +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; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + + */ +public class SpriteNoble extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control with flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SpriteNoble(UUID ownerId) { + super(ownerId, 81, "Sprite Noble", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Faerie"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Other creatures you control with flying get +0/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, filter, true))); + // {tap}: Other creatures you control with flying get +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter, true), + new TapSourceCost())); + } + + public SpriteNoble(final SpriteNoble card) { + super(card); + } + + @Override + public SpriteNoble copy() { + return new SpriteNoble(this); + } +} From d8df53dde74897c2db4a1d19e77c0903d926a940 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 16 Jun 2015 14:41:28 +0200 Subject: [PATCH 074/148] Added some tests. --- .../abilities/activated/ReturnToHandTest.java | 43 ++++++++++++++- .../abilities/keywords/LandfallTest.java | 55 ++++++++++++++++++- .../common/FilterCreatureForCombatBlock.java | 3 - 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java index 7d4ea0d43cd..9864c33cfdb 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java @@ -73,5 +73,46 @@ public class ReturnToHandTest extends CardTestPlayerBase { } + /** + * Return from graveyard to hand if you play a swamp + */ + @Test + public void VeilbornGhoulTest1() { + // Veilborn Ghoul can't block. + // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. + addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul"); + addCard(Zone.HAND, playerA, "Swamp"); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + execute(); + + assertPermanentCount(playerA, "Swamp", 1); + assertHandCount(playerA, "Veilborn Ghoul", 1); + + } + /** + * Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play + */ + @Test + public void VeilbornGhoulTest2() { + // Veilborn Ghoul can't block. + // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand. + addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul"); + addCard(Zone.HAND, playerA, "Flood Plain"); + + // Each land is a Swamp in addition to its other land types. + addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + execute(); + + assertPermanentCount(playerA, "Flood Plain", 1); + assertHandCount(playerA, "Veilborn Ghoul", 1); + + } -} \ No newline at end of file +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java index 0f4ab1f663b..5e3b1b177cc 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java @@ -146,5 +146,58 @@ public class LandfallTest extends CardTestPlayerBase { assertGraveyardCount(playerB, "Silvercoat Lion" , 1); } - + + @Test + public void testGroundswellWithoutLandfall() { + // Target creature gets +2/+2 until end of turn. + //Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead. + addCard(Zone.HAND, playerB, "Groundswell",1); + addCard(Zone.BATTLEFIELD, playerB, "Forest",1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); + + attack(2, playerB, "Silvercoat Lion"); + castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion"); + + + setStopAt(2, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerB, "Forest", 1); + assertGraveyardCount(playerB, "Groundswell" , 1); + + assertPermanentCount(playerB, "Silvercoat Lion" , 1); + assertPowerToughness(playerB, "Silvercoat Lion", 4, 4); + + assertLife(playerA, 16); // 2 + 4 + assertLife(playerB, 20); + } + + @Test + public void testGroundswellWithLandfall() { + // Target creature gets +2/+2 until end of turn. + //Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead. + addCard(Zone.HAND, playerB, "Groundswell",1); + addCard(Zone.HAND, playerB, "Forest"); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); + + + playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest"); + attack(2, playerB, "Silvercoat Lion"); + castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion"); + + + setStopAt(2, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerB, "Forest", 1); + assertGraveyardCount(playerB, "Groundswell" , 1); + + assertPermanentCount(playerB, "Silvercoat Lion" , 1); + assertPowerToughness(playerB, "Silvercoat Lion", 6, 6); + + assertLife(playerA, 14); // 2 + 4 + assertLife(playerB, 20); + } } diff --git a/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java b/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java index d8ad11777f9..fc9bb9edbfc 100644 --- a/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java +++ b/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java @@ -29,10 +29,7 @@ package mage.filter.common; import mage.constants.AsThoughEffectType; -import mage.filter.predicate.ObjectPlayer; -import mage.filter.predicate.ObjectPlayerPredicate; import mage.filter.predicate.Predicate; -import mage.game.Controllable; import mage.game.Game; import mage.game.permanent.Permanent; From 27929cccba295507763a88531c0c575c58531d1c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 16 Jun 2015 17:01:15 +0200 Subject: [PATCH 075/148] Added handling to make it possible that a transformable card can enter the battlefield transformed. --- .../conditional/twofaced/TwoFacedCardEffectsTest.java | 6 ++++++ Mage/src/mage/abilities/keyword/TransformAbility.java | 3 +++ Mage/src/mage/game/permanent/PermanentCard.java | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java index 4628fd55c10..69bd3a726a7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java @@ -18,6 +18,12 @@ public class TwoFacedCardEffectsTest extends CardTestPlayerBase { */ @Test public void testEffectTurnedOffOnTransform() { + // Other Human creatures you control get +1/+1. + // At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck. + // Howlpack Alpha (transformed side) ---------------- + // Each other creature you control that's a Werewolf or a Wolf gets +1/+1. + // At the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield. + // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack Alpha. addCard(Zone.BATTLEFIELD, playerA, "Mayor of Avabruck"); addCard(Zone.BATTLEFIELD, playerA, "Wolfir Avenger"); addCard(Zone.BATTLEFIELD, playerA, "Elite Inquisitor"); diff --git a/Mage/src/mage/abilities/keyword/TransformAbility.java b/Mage/src/mage/abilities/keyword/TransformAbility.java index 9b01d319c02..1d36731553d 100644 --- a/Mage/src/mage/abilities/keyword/TransformAbility.java +++ b/Mage/src/mage/abilities/keyword/TransformAbility.java @@ -44,6 +44,9 @@ public class TransformAbility extends SimpleStaticAbility { public static final String NO_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if no spells were cast last turn, transform {this}."; public static final String TWO_OR_MORE_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}."; + // this state value controlls if a permanent enters the battlefield already transformed + public static final String VALUE_KEY_ENTER_TRANSFORMED = "EnterTransformed"; + public TransformAbility() { super(Zone.BATTLEFIELD, new TransformEffect()); } diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index c6994cb72ed..af54c92b1dc 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -33,6 +33,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.keyword.TransformAbility; import mage.cards.Card; import mage.cards.LevelerCard; import mage.constants.Zone; @@ -65,6 +66,13 @@ public class PermanentCard extends PermanentImpl { if (card instanceof LevelerCard) { maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters(); } + if (canTransform()) { + if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null); + setTransformed(true); + TransformAbility.transform(this, getSecondCardFace(), game); + } + } } public PermanentCard(final PermanentCard permanent) { From a3dc7b6691d688ae8fe147505d6b808488b9be63 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 16 Jun 2015 17:01:56 +0200 Subject: [PATCH 076/148] [ORI] Added Nissa Sage Animist (coded by Emerald). --- .../sets/magicorigins/NissaSageAnimist.java | 198 ++++++++++++++++++ .../sets/magicorigins/NissaVastwoodSeer.java | 130 ++++++++++++ .../abilities/keywords/TransformTest.java | 68 ++++++ 3 files changed, 396 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java new file mode 100644 index 00000000000..ff93fac4615 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java @@ -0,0 +1,198 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.players.Player; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author emerald000 + */ +public class NissaSageAnimist extends CardImpl { + + public NissaSageAnimist(UUID ownerId) { + super(ownerId, 189, "Nissa, Sage Animist", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, ""); + this.expansionSetCode = "ORI"; + this.subtype.add("Nissa"); + this.color.setGreen(true); + + this.nightCard = true; + this.canTransform = true; + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + + // +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand. + this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1)); + + // -2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new NissaSageAnimistToken()), -2)); + + // -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands. + Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7); + ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false)); + ability.addEffect(new NissaSageAnimistMinusSevenEffect()); + this.addAbility(ability); + } + + public NissaSageAnimist(final NissaSageAnimist card) { + super(card); + } + + @Override + public NissaSageAnimist copy() { + return new NissaSageAnimist(this); + } +} + +class NissaSageAnimistPlusOneEffect extends OneShotEffect { + + NissaSageAnimistPlusOneEffect() { + super(Outcome.Benefit); + this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand."; + } + + NissaSageAnimistPlusOneEffect(final NissaSageAnimistPlusOneEffect effect) { + super(effect); + } + + @Override + public NissaSageAnimistPlusOneEffect copy() { + return new NissaSageAnimistPlusOneEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + if (card == null) { + return false; + } + CardsImpl cards = new CardsImpl(); + cards.add(card); + controller.revealCards("Nissa, Sage Animist", cards, game); + if (card.getCardType().contains(CardType.LAND)) { + return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + } else { + return controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game); + } + } + return true; + } +} + +class NissaSageAnimistToken extends Token { + + NissaSageAnimistToken() { + super("Ashaya, the Awoken World", "legendary 4/4 green Elemental creature token named Ashaya, the Awoken World"); + this.setOriginalExpansionSetCode("ORI"); + this.getSupertype().add("Legendary"); + this.getPower().initValue(4); + this.getToughness().initValue(4); + this.color.setGreen(true); + this.getSubtype().add("Elemental"); + this.getCardType().add(CardType.CREATURE); + } +} + +class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl { + + NissaSageAnimistMinusSevenEffect() { + super(Duration.EndOfGame, Outcome.BecomeCreature); + this.staticText = "They become 6/6 Elemental creatures. They're still lands"; + } + + NissaSageAnimistMinusSevenEffect(final NissaSageAnimistMinusSevenEffect effect) { + super(effect); + } + + @Override + public NissaSageAnimistMinusSevenEffect copy() { + return new NissaSageAnimistMinusSevenEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (UUID permanentId : this.getTargetPointer().getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null) { + switch (layer) { + case TypeChangingEffects_4: + if (!permanent.getCardType().contains(CardType.CREATURE)) { + permanent.getCardType().add(CardType.CREATURE); + } + if (!permanent.getSubtype().contains("Elemental")) { + permanent.getSubtype().add("Elemental"); + } + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getToughness().setValue(6); + permanent.getPower().setValue(6); + } + } + } + } + return true; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java new file mode 100644 index 00000000000..22ef98bc763 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java @@ -0,0 +1,130 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author emerald000 + */ +public class NissaVastwoodSeer extends CardImpl { + + private static final FilterCard filter = new FilterCard("basic Forest card"); + static { + filter.add(new SupertypePredicate("Basic")); + filter.add(new SubtypePredicate("Forest")); + } + + public NissaVastwoodSeer(UUID ownerId) { + super(ownerId, 189, "Nissa, Vastwood Seer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Elf"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + this.canTransform = true; + this.secondSideCard = new NissaSageAnimist(ownerId); + + // When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true), true)); + + // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. + this.addAbility(new TransformAbility()); + this.addAbility(new ConditionalTriggeredAbility( + new EntersBattlefieldControlledTriggeredAbility(new NissaVastwoodSeerTransformEffect(), new FilterLandPermanent()), + new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true), + "Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control.")); + } + + public NissaVastwoodSeer(final NissaVastwoodSeer card) { + super(card); + } + + @Override + public NissaVastwoodSeer copy() { + return new NissaVastwoodSeer(this); + } +} + +class NissaVastwoodSeerTransformEffect extends OneShotEffect { + + NissaVastwoodSeerTransformEffect() { + super(Outcome.Benefit); + this.staticText = "exile {this}, then return her to the battlefield transformed under her owner's control"; + } + + NissaVastwoodSeerTransformEffect(final NissaVastwoodSeerTransformEffect effect) { + super(effect); + } + + @Override + public NissaVastwoodSeerTransformEffect copy() { + return new NissaVastwoodSeerTransformEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + Player controller = game.getPlayer(source.getControllerId()); + if (sourceObject != null && controller != null) { + Card card = (Card) sourceObject; + if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); + controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + } + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java new file mode 100644 index 00000000000..1aa83fc7929 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.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 org.mage.test.cards.abilities.keywords; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class TransformTest extends CardTestPlayerBase{ + + @Test + public void NissaVastwoodSeerTest() { + + addCard(Zone.LIBRARY, playerA, "Forest"); + + addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); + // When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library. + // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. + + addCard(Zone.HAND, playerA, "Nissa, Vastwood Seer"); + + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer"); + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Forest", 7); + + assertPermanentCount(playerA, "Nissa, Vastwood Seer", 0); + assertPermanentCount(playerA, "Nissa, Sage Animist", 1); + assertCounterCount("Nissa, Sage Animist", CounterType.LOYALTY, 3); + } + +} \ No newline at end of file From c987ae7a21920f75acb2c5bf5f342868feb94d44 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 00:54:26 +0200 Subject: [PATCH 077/148] [ORI] Added Grasp of the Hieromancer and Heavy Infantry. --- .../magicorigins/GraspOfTheHieromancer.java | 138 ++++++++++++++++++ .../mage/sets/magicorigins/HeavyInfantry.java | 77 ++++++++++ .../sets/riseoftheeldrazi/SnakeUmbra.java | 9 +- 3 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java new file mode 100644 index 00000000000..811fabbf54a --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java @@ -0,0 +1,138 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GraspOfTheHieromancer extends CardImpl { + + public GraspOfTheHieromancer(UUID ownerId) { + super(ownerId, 15, "Grasp of the Hieromancer", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); + this.expansionSetCode = "ORI"; + 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 and has "Whenever this creature attacks, tap target creature defending player controls." + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new GraspOfTheHieromancerTriggeredAbility(new TapTargetEffect(), false); + gainedAbility.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls"))); + Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); + effect.setText("and has \"Whenever this creature attacks, tap target creature defending player controls.\""); + ability.addEffect(effect); + this.addAbility(ability); + + } + + public GraspOfTheHieromancer(final GraspOfTheHieromancer card) { + super(card); + } + + @Override + public GraspOfTheHieromancer copy() { + return new GraspOfTheHieromancer(this); + } +} + +class GraspOfTheHieromancerTriggeredAbility extends TriggeredAbilityImpl { + + + + public GraspOfTheHieromancerTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public GraspOfTheHieromancerTriggeredAbility(final GraspOfTheHieromancerTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (game.getCombat().getAttackers().contains(getSourceId()) ) { + UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game); + if (defendingPlayerId != null) { + this.getTargets().clear(); + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); + UUID defenderId = game.getCombat().getDefenderId(getSourceId()); + filter.add(new ControllerIdPredicate(defenderId)); + TargetCreaturePermanent target = new TargetCreaturePermanent(filter); + this.addTarget(target); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks, tap target creature defending player controls."; + } + + @Override + public GraspOfTheHieromancerTriggeredAbility copy() { + return new GraspOfTheHieromancerTriggeredAbility(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java new file mode 100644 index 00000000000..5640bfc4bc4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java @@ -0,0 +1,77 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class HeavyInfantry extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public HeavyInfantry(UUID ownerId) { + super(ownerId, 18, "Heavy Infantry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Heavy Infantry enters the battlefield, tap target creature an opponent controls. + Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public HeavyInfantry(final HeavyInfantry card) { + super(card); + } + + @Override + public HeavyInfantry copy() { + return new HeavyInfantry(this); + } +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java index 45efa75b0a4..5daad05f235 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; @@ -54,7 +55,6 @@ public class SnakeUmbra extends CardImpl { this.expansionSetCode = "ROE"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -63,11 +63,14 @@ public class SnakeUmbra extends CardImpl { this.addAbility(ability); // Enchanted creature gets +1/+1 - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)); // and has "Whenever this creature deals damage to an opponent, you may draw a card." Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA); + effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\""); + ability.addEffect(effect); + this.addAbility(ability); // Totem armor this.addAbility(new TotemArmorAbility()); From ae2eb8bb5022b603fe0bc41a252e33e4968f1d78 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 00:57:28 +0200 Subject: [PATCH 078/148] Minor changes to Dreamborn Muse. --- Mage.Sets/src/mage/sets/legions/DreambornMuse.java | 3 +-- .../dynamicvalue/common/CardsInTargetPlayerHandCount.java | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java index 15de5eceeb1..f2e6b86c256 100644 --- a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java +++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java @@ -50,10 +50,9 @@ public class DreambornMuse extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); + // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount()); effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand."); - - // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand. this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false)); } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java index 8c7807eb0db..27bab074560 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java @@ -15,7 +15,10 @@ public class CardsInTargetPlayerHandCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility)); - return player.getHand().size(); + if (player != null) { + return player.getHand().size(); + } + return 0; } @Override From 568ab914ab7872446ac9ef59f403bc5ebeb67939 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 08:07:00 +0200 Subject: [PATCH 079/148] [ORI] Updated mtg-cards-data.txt (84 cards). --- Utils/mtg-cards-data.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index a2209b00837..8073fae95d8 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -26196,6 +26196,8 @@ Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Ta Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."| Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.| Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.| +Gideon, Battle-Forged|Magic Origins|023|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| +Kytheon, Hero of Akros|Magic Origins|23|M|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.| Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance (Attacking doesn't cause this creature to tap.)$At the beginning of combat on each opponent's turn, tap target creature that player controls.| Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.| @@ -26235,8 +26237,10 @@ Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Fly Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.| Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| +Chandra's Ignition|Magic Origins|?|R|{3}{R}{R}{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.$Target creature you control deals damage equal to its power to each other creature and each opponent.| Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2|| Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.| +Ravaging Blaze|Magic Origins|?|U|{X}{R}{R}{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.$Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.| Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.| Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.| From e934640b5d7c4a2554cea2d592c447bbef9e754b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 14:54:57 +0200 Subject: [PATCH 080/148] * Tectonic Edge - Fixed that the number of lands condition was checked as a sum of all opponents instead of a separate check for each opponent on its own. --- .../OpponentControlsPermanentCondition.java | 75 ++++++++----------- 1 file changed, 30 insertions(+), 45 deletions(-) diff --git a/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java b/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java index dfb0f89be91..efb94d0c482 100644 --- a/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java +++ b/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java @@ -28,31 +28,29 @@ package mage.abilities.condition.common; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.condition.Condition; -import mage.constants.TargetController; import mage.filter.FilterPermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; /** - * + * Checks if one opponent (each opponent is checked on its own) fulfills + * the defined condition of controlling the defined number of permanents. + * * @author LevelX2 */ public class OpponentControlsPermanentCondition implements Condition { public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO }; + private FilterPermanent filter; - private Condition condition; private CountType type; private int count; /** - * Applies a filter and delegates creation to - * {@link #ControlsPermanent(mage.filter.FilterPermanent, mage.abilities.condition.common.ControlsPermanent.CountType, int)} - * with {@link CountType#MORE_THAN}, and 0. - * * @param filter */ public OpponentControlsPermanentCondition(FilterPermanent filter) { @@ -74,46 +72,33 @@ public class OpponentControlsPermanentCondition implements Condition { this.count = count; } - /** - * Applies a filter, a {@link CountType}, and count to permanents on the - * battlefield and calls the decorated condition to see if it - * {@link #apply(mage.game.Game, mage.abilities.Ability) applies} - * as well. This will force both conditions to apply for this to be true. - * - * @param filter - * @param type - * @param count - * @param conditionToDecorate - */ - public OpponentControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, Condition conditionToDecorate ) { - this(filter, type, count); - this.condition = conditionToDecorate; - } - @Override public boolean apply(Game game, Ability source) { - boolean conditionApplies = false; - - FilterPermanent localFilter = filter.copy(); - localFilter.add(new ControllerPredicate(TargetController.OPPONENT)); - - switch ( this.type ) { - case FEWER_THAN: - conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count; - break; - case MORE_THAN: - conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count; - break; - case EQUAL_TO: - conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count; - break; + boolean conditionApplies = false; + for(UUID opponentId :game.getOpponents(source.getControllerId())) { + FilterPermanent localFilter = filter.copy(); + localFilter.add(new ControllerIdPredicate(opponentId)); + switch ( this.type ) { + case FEWER_THAN: + if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count) { + conditionApplies = true; + break; + } + case MORE_THAN: + if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count) { + conditionApplies = true; + break; + } + break; + case EQUAL_TO: + if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count) { + conditionApplies = true; + break; + } + break; + } + } - - //If a decorated condition exists, check it as well and apply them together. - if ( this.condition != null ) { - conditionApplies = conditionApplies && this.condition.apply(game, source); - } - return conditionApplies; } From 9882948a069783ef3a41be474f94a2e511ff6d92 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 16:15:44 +0200 Subject: [PATCH 081/148] * Splice on Arcane - Fixed that if a player used an alternate cost to cast the arcane spell (e.g. Nourishing Shoal) splice mana costs were also removed. --- .../java/mage/player/ai/ComputerPlayer.java | 2 +- .../keywords/SpliceOnArcaneTest.java | 144 ++++++++++++++++++ .../keyword/SpliceOntoArcaneAbility.java | 15 +- 3 files changed, 148 insertions(+), 13 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 49399a7889b..1ba65e80b42 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -507,7 +507,7 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (target instanceof TargetDiscard || target instanceof TargetCardInHand) { if (outcome.isGood()) { ArrayList cardsInHand = new ArrayList<>(hand.getCards(game)); - while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() < target.getTargets().size()) { + while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() > target.getTargets().size()) { Card card = pickBestCard(cardsInHand, null, target, source, game); if (card != null) { if (target.canTarget(card.getId(), source, game)) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java new file mode 100644 index 00000000000..6eff8eaae26 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java @@ -0,0 +1,144 @@ +/* + * 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.abilities.keywords; + +import mage.abilities.keyword.HasteAbility; +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class SpliceOnArcaneTest extends CardTestPlayerBase { + + /** + * Test that it works to cast Through the Breach + * by slicing it on an arcane spell + * + */ + @Test + public void testSpliceThroughTheBreach() { + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + // Sorcery - Arcane {R} + // Lava Spike deals 3 damage to target player. + addCard(Zone.HAND, playerA, "Lava Spike",1); + // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. + // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) + addCard(Zone.HAND, playerA, "Through the Breach",1); + addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB); + setChoice(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + assertGraveyardCount(playerA, "Lava Spike", 1); + assertHandCount(playerA, "Through the Breach", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true); + Assert.assertEquals("All available mana has to be used", 0, playerA.getManaAvailable(currentGame).size()); + } + + @Test + public void testSpliceTorrentOfStone() { + + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); + // Sorcery - Arcane {R} + // Lava Spike deals 3 damage to target player. + addCard(Zone.HAND, playerA, "Lava Spike",1); + // Torrent of Stone deals 4 damage to target creature. + // Splice onto Arcane-Sacrifice two Mountains. (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) + addCard(Zone.HAND, playerA, "Torrent of Stone",1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB); + addTarget(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 17); + + assertGraveyardCount(playerA, "Lava Spike", 1); + assertHandCount(playerA, "Torrent of Stone", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Mountain", 0); + Assert.assertEquals("No more mana available", "[]", playerA.getManaAvailable(currentGame).toString()); + } + /** + * Nourishing Shoal's interaction with Splicing Through the Breach is + * bugged. You should still need to pay 2RR as an additional cost, which is + * not affected by the alternate casting method of Shoal, but you are able + * to Splice it for free. This is a very relevant bug right now due to the + * appearance of the deck over the weekend, and it makes the deck absurdly + * powerful. + */ + @Test + public void testSpliceThroughTheBreach2() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + // You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost. + // You gain X life. + addCard(Zone.HAND, playerA, "Nourishing Shoal",1); + addCard(Zone.HAND, playerA, "Giant Growth",1); + // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. + // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.) + addCard(Zone.HAND, playerA, "Through the Breach",1); + addCard(Zone.HAND, playerA, "Silvercoat Lion",1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nourishing Shoal"); + setChoice(playerA, "Yes"); + setChoice(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertLife(playerA, 21); + assertLife(playerB, 20); + + assertGraveyardCount(playerA, "Nourishing Shoal", 1); + assertHandCount(playerA, "Through the Breach", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true); + + Assert.assertEquals("All available mana has to be used","[]", playerA.getManaAvailable(currentGame).toString()); + } + + +} diff --git a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java index 92d7ee0474c..06d6c201bf1 100644 --- a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java +++ b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java @@ -38,7 +38,6 @@ import mage.abilities.costs.CostsImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.SpliceCardEffectImpl; import mage.cards.Card; -import mage.cards.CardsImpl; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SpellAbilityType; @@ -105,12 +104,12 @@ import mage.players.Player; public class SpliceOntoArcaneAbility extends SimpleStaticAbility { private static final String KEYWORD_TEXT = "Splice onto Arcane"; - private Costs spliceCosts = new CostsImpl(); + private Costs spliceCosts = new CostsImpl<>(); private boolean nonManaCosts = false; public SpliceOntoArcaneAbility(String manaString) { super(Zone.HAND, new SpliceOntoArcaneEffect()); - spliceCosts.add(new ManaCostsImpl(manaString)); + spliceCosts.add(new ManaCostsImpl<>(manaString)); } public SpliceOntoArcaneAbility(Cost cost) { @@ -144,7 +143,6 @@ public class SpliceOntoArcaneAbility extends SimpleStaticAbility { } } - class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { public SpliceOntoArcaneEffect() { @@ -156,8 +154,6 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { super(effect); } - - @Override public SpliceOntoArcaneEffect copy() { return new SpliceOntoArcaneEffect(this); @@ -175,12 +171,7 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { splicedAbility.setSourceId(abilityToModify.getSourceId()); spell.addSpellAbility(splicedAbility); for (Iterator it = ((SpliceOntoArcaneAbility) source).getSpliceCosts().iterator(); it.hasNext();) { - Cost cost = (Cost) it.next(); - if (cost instanceof ManaCostsImpl) { - spell.getSpellAbility().getManaCostsToPay().add((ManaCostsImpl) cost.copy()); - } else { - spell.getSpellAbility().getCosts().add(cost.copy()); - } + spell.getSpellAbility().getCosts().add(((Cost) it.next()).copy()); } } return true; From 68a0782e30e5577b5fb1f1d2913e38fd1cfd005c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 17:41:20 +0200 Subject: [PATCH 082/148] Added a test. --- .../sets/zendikar/PyromancerAscension.java | 20 ++++++---- .../cards/abilities/keywords/StormTest.java | 37 ++++++++++++++++++- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java index dc5f38f7122..5eb3676dc2a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java @@ -38,14 +38,10 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.FilterSpell; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.game.stack.Spell; -import mage.target.TargetSpell; import mage.target.targetpointer.FixedTarget; /** @@ -91,9 +87,14 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { return new PyromancerAscensionQuestTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (isControlledInstantOrSorcery(spell)) { Card sourceCard = game.getCard(spell.getSourceId()); @@ -138,10 +139,15 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl { public PyromancerAscensionCopyTriggeredAbility copy() { return new PyromancerAscensionCopyTriggeredAbility(this); } - + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (isControlledInstantOrSorcery(spell)) { Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java index 9157c8dfa34..6caa1dcf763 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java @@ -30,6 +30,7 @@ package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; import mage.constants.Zone; +import mage.counters.CounterType; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -163,5 +164,39 @@ public class StormTest extends CardTestPlayerBase { assertLife(playerB, 16); // 3 (Lightning Bolt) + 1 from Storm copied Grapeshot } - + + /** + * I provide a game log fo the issue with storm mentioned earlier. I guess Pyromancer Ascension is a culprit. + * + * + */ + @Test + public void testStormAndPyromancerAscension() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5); + addCard(Zone.BATTLEFIELD, playerA, "Island", 1); + // Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on Pyromancer Ascension. + // Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy. + addCard(Zone.BATTLEFIELD, playerA, "Pyromancer Ascension", 1); + // Grapeshot deals 1 damage to target creature or player. - Sorcery {1}{R} + // Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.) + addCard(Zone.LIBRARY, playerA, "Grapeshot", 2); + skipInitShuffling(); + // Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library. + addCard(Zone.HAND, playerA, "Sleight of Hand"); + addCard(Zone.HAND, playerA, "Shock", 3); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sleight of Hand"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", playerB); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grapeshot", playerB); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Shock", 3); + assertGraveyardCount(playerA, "Grapeshot", 1); + assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2); + assertLife(playerB, 8); // 6 from the Shocks + 5 from Grapeshot + 1 from Pyromancer Ascencsion copy + } } From 3695ffdc46699fce2ac36094ab727777f9d723a5 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 17 Jun 2015 18:44:24 +0300 Subject: [PATCH 083/148] Fix Soul Snare. Its targeting restriction could be implemented as a filter after all... --- .../src/mage/sets/commander/SoulSnare.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander/SoulSnare.java b/Mage.Sets/src/mage/sets/commander/SoulSnare.java index bd09b426142..fae8a7edbdf 100644 --- a/Mage.Sets/src/mage/sets/commander/SoulSnare.java +++ b/Mage.Sets/src/mage/sets/commander/SoulSnare.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; import mage.game.Game; import mage.game.combat.CombatGroup; import mage.game.permanent.Permanent; @@ -59,7 +60,7 @@ public class SoulSnare extends CardImpl { effect.setText("Exile target creature that's attacking you or a planeswalker you control."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}")); ability.addCost(new SacrificeSourceCost()); - ability.addTarget(new SoulSnareTarget()); + ability.addTarget(new TargetCreaturePermanent(new SoulSnareFilter())); this.addAbility(ability); } @@ -73,38 +74,39 @@ public class SoulSnare extends CardImpl { } } -class SoulSnareTarget extends TargetCreaturePermanent { +class SoulSnareFilter extends FilterAttackingCreature { - public SoulSnareTarget() { - super(); + public SoulSnareFilter() { + super("creature that's attacking you or a planeswalker you control"); } - public SoulSnareTarget(final SoulSnareTarget target) { - super(target); + + public SoulSnareFilter(final SoulSnareFilter filter) { + super(filter); } @Override - public SoulSnareTarget copy() { - return new SoulSnareTarget(this); + public SoulSnareFilter copy() { + return new SoulSnareFilter(this); } @Override - public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { - if(!super.canTarget(controllerId, id, source, game)) { + public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { + if(!super.match(permanent, sourceId, playerId, game)) { return false; } for(CombatGroup group : game.getCombat().getGroups()) { for(UUID attacker : group.getAttackers()) { - if(attacker.equals(id)) { + if(attacker.equals(permanent.getId())) { UUID defenderId = group.getDefenderId(); - if(defenderId.equals(controllerId)) { + if(defenderId.equals(playerId)) { return true; } else { - Permanent permanent = game.getPermanent(defenderId); - if(permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) - && permanent.getControllerId().equals(controllerId)) { + Permanent planeswalker = game.getPermanent(defenderId); + if(planeswalker != null && planeswalker.getCardType().contains(CardType.PLANESWALKER) + && planeswalker.getControllerId().equals(playerId)) { return true; } } From 1a8cd32b8711c45cc6f3ff2a52f12a5344bf5c8b Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 17 Jun 2015 19:31:32 +0300 Subject: [PATCH 084/148] Implement cards: Betrayal of Flesh, Humble, Ovinize, and Sengir Nosferatu --- .../mage/sets/mirrodin/BetrayalOfFlesh.java | 80 ++++++++++ .../src/mage/sets/planarchaos/Ovinize.java | 64 ++++++++ .../mage/sets/timespiral/SengirNosferatu.java | 140 ++++++++++++++++++ Mage.Sets/src/mage/sets/urzassaga/Humble.java | 64 ++++++++ 4 files changed, 348 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java create mode 100644 Mage.Sets/src/mage/sets/planarchaos/Ovinize.java create mode 100644 Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/Humble.java diff --git a/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java b/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java new file mode 100644 index 00000000000..b947a3451f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java @@ -0,0 +1,80 @@ +/* + * 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.mirrodin; + +import java.util.UUID; +import mage.abilities.Mode; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; +import mage.abilities.keyword.EntwineAbility; +import mage.abilities.keyword.EntwineAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class BetrayalOfFlesh extends CardImpl { + + public BetrayalOfFlesh(UUID ownerId) { + super(ownerId, 58, "Betrayal of Flesh", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{5}{B}"); + this.expansionSetCode = "MRD"; + + // Choose one - + this.getSpellAbility().getModes().setMinModes(1); + this.getSpellAbility().getModes().setMaxModes(1); + // Destroy target creature; + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + // or return target creature card from your graveyard to the battlefield. + Mode mode = new Mode(); + mode.getEffects().add(new ReturnFromGraveyardToBattlefieldTargetEffect()); + mode.getTargets().add(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); + this.getSpellAbility().getModes().addMode(mode); + // Entwine-Sacrifice three lands. + this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent(), true)))); + } + + public BetrayalOfFlesh(final BetrayalOfFlesh card) { + super(card); + } + + @Override + public BetrayalOfFlesh copy() { + return new BetrayalOfFlesh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java new file mode 100644 index 00000000000..01a618d528e --- /dev/null +++ b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.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.planarchaos; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class Ovinize extends CardImpl { + + public Ovinize(UUID ownerId) { + super(ownerId, 57, "Ovinize", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}"); + this.expansionSetCode = "PLC"; + + // Target creature loses all abilities and becomes 0/1 until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)); + } + + public Ovinize(final Ovinize card) { + super(card); + } + + @Override + public Ovinize copy() { + return new Ovinize(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java new file mode 100644 index 00000000000..8f6811b51e7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java @@ -0,0 +1,140 @@ +/* + * 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.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.token.Token; +import mage.target.Target; +import mage.target.common.TargetCardInExile; + +/** + * + * @author LoneFox + + */ +public class SengirNosferatu extends CardImpl { + + public SengirNosferatu(UUID ownerId) { + super(ownerId, 128, "Sengir Nosferatu", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "TSP"; + this.subtype.add("Vampire"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {1}{B}, Exile Sengir Nosferatu: Put a 1/2 black Bat creature token with flying onto the battlefield. It has "{1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new CreateTokenEffect(new SengirNosferatuBatToken(), 1), new ManaCostsImpl("{1}{B}")); + ability.addCost(new ExileSourceCost()); + this.addAbility(ability); + } + + public SengirNosferatu(final SengirNosferatu card) { + super(card); + } + + @Override + public SengirNosferatu copy() { + return new SengirNosferatu(this); + } +} + +class SengirNosferatuBatToken extends Token { + + SengirNosferatuBatToken() { + super("Bat", "1/2 black Bat creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Bat"); + power = new MageInt(1); + toughness = new MageInt(2); + this.addAbility(FlyingAbility.getInstance()); + ReturnSengirNosferatuEffect effect = new ReturnSengirNosferatuEffect(); + effect.setText("Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control."); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } +} + +class ReturnSengirNosferatuEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("exiled card named Sengir Nosferatu"); + + static { + filter.add(new NamePredicate("Sengir Nosferatu")); + } + + public ReturnSengirNosferatuEffect() { + super(Outcome.Benefit); + } + + public ReturnSengirNosferatuEffect(final ReturnSengirNosferatuEffect effect) { + super(effect); + } + + @Override + public ReturnSengirNosferatuEffect copy() { + return new ReturnSengirNosferatuEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID controllerId = source.getControllerId(); + Target target = new TargetCardInExile(filter); + target.setNotTarget(true); + if(!target.canChoose(source.getSourceId(), controllerId, game)) { + return false; + } + game.getPlayer(controllerId).chooseTarget(Outcome.PutCreatureInPlay, target, source, game); + Card card = game.getCard(target.getTargets().get(0)); + if(card != null) { + return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Humble.java b/Mage.Sets/src/mage/sets/urzassaga/Humble.java new file mode 100644 index 00000000000..6e6642d65bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Humble.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.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + + */ +public class Humble extends CardImpl { + + public Humble(UUID ownerId) { + super(ownerId, 18, "Humble", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "USG"; + + // Target creature loses all abilities and becomes 0/1 until end of turn. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn)); + } + + public Humble(final Humble card) { + super(card); + } + + @Override + public Humble copy() { + return new Humble(this); + } +} From 2d9e5a032e6c3f2a66ddfed00e9e9675017fa577 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 21:06:07 +0200 Subject: [PATCH 085/148] * Descendants' Path - Fixed that it did not work with Chnagelling or Has all creature types abililities. --- .../sets/avacynrestored/DescendantsPath.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java b/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java index d181d91f344..a6f0e7964a5 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java @@ -27,7 +27,6 @@ */ package mage.sets.avacynrestored; -import java.util.ArrayList; import java.util.UUID; import mage.constants.CardType; @@ -42,11 +41,10 @@ import mage.cards.CardsImpl; import mage.constants.Outcome; import mage.constants.TargetController; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.Predicate; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; +import mage.util.CardUtil; /** * @@ -59,7 +57,6 @@ public class DescendantsPath extends CardImpl { super(ownerId, 173, "Descendants' Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "AVR"; - // At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library. Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false); this.addAbility(ability); @@ -93,36 +90,39 @@ class DescendantsPathEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - player.revealCards("DescendantsPath", new CardsImpl(card), game); - if (card.getCardType().contains(CardType.CREATURE)) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { + if (controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().getFromTop(game); + if (card == null) { + return false; + } + controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); + if (card.getCardType().contains(CardType.CREATURE)) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - - ArrayList> subtypes = new ArrayList<>(); - for (String subtype: card.getSubtype()) { - subtypes.add(new SubtypePredicate(subtype)); + boolean found = false; + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) { + if (CardUtil.shareSubtypes(card, permanent)) { + found = true; + break; + } } - filter.add(Predicates.or(subtypes)); - - int count = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game).size(); - if (count > 0) { - game.informPlayers("DescendantsPath: Found a creature that shares a creature type with the revealed card."); - if (player.chooseUse(Outcome.Benefit, "Cast the card?", game)) { - player.cast(card.getSpellAbility(), game, true); + if (found) { + game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card."); + if (controller.chooseUse(Outcome.Benefit, "Cast the card?", game)) { + controller.cast(card.getSpellAbility(), game, true); } else { - game.informPlayers("DescendantsPath: " + player.getLogName() + " canceled casting the card."); - player.getLibrary().putOnBottom(card, game); + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card."); + controller.getLibrary().putOnBottom(card, game); } } else { - game.informPlayers("DescendantsPath: No creature that shares a creature type with the revealed card."); - player.getLibrary().putOnBottom(card, game); + game.informPlayers(sourceObject.getLogName() + ": No creature that shares a creature type with the revealed card."); + controller.getLibrary().putOnBottom(card, game); } } else { - game.informPlayers("DescendantsPath: put " + card.getName() + " on the bottom."); - player.getLibrary().putOnBottom(card, game); + game.informPlayers(sourceObject.getLogName() + ": Put " + card.getLogName() + " on the bottom."); + controller.getLibrary().putOnBottom(card, game); } return true; From 9f7ce41679127609f7a1c7ae6b4036572db98601 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 17 Jun 2015 21:45:06 +0200 Subject: [PATCH 086/148] Some minor changes. --- .../src/mage/sets/commander/Fertilid.java | 53 +------- .../sets/dissension/PainMagnification.java | 26 ++-- .../src/mage/sets/lorwyn/AquitectsWill.java | 27 ++-- .../BecomesBasicLandTargetEffect.java | 26 ++-- ...rchLibraryPutInPlayTargetPlayerEffect.java | 119 ++++++++++++++++++ 5 files changed, 168 insertions(+), 83 deletions(-) create mode 100644 Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java index fd4d14ce21a..c0b3132f69c 100644 --- a/Mage.Sets/src/mage/sets/commander/Fertilid.java +++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java @@ -35,16 +35,13 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; -import mage.cards.Card; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterBasicLandCard; -import mage.game.Game; -import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; @@ -63,8 +60,10 @@ public class Fertilid extends CardImpl { // Fertilid enters the battlefield with two +1/+1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it")); + // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new FertilidEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); @@ -79,47 +78,3 @@ public class Fertilid extends CardImpl { return new Fertilid(this); } } - -class FertilidEffect extends SearchLibraryPutInPlayEffect { - - public FertilidEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) { - super(target, tapped, forceShuffle); - - this.staticText = "Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library."; - } - - public FertilidEffect(final FertilidEffect effect) { - super(effect); - } - - @Override - public FertilidEffect copy() { - return new FertilidEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(targetPointer.getFirst(game, source)); - - if (player != null) { - if (player.searchLibrary(target, game)) { - if (target.getTargets().size() > 0) { - for (UUID cardId: target.getTargets()) { - Card card = player.getLibrary().getCard(cardId, game); - if (card != null) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped); - } - } - } - player.shuffleLibrary(game); - return true; - } - - if (forceShuffle) { - player.shuffleLibrary(game); - } - } - - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java index bed43711a4f..418356ea74f 100644 --- a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java +++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java @@ -77,21 +77,23 @@ class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl { public PainMagnificationTriggeredAbility copy() { return new PainMagnificationTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - // If the damaged player is an opponent - if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { - int amount = event.getAmount(); - if(amount >= 3) { - // If at least 3 damage is dealt, set the opponent as the Discard target - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; - } - } + // If the damaged player is an opponent + if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { + if(event.getAmount() >= 3) { + // If at least 3 damage is dealt, set the opponent as the Discard target + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + } + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index b78e153907e..a92d4b2eaa9 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -37,7 +37,9 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Layer; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; @@ -49,22 +51,20 @@ import mage.target.common.TargetLandPermanent; * @author ilcartographer */ public class AquitectsWill extends CardImpl { - private static final String rule = "land is an Island in addition to its other types for as long as it has a flood counter on it."; public AquitectsWill(UUID ownerId) { super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}"); this.expansionSetCode = "LRW"; this.subtype.add("Merfolk"); - // Put a flood counter on target land. That land is an Island in addition to its other types for as long as it has a flood counter on it. If you control a Merfolk, draw a card. - // Add the flood counter to target land + // Put a flood counter on target land. this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance())); this.getSpellAbility().addTarget(new TargetLandPermanent()); - // Add the Flood counter effect + // That land is an Island in addition to its other types for as long as it has a flood counter on it. this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island")); - // Draw if you control a Merfolk + // If you control a Merfolk, draw a card. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DrawCardSourceControllerEffect(1), new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")), @@ -85,6 +85,7 @@ class AquitectsWillEffect extends BecomesBasicLandTargetEffect { public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) { super(duration, chooseLandType, loseType, landNames); + staticText = "That land is an Island in addition to its other types for as long as it has a flood counter on it"; } public AquitectsWillEffect(final AquitectsWillEffect effect) { @@ -92,18 +93,20 @@ class AquitectsWillEffect extends BecomesBasicLandTargetEffect { } @Override - public boolean isInactive(Ability source, Game game) { + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); - if (land != null && land.getCounters().getCount(CounterType.FLOOD) < 1) { + if (land == null) { + // if permanent left battlefield the effect can be removed because it was only valid for that object this.discard(); - return true; - } - - return false; + } else if (land.getCounters().getCount(CounterType.FLOOD) > 0) { + // only if Flood counter is on the object it becomes an Island.(it would be possible to remove and return the counters with e.g. Fate Transfer if the land becomes a creature too) + super.apply(layer, sublayer, source, game); + } + return true; } @Override public AquitectsWillEffect copy() { return new AquitectsWillEffect(this); } -} \ No newline at end of file +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 3cd7a1f11cd..39316525853 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -135,16 +135,22 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { case AbilityAddingRemovingEffects_6: land.removeAllAbilities(source.getSourceId(), game); for (String landType : landTypes) { - if (landType.equals("Swamp")) { - land.addAbility(new BlackManaAbility(), source.getSourceId(), game); - } else if (landType.equals("Mountain")) { - land.addAbility(new RedManaAbility(), source.getSourceId(), game); - } else if (landType.equals("Forest")) { - land.addAbility(new GreenManaAbility(), source.getSourceId(), game); - } else if (landType.equals("Island")) { - land.addAbility(new BlueManaAbility(), source.getSourceId(), game); - } else if (landType.equals("Plains")) { - land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + switch (landType) { + case "Swamp": + land.addAbility(new BlackManaAbility(), source.getSourceId(), game); + break; + case "Mountain": + land.addAbility(new RedManaAbility(), source.getSourceId(), game); + break; + case "Forest": + land.addAbility(new GreenManaAbility(), source.getSourceId(), game); + break; + case "Island": + land.addAbility(new BlueManaAbility(), source.getSourceId(), game); + break; + case "Plains": + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + break; } } break; diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java new file mode 100644 index 00000000000..74cf05fbe9f --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java @@ -0,0 +1,119 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common.search; + +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.SearchEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LevelX2 + */ + +public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect { + + protected boolean tapped; + protected boolean forceShuffle; + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target) { + this(target, false, true, Outcome.PutCardInPlay); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped) { + this(target, tapped, true, Outcome.PutCardInPlay); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) { + this(target, tapped, forceShuffle, Outcome.PutCardInPlay); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, Outcome outcome) { + this(target, tapped, true, outcome); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) { + super(target, outcome); + this.tapped = tapped; + this.forceShuffle = forceShuffle; + setText(); + } + + public SearchLibraryPutInPlayTargetPlayerEffect(final SearchLibraryPutInPlayTargetPlayerEffect effect) { + super(effect); + this.tapped = effect.tapped; + this.forceShuffle = effect.forceShuffle; + } + + @Override + public SearchLibraryPutInPlayTargetPlayerEffect copy() { + return new SearchLibraryPutInPlayTargetPlayerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (player != null) { + if (player.searchLibrary(target, game)) { + if (target.getTargets().size() > 0) { + for (UUID cardId: target.getTargets()) { + Card card = player.getLibrary().getCard(cardId, game); + if (card != null) { + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped); + } + } + } + player.shuffleLibrary(game); + return true; + } + + if (forceShuffle) { + player.shuffleLibrary(game); + } + } + + return false; + } + + private void setText() { + StringBuilder sb = new StringBuilder(); + sb.append("target player searches his or her library for "); + if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { + if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) { + sb.append("any number of ").append(" "); + } + else { + sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" "); + } + sb.append(target.getTargetName()).append(" and put them onto the battlefield"); + } + else { + sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield"); + } + if (tapped) { + sb.append(" tapped"); + } + if (forceShuffle) { + sb.append(". Then that player shuffles his or her library"); + } + else { + sb.append(". If that player does, he or she shuffles his or her library"); + } + staticText = sb.toString(); + } + + public List getTargets() { + return target.getTargets(); + } + +} From 602cfadce71c2f1fb918f4a0f5b486edb5e7ab19 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 22:44:52 -0400 Subject: [PATCH 087/148] Added FireTempest --- .../sets/masterseditioniv/FireTempest.java | 52 +++++++++++++++++ .../src/mage/sets/portal/FireTempest.java | 58 +++++++++++++++++++ .../mage/sets/starter1999/FireTempest.java | 52 +++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java create mode 100644 Mage.Sets/src/mage/sets/portal/FireTempest.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/FireTempest.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java new file mode 100644 index 00000000000..0b5846ce451 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class FireTempest extends mage.sets.portal.FireTempest { + + public FireTempest(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "ME4"; + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FireTempest.java b/Mage.Sets/src/mage/sets/portal/FireTempest.java new file mode 100644 index 00000000000..73a5edd2c58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FireTempest.java @@ -0,0 +1,58 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class FireTempest extends CardImpl { + + public FireTempest(UUID ownerId) { + super(ownerId, 133, "Fire Tempest", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); + this.expansionSetCode = "POR"; + + // Fire Tempest deals 6 damage to each creature and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(6)); + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/FireTempest.java b/Mage.Sets/src/mage/sets/starter1999/FireTempest.java new file mode 100644 index 00000000000..dc65152b60f --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/FireTempest.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.starter1999; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class FireTempest extends mage.sets.portal.FireTempest { + + public FireTempest(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "S99"; + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} From b41599186b1a3a57a7d825df6d092d0fc5e89735 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 22:49:41 -0400 Subject: [PATCH 088/148] Lava Flow added --- .../mage/sets/masterseditioniv/LavaFlow.java | 54 +++++++++++++++ Mage.Sets/src/mage/sets/portal/LavaFlow.java | 69 +++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java create mode 100644 Mage.Sets/src/mage/sets/portal/LavaFlow.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java new file mode 100644 index 00000000000..28e23ad688c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class LavaFlow extends mage.sets.portal.LavaFlow { + + public LavaFlow(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public LavaFlow(final LavaFlow card) { + super(card); + } + + @Override + public LavaFlow copy() { + return new LavaFlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/LavaFlow.java b/Mage.Sets/src/mage/sets/portal/LavaFlow.java new file mode 100644 index 00000000000..90da5519b19 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/LavaFlow.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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author anonymous + */ +public class LavaFlow extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("creature or land"); + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); + } + + public LavaFlow(UUID ownerId) { + super(ownerId, 143, "Lava Flow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "POR"; + + // Destroy target creature or land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + Target target = new TargetPermanent(filter); + this.getSpellAbility().addTarget(target); + } + + public LavaFlow(final LavaFlow card) { + super(card); + } + + @Override + public LavaFlow copy() { + return new LavaFlow(this); + } +} From 35d992b5bc092d881d0d407de3623015a79045a4 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:00:51 -0400 Subject: [PATCH 089/148] Sedge Troll added --- .../mage/sets/limitedalpha/SedgeTroll.java | 52 +++++++++++++ .../src/mage/sets/limitedbeta/SedgeTroll.java | 52 +++++++++++++ .../sets/masterseditioniv/SedgeTroll.java | 77 +++++++++++++++++++ .../mage/sets/revisededition/SedgeTroll.java | 52 +++++++++++++ .../sets/unlimitededition/SedgeTroll.java | 52 +++++++++++++ 5 files changed, 285 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java diff --git a/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java new file mode 100644 index 00000000000..d72be7da06b --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "LEA"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java new file mode 100644 index 00000000000..727f55b9a73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 174; + this.expansionSetCode = "LEB"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java new file mode 100644 index 00000000000..bd09ae6f64b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java @@ -0,0 +1,77 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author anonymous + */ +public class SedgeTroll extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Swamp"); + + static { + filter.add(new SubtypePredicate("Swamp")); + } + + public SedgeTroll(UUID ownerId) { + super(ownerId, 135, "Sedge Troll", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Troll"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sedge Troll gets +1/+1 as long as you control a Swamp. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter, 1, 1))); + // {B}: Regenerate Sedge Troll. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java new file mode 100644 index 00000000000..08073719432 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.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.revisededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "3ED"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java new file mode 100644 index 00000000000..4469f488942 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "2ED"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} From 08e1f4b54035feffb9780ba78250cf6e24e8efe1 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:07:08 -0400 Subject: [PATCH 090/148] Alluring Scent added --- .../sets/masterseditioniv/AlluringScent.java | 54 ++++++++++++++++ .../src/mage/sets/portal/AlluringScent.java | 61 +++++++++++++++++++ .../sets/portalsecondage/AlluringScent.java | 52 ++++++++++++++++ .../mage/sets/starter1999/AlluringScent.java | 52 ++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/portal/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/AlluringScent.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java new file mode 100644 index 00000000000..02f566a2eaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/AlluringScent.java b/Mage.Sets/src/mage/sets/portal/AlluringScent.java new file mode 100644 index 00000000000..9011d1b8343 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/AlluringScent.java @@ -0,0 +1,61 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class AlluringScent extends CardImpl { + + public AlluringScent(UUID ownerId) { + super(ownerId, 61, "Alluring Scent", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + this.expansionSetCode = "POR"; + + // All creatures able to block target creature this turn do so. + this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java new file mode 100644 index 00000000000..21362c14c5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.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.portalsecondage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "PO2"; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java new file mode 100644 index 00000000000..a9596f50154 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.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.starter1999; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "S99"; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} From c5f1b4e04a3e00f8aff2e408ab3522ffc82e59c7 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:11:27 -0400 Subject: [PATCH 091/148] Bee Sting added --- .../mage/sets/masterseditioniv/BeeSting.java | 52 ++++++++++++++++ Mage.Sets/src/mage/sets/portal/BeeSting.java | 60 +++++++++++++++++++ .../mage/sets/portalsecondage/BeeSting.java | 52 ++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java create mode 100644 Mage.Sets/src/mage/sets/portal/BeeSting.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java new file mode 100644 index 00000000000..9aa50ac612f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class BeeSting extends mage.sets.portal.BeeSting { + + public BeeSting(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "ME4"; + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/BeeSting.java b/Mage.Sets/src/mage/sets/portal/BeeSting.java new file mode 100644 index 00000000000..7fd92df02bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/BeeSting.java @@ -0,0 +1,60 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author anonymous + */ +public class BeeSting extends CardImpl { + + public BeeSting(UUID ownerId) { + super(ownerId, 83, "Bee Sting", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "POR"; + + // Bee Sting deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java new file mode 100644 index 00000000000..46420f52aa4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.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.portalsecondage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class BeeSting extends mage.sets.portal.BeeSting { + + public BeeSting(UUID ownerId) { + super(ownerId); + this.cardNumber = 64; + this.expansionSetCode = "PO2"; + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} From b6a5b9f4cb9f9deeac3dc4cbe211270c3a6ee1b0 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:30:53 -0400 Subject: [PATCH 092/148] Citanul Druid added --- .../mage/sets/antiquities/CitanulDruid.java | 76 +++++++++++++++++++ .../sets/masterseditioniv/CitanulDruid.java | 54 +++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java diff --git a/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java new file mode 100644 index 00000000000..3e593593680 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.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.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterArtifactSpell; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author anonymous + */ +public class CitanulDruid extends CardImpl { + private static final FilterArtifactSpell filter = new FilterArtifactSpell(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + + public CitanulDruid(UUID ownerId) { + super(ownerId, 61, "Citanul Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever an opponent casts an artifact spell, put a +1/+1 counter on Citanul Druid. + this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false)); + } + + public CitanulDruid(final CitanulDruid card) { + super(card); + } + + @Override + public CitanulDruid copy() { + return new CitanulDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java new file mode 100644 index 00000000000..88024ad7fc7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class CitanulDruid extends mage.sets.antiquities.CitanulDruid { + + public CitanulDruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 146; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public CitanulDruid(final CitanulDruid card) { + super(card); + } + + @Override + public CitanulDruid copy() { + return new CitanulDruid(this); + } +} From f35ef81aa8ed797b518a1c400f30ea253ff55681 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:36:21 -0400 Subject: [PATCH 093/148] Ironhoof Ox added --- .../sets/masterseditioniv/IronhoofOx.java | 54 ++++++++++++++++ .../mage/sets/portalsecondage/IronhoofOx.java | 64 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java new file mode 100644 index 00000000000..5c40de1cc18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class IronhoofOx extends mage.sets.portalsecondage.IronhoofOx { + + public IronhoofOx(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public IronhoofOx(final IronhoofOx card) { + super(card); + } + + @Override + public IronhoofOx copy() { + return new IronhoofOx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java new file mode 100644 index 00000000000..78317a733e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.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.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class IronhoofOx extends CardImpl { + + public IronhoofOx(UUID ownerId) { + super(ownerId, 70, "Ironhoof Ox", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Ox"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Ironhoof Ox can't be blocked by more than one creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByMoreThanOneSourceEffect())); + } + + public IronhoofOx(final IronhoofOx card) { + super(card); + } + + @Override + public IronhoofOx copy() { + return new IronhoofOx(this); + } +} From e717ad038b45e9236fadb92523296f04eab949fc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jun 2015 07:43:36 +0200 Subject: [PATCH 094/148] [ORI] Added Kytheon, Hero of Akros. --- .../mage/sets/fifthedition/TheWretched.java | 34 +-- .../mage/sets/magicorigins/CatacombSlug.java | 2 +- .../mage/sets/magicorigins/ChandrasFury.java | 2 +- .../sets/magicorigins/ChargingGriffin.java | 2 +- .../sets/magicorigins/Claustrophobia.java | 2 +- .../mage/sets/magicorigins/Cobblebrute.java | 2 +- .../mage/sets/magicorigins/CruelRevival.java | 2 +- .../src/mage/sets/magicorigins/Disperse.java | 2 +- .../sets/magicorigins/ElvishVisionary.java | 2 +- .../sets/magicorigins/FieryConclusion.java | 2 +- .../sets/magicorigins/GideonBattleForged.java | 194 ++++++++++++++++++ .../sets/magicorigins/GoldForgedSentinel.java | 2 +- .../sets/magicorigins/HixusPrisonWarden.java | 2 +- .../mage/sets/magicorigins/JayemdaeTome.java | 2 +- .../sets/magicorigins/KytheonHeroOfAkros.java | 120 +++++++++++ .../mage/sets/magicorigins/LeafGilder.java | 2 +- .../mage/sets/magicorigins/MaritimeGuard.java | 2 +- .../src/mage/sets/magicorigins/Meteorite.java | 2 +- .../mage/sets/magicorigins/MightyLeap.java | 2 +- .../sets/magicorigins/NissaVastwoodSeer.java | 43 +--- .../mage/sets/magicorigins/RunedServitor.java | 2 +- .../sets/magicorigins/ScrapskinDrake.java | 2 +- .../mage/sets/magicorigins/TitanicGrowth.java | 2 +- .../sets/magicorigins/TitansStrength.java | 2 +- .../mage/sets/magicorigins/TowerGeist.java | 2 +- .../sets/magicorigins/VastwoodGorger.java | 2 +- .../magicorigins/WeightOfTheUnderworld.java | 2 +- .../sets/magicorigins/YevasForcemage.java | 2 +- .../src/mage/sets/magicorigins/YokedOx.java | 2 +- .../sets/riseoftheeldrazi/GideonJura.java | 5 +- .../mage/sets/tenthedition/MantisEngine.java | 4 + .../common/EndOfCombatTriggeredAbility.java | 48 +++++ ...ExileAndReturnTransformedSourceEffect.java | 55 +++++ Mage/src/mage/game/combat/Combat.java | 4 +- .../common/AttackedThisCombatWatcher.java | 53 +++++ 35 files changed, 511 insertions(+), 99 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java create mode 100644 Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java create mode 100644 Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java create mode 100644 Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java index 9554817d948..bfe1f16d8a4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java +++ b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EndOfCombatTriggeredAbility; import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.ContinuousEffect; @@ -77,7 +78,7 @@ public class TheWretched extends CardImpl { this.toughness = new MageInt(5); // At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched. - this.addAbility(new EndOfAnyCombatTriggeredAbility(), new BlockedAttackerWatcher()); + this.addAbility(new EndOfCombatTriggeredAbility(new TheWretchedEffect(), false), new BlockedAttackerWatcher()); } @@ -91,37 +92,6 @@ public class TheWretched extends CardImpl { } } -class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl { - - EndOfAnyCombatTriggeredAbility() { - super(Zone.BATTLEFIELD, new TheWretchedEffect(), false); - } - - EndOfAnyCombatTriggeredAbility(final EndOfAnyCombatTriggeredAbility ability) { - super(ability); - } - - @Override - public EndOfAnyCombatTriggeredAbility copy() { - return new EndOfAnyCombatTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return true; - } - - @Override - public String getRule() { - return "At the end of combat, gain control of all creatures blocking {this} for as long as you control {this}."; - } -} - class TheWretchedEffect extends OneShotEffect { TheWretchedEffect() { diff --git a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java index 38ceb429d07..ab61208dc24 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java +++ b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java @@ -37,7 +37,7 @@ public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug { public CatacombSlug(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 998; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java index 7aafc1d8ef6..9415221491c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java @@ -37,7 +37,7 @@ public class ChandrasFury extends mage.sets.magic2013.ChandrasFury { public ChandrasFury(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 997; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java index 3cbc9c975af..60c62df9cbd 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java @@ -37,7 +37,7 @@ public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin { public ChargingGriffin(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 996; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java index b363d80e591..ef033f9db46 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java @@ -37,7 +37,7 @@ public class Claustrophobia extends mage.sets.innistrad.Claustrophobia { public Claustrophobia(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 995; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java index 97349a0e0e7..7c282ccd931 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java @@ -37,7 +37,7 @@ public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute { public Cobblebrute(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 994; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java index 7682e5befe8..c82e1c25a66 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java +++ b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java @@ -37,7 +37,7 @@ public class CruelRevival extends mage.sets.onslaught.CruelRevival { public CruelRevival(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 993; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java index 7581651100b..962e36434b6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java @@ -37,7 +37,7 @@ public class Disperse extends mage.sets.scarsofmirrodin.Disperse { public Disperse(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 992; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java index d901aee1be2..4b13a997457 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java @@ -37,7 +37,7 @@ public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary { public ElvishVisionary(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 991; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java index a973a8e8d1b..92348e1805a 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java +++ b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java @@ -37,7 +37,7 @@ public class FieryConclusion extends mage.sets.ravnica.FieryConclusion { public FieryConclusion(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 990; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java new file mode 100644 index 00000000000..5c291b6c299 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java @@ -0,0 +1,194 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.TurnPhase; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class GideonBattleForged extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public GideonBattleForged(UUID ownerId) { + super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, ""); + this.expansionSetCode = "ORI"; + this.subtype.add("Gideon"); + + this.color.setWhite(true); + + this.nightCard = true; + this.canTransform = true; + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); + + // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able. + LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2); + loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false)); + this.addAbility(loyaltyAbility); + + // +1: Until your next turn, target creature gains indestructible. Untap that creature. + Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn); + effect.setText("Until your next turn, target creature gains indestructible"); + loyaltyAbility = new LoyaltyAbility(effect, 1); + effect = new UntapTargetEffect(); + effect.setText("Untap that creature"); + loyaltyAbility.addEffect(effect); + this.addAbility(loyaltyAbility); + + // 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. + LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0); + effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability3.addEffect(effect); + this.addAbility(ability3); + + } + + public GideonBattleForged(final GideonBattleForged card) { + super(card); + } + + @Override + public GideonBattleForged copy() { + return new GideonBattleForged(this); + } +} + +class GideonBattleForgedToken extends Token { + + public GideonBattleForgedToken() { + super("", "4/4 Human Soldier creature with indestructible"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + power = new MageInt(4); + toughness = new MageInt(4); + this.addAbility(IndestructibleAbility.getInstance()); + } + +} + +class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { + + int nextTurnTargetController = 0; + protected MageObjectReference targetPermanentReference; + + public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) { + super(duration); + staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able"; + } + + public GideonBattleForgedAttacksIfAbleTargetEffect(final GideonBattleForgedAttacksIfAbleTargetEffect effect) { + super(effect); + this.nextTurnTargetController = effect.nextTurnTargetController; + this.targetPermanentReference = effect.targetPermanentReference; + } + + @Override + public GideonBattleForgedAttacksIfAbleTargetEffect copy() { + return new GideonBattleForgedAttacksIfAbleTargetEffect(this); + } + + @Override + public boolean isInactive(Ability source, Game game) { + Permanent targetPermanent = targetPermanentReference.getPermanent(game); + if (targetPermanent == null) { + return false; + } + if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { + nextTurnTargetController = game.getTurnNum(); + } + return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) { + if (game.getActivePlayerId().equals(permanent.getControllerId())) { + Permanent planeswalker = game.getPermanent(source.getSourceId()); + if (planeswalker != null) { + if (planeswalker.getCardType().contains(CardType.CREATURE)) { + return true; + } + } else { + discard(); + } + } + } + return false; + } + + @Override + public UUID mustAttackDefender(Ability source, Game game) { + return source.getSourceId(); + } + + @Override + public boolean mustAttack(Game game) { + return true; + } + + @Override + public boolean mustBlock(Game game) { + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java index 418337f87b1..6d2b6f15f2c 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java @@ -37,7 +37,7 @@ public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSenti public GoldForgedSentinel(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 989; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java index acdb852b8b7..bc5db55e567 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java @@ -57,7 +57,7 @@ import mage.util.CardUtil; public class HixusPrisonWarden extends CardImpl { public HixusPrisonWarden(UUID ownerId) { - super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}{3}{W}{W}"); + super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.expansionSetCode = "ORI"; this.supertype.add("Legendary"); this.subtype.add("Human"); diff --git a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java index 8588e525641..4679bf67104 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java +++ b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java @@ -38,7 +38,7 @@ public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome { public JayemdaeTome(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 988; this.expansionSetCode = "ORI"; this.rarity = Rarity.UNCOMMON; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java new file mode 100644 index 00000000000..0da1c307fc7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java @@ -0,0 +1,120 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.EndOfCombatTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.Condition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.AttackedThisCombatWatcher; + +/** + * + * @author LevelX2 + */ +public class KytheonHeroOfAkros extends CardImpl { + + public KytheonHeroOfAkros(UUID ownerId) { + super(ownerId, 23, "Kytheon, Hero of Akros", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + this.canTransform = true; + this.secondSideCard = new GideonBattleForged(ownerId); + + // At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, + // then return him to the battlefield transformed under his owner's control. + this.addAbility(new TransformAbility()); + this.addAbility(new ConditionalTriggeredAbility(new EndOfCombatTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.MALE), false), + new KytheonHeroOfAkrosCondition(), "At end of combat, if {this} and at least two other creatures attacked this combat, exile {this}, " + + "then return him to the battlefield transformed under his owner's control."), new AttackedThisCombatWatcher()); + + // {2}{W}: Kytheon gains indestructible until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{2}{W}"))); + + } + + public KytheonHeroOfAkros(final KytheonHeroOfAkros card) { + super(card); + } + + @Override + public KytheonHeroOfAkros copy() { + return new KytheonHeroOfAkros(this); + } +} + +class KytheonHeroOfAkrosCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + Permanent sourceObject = game.getPermanent(source.getSourceId()); + if (sourceObject != null) { + AttackedThisCombatWatcher watcher = (AttackedThisCombatWatcher) game.getState().getWatchers().get("AttackedThisCombat"); + if (watcher != null) { + boolean sourceFound = false; + int number = 0; + for (MageObjectReference mor: watcher.getAttackedThisTurnCreatures()) { + if (mor.refersTo(sourceObject, game)) { + sourceFound = true; + } else { + number++; + } + } + return sourceFound && number >= 2; + } + } + return false; + } + + @Override + public String toString() { + return "if {this} and at least two other creatures attacked this combat"; + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java index 5c2ef28e0af..e4346108392 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java +++ b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java @@ -37,7 +37,7 @@ public class LeafGilder extends mage.sets.lorwyn.LeafGilder { public LeafGilder(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 987; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java index ffc48924a7a..5aefd0e3821 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java @@ -37,7 +37,7 @@ public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard { public MaritimeGuard(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 986; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java index f76704a0dba..2996f3fa423 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java @@ -37,7 +37,7 @@ public class Meteorite extends mage.sets.magic2015.Meteorite { public Meteorite(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 985; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java index ca7871a5d01..3686162a484 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java +++ b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java @@ -37,7 +37,7 @@ public class MightyLeap extends mage.sets.magic2011.MightyLeap { public MightyLeap(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 984; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java index 22ef98bc763..439cf1fb125 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java @@ -29,28 +29,22 @@ package mage.sets.magicorigins; import java.util.UUID; import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.TransformAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; -import mage.game.Game; -import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -83,7 +77,7 @@ public class NissaVastwoodSeer extends CardImpl { // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control. this.addAbility(new TransformAbility()); this.addAbility(new ConditionalTriggeredAbility( - new EntersBattlefieldControlledTriggeredAbility(new NissaVastwoodSeerTransformEffect(), new FilterLandPermanent()), + new EntersBattlefieldControlledTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new FilterLandPermanent()), new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true), "Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control.")); } @@ -97,34 +91,3 @@ public class NissaVastwoodSeer extends CardImpl { return new NissaVastwoodSeer(this); } } - -class NissaVastwoodSeerTransformEffect extends OneShotEffect { - - NissaVastwoodSeerTransformEffect() { - super(Outcome.Benefit); - this.staticText = "exile {this}, then return her to the battlefield transformed under her owner's control"; - } - - NissaVastwoodSeerTransformEffect(final NissaVastwoodSeerTransformEffect effect) { - super(effect); - } - - @Override - public NissaVastwoodSeerTransformEffect copy() { - return new NissaVastwoodSeerTransformEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject sourceObject = source.getSourceObjectIfItStillExists(game); - Player controller = game.getPlayer(source.getControllerId()); - if (sourceObject != null && controller != null) { - Card card = (Card) sourceObject; - if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { - game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); - controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); - } - } - return true; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java index 907344659f5..71446b0a5d9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java +++ b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java @@ -37,7 +37,7 @@ public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor { public RunedServitor(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 983; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java index d4252ebcd87..f03d8afd2a5 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java +++ b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java @@ -37,7 +37,7 @@ public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake { public ScrapskinDrake(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 982; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java index 0a3464df340..0d1b8d2ffad 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java @@ -37,7 +37,7 @@ public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth { public TitanicGrowth(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 981; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java index fbb3ca18954..a8cba796028 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java @@ -37,7 +37,7 @@ public class TitansStrength extends mage.sets.theros.TitansStrength { public TitansStrength(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 980; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java index 83f4e1c1304..a80343127c6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java @@ -37,7 +37,7 @@ public class TowerGeist extends mage.sets.darkascension.TowerGeist { public TowerGeist(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 979; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java index d63e8419778..c0a4be303e3 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java +++ b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java @@ -37,7 +37,7 @@ public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger { public VastwoodGorger(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 978; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java index a2152d252aa..19b5635b498 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java +++ b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java @@ -37,7 +37,7 @@ public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUn public WeightOfTheUnderworld(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 977; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java index 9aeebb11921..3eadb733209 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java +++ b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java @@ -37,7 +37,7 @@ public class YevasForcemage extends mage.sets.magic2013.YevasForcemage { public YevasForcemage(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 976; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java index a8782b64095..24dd1b11194 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java +++ b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java @@ -37,7 +37,7 @@ public class YokedOx extends mage.sets.theros.YokedOx { public YokedOx(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 975; this.expansionSetCode = "ORI"; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index b52ecc52b86..d01d66c5968 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -38,6 +38,7 @@ import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -85,7 +86,9 @@ public class GideonJura extends CardImpl { // 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn. LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0); - ability3.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn)); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability3.addEffect(effect); this.addAbility(ability3); } diff --git a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java index e248728b5f7..056443e3b01 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java +++ b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java @@ -53,7 +53,11 @@ public class MantisEngine extends CardImpl { this.subtype.add("Insect"); this.power = new MageInt(3); this.toughness = new MageInt(3); + + // {2}: Mantis Engine gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.) this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2))); + + // {2}: Mantis Engine gains first strike until end of turn. (It deals combat damage before creatures without first strike.) this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2))); } diff --git a/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java new file mode 100644 index 00000000000..58926ccb9b0 --- /dev/null +++ b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java @@ -0,0 +1,48 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; + +/** + * + * @author LevelX2 + */ + +public class EndOfCombatTriggeredAbility extends TriggeredAbilityImpl { + + public EndOfCombatTriggeredAbility(Effect effect, boolean optional) { + super(Zone.BATTLEFIELD, effect, optional); + } + + public EndOfCombatTriggeredAbility(final EndOfCombatTriggeredAbility ability) { + super(ability); + } + + @Override + public EndOfCombatTriggeredAbility copy() { + return new EndOfCombatTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return true; + } + + @Override + public String getRule() { + return "At the end of combat, " + super.getRule(); + } +} \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java new file mode 100644 index 00000000000..3e6bd508bb4 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java @@ -0,0 +1,55 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.effects.common; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ + +public class ExileAndReturnTransformedSourceEffect extends OneShotEffect { + + public static enum Gender { MALE, FEMAL }; + + public ExileAndReturnTransformedSourceEffect(Gender gender) { + super(Outcome.Benefit); + this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him":"her") + + " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his":"her")+ " owner's control"; + } + + public ExileAndReturnTransformedSourceEffect(final ExileAndReturnTransformedSourceEffect effect) { + super(effect); + } + + @Override + public ExileAndReturnTransformedSourceEffect copy() { + return new ExileAndReturnTransformedSourceEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + Player controller = game.getPlayer(source.getControllerId()); + if (sourceObject != null && controller != null) { + Card card = (Card) sourceObject; + if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) { + game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE); + controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId()); + } + } + return true; + } +} diff --git a/Mage/src/mage/game/combat/Combat.java b/Mage/src/mage/game/combat/Combat.java index b70442fc7e4..e5d281763cd 100644 --- a/Mage/src/mage/game/combat/Combat.java +++ b/Mage/src/mage/game/combat/Combat.java @@ -247,7 +247,9 @@ public class Combat implements Serializable, Copyable { for (Ability ability : entry.getValue()) { UUID defenderId = effect.mustAttackDefender(ability, game); if (defenderId != null) { - defendersForcedToAttack.add(defenderId); + if (defenders.contains(defenderId)) { + defendersForcedToAttack.add(defenderId); + } } break; } diff --git a/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java new file mode 100644 index 00000000000..b95a7a73142 --- /dev/null +++ b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java @@ -0,0 +1,53 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.watchers.common; + +import java.util.HashSet; +import java.util.Set; +import mage.MageObjectReference; +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ + +public class AttackedThisCombatWatcher extends Watcher { + + public Set attackedThisTurnCreatures = new HashSet<>(); + + public AttackedThisCombatWatcher() { + super("AttackedThisCombat", WatcherScope.GAME); + } + + public AttackedThisCombatWatcher(final AttackedThisCombatWatcher watcher) { + super(watcher); + this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures); + } + + @Override + public void watch(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) { + this.attackedThisTurnCreatures.clear(); + } + if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { + this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(),game)); + } + } + + public Set getAttackedThisTurnCreatures() { + return this.attackedThisTurnCreatures; + } + + @Override + public AttackedThisCombatWatcher copy() { + return new AttackedThisCombatWatcher(this); + } + +} From f36460137f9c33330d3d3d98c7876cce1969afd9 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 10:27:54 +0300 Subject: [PATCH 095/148] Fix Sengir Nosferatu tooltip text --- Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java index 8f6811b51e7..7767552a68c 100644 --- a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java +++ b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java @@ -34,6 +34,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; @@ -67,8 +68,9 @@ public class SengirNosferatu extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // {1}{B}, Exile Sengir Nosferatu: Put a 1/2 black Bat creature token with flying onto the battlefield. It has "{1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control." - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new CreateTokenEffect(new SengirNosferatuBatToken(), 1), new ManaCostsImpl("{1}{B}")); + Effect effect = new CreateTokenEffect(new SengirNosferatuBatToken(), 1); + effect.setText("Put a 1/2 black Bat creature token with flying onto the battlefield. It has \"{1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control.\""); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); ability.addCost(new ExileSourceCost()); this.addAbility(ability); } From d169fb8b5ea8dbc59ba11140fa60765005d60898 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 10:28:19 +0300 Subject: [PATCH 096/148] Implement card: Tarpan. Long Live Team Tarpan! ;-) --- .../src/mage/sets/fifthedition/Tarpan.java | 53 +++++++++++++++ Mage.Sets/src/mage/sets/iceage/Tarpan.java | 64 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/Tarpan.java create mode 100644 Mage.Sets/src/mage/sets/iceage/Tarpan.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java b/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java new file mode 100644 index 00000000000..4dc3e23c5a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java @@ -0,0 +1,53 @@ +/* + * 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 Tarpan extends mage.sets.iceage.Tarpan { + + public Tarpan(UUID ownerId) { + super(ownerId); + this.cardNumber = 192; + this.expansionSetCode = "5ED"; + } + + public Tarpan(final Tarpan card) { + super(card); + } + + @Override + public Tarpan copy() { + return new Tarpan(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/Tarpan.java b/Mage.Sets/src/mage/sets/iceage/Tarpan.java new file mode 100644 index 00000000000..27a4804f1dc --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/Tarpan.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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + + */ +public class Tarpan extends CardImpl { + + public Tarpan(UUID ownerId) { + super(ownerId, 155, "Tarpan", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Horse"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // When Tarpan dies, you gain 1 life. + this.addAbility(new DiesTriggeredAbility(new GainLifeEffect(1), false)); + } + + public Tarpan(final Tarpan card) { + super(card); + } + + @Override + public Tarpan copy() { + return new Tarpan(this); + } +} From 7ee6e13913aea2a6077574930694189ca69f0b6d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jun 2015 11:29:42 +0200 Subject: [PATCH 097/148] * Harbor Serpent - Fixed that the attack restriction did not work correctly. --- .../mage/sets/magic2011/HarborSerpent.java | 15 ++++++----- .../cards/restriction/CantAttackTest.java | 25 +++++++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java index cbef2790095..aba8d9e873e 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java +++ b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java @@ -39,7 +39,6 @@ import mage.abilities.effects.RestrictionEffect; import mage.abilities.keyword.IslandwalkAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -58,7 +57,10 @@ public class HarborSerpent extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); + // Islandwalk (This creature is unblockable as long as defending player controls an Island.) this.addAbility(new IslandwalkAbility()); + + // Harbor Serpent can't attack unless there are five or more Islands on the battlefield. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HarborSerpentEffect())); } @@ -74,11 +76,10 @@ public class HarborSerpent extends CardImpl { class HarborSerpentEffect extends RestrictionEffect { - private final FilterLandPermanent filter = new FilterLandPermanent("Island"); + private static final FilterLandPermanent filter = new FilterLandPermanent("Island", "Island"); public HarborSerpentEffect() { super(Duration.WhileOnBattlefield); - filter.add(new SubtypePredicate("Island")); staticText = "{this} can't attack unless there are five or more Islands on the battlefield"; } @@ -97,10 +98,8 @@ class HarborSerpentEffect extends RestrictionEffect { } @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5) { - return true; - } - return false; + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()) && + game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java index 479e09910a9..a2d26ce8ee9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java @@ -66,6 +66,31 @@ public class CantAttackTest extends CardTestPlayerBase { assertLife(playerB, 14); // 4 + 2 } + + @Test + public void testAttackHarborSerpent() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 2); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, "Harbor Serpent"); // 5/5 + addCard(Zone.HAND, playerA, "Island"); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 2); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); // 2/2 + addCard(Zone.BATTLEFIELD, playerB, "Harbor Serpent"); // 5/5 + + attack(2, playerB, "Harbor Serpent"); + attack(2, playerB, "Silvercoat Lion"); + playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Island"); + attack(3, playerA, "Harbor Serpent"); + attack(3, playerA, "Silvercoat Lion"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerB, 13); + assertLife(playerA, 18); + } + } From ae1f726f56fbc52d1b8dc10ac2ab3cc21dc36de3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jun 2015 13:39:49 +0200 Subject: [PATCH 098/148] * Bioshift - Fixed that always all counters were moved, the remove counter event was not fired and that the two targetes were handled as one target definition. --- .../src/mage/sets/gatecrash/Bioshift.java | 100 ++++++++++-------- .../src/mage/sets/magic2010/ProteanHydra.java | 39 +++---- .../mage/sets/shadowmoor/GlamerSpinners.java | 18 ++-- .../oneshot/counter/MovingCounterTest.java | 80 ++++++++++++++ 4 files changed, 164 insertions(+), 73 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java diff --git a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java index 01764c518ab..9bed435422f 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java +++ b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java @@ -40,6 +40,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; /** @@ -54,8 +55,10 @@ public class Bioshift extends CardImpl { // Move any number of +1/+1 counters from target creature onto another target creature with the same controller. getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect()); - getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false)); + getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (you take counters from)"))); + getSpellAbility().addTarget(new BioshiftSecondTargetPermanent()); } + public Bioshift(final Bioshift card) { super(card); @@ -67,37 +70,6 @@ public class Bioshift extends CardImpl { } } -class TargetCreaturePermanentSameController extends TargetCreaturePermanent { - - public TargetCreaturePermanentSameController(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) { - super(minNumTargets, maxNumTargets, filter, notTarget); - this.targetName = filter.getMessage(); - } - - public TargetCreaturePermanentSameController(final TargetCreaturePermanentSameController target) { - super(target); - } - - @Override - public boolean canTarget(UUID id, Ability source, Game game) { - UUID firstTarget = this.getFirstTarget(); - if (firstTarget != null) { - Permanent permanent = game.getPermanent(firstTarget); - Permanent targetPermanent = game.getPermanent(id); - if (permanent == null || targetPermanent == null - || !permanent.getControllerId().equals(targetPermanent.getOwnerId())) { - return false; - } - } - return super.canTarget(id, source, game); - } - - @Override - public TargetCreaturePermanentSameController copy() { - return new TargetCreaturePermanentSameController(this); - } -} - class MoveCounterFromTargetToTargetEffect extends OneShotEffect { public MoveCounterFromTargetToTargetEffect() { @@ -116,22 +88,56 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Permanent fromPermanent = game.getPermanent(targetPointer.getFirst(game, source)); - Permanent toPermanent = null; - if (targetPointer.getTargets(game, source).size() > 1) { - toPermanent = game.getPermanent(targetPointer.getTargets(game, source).get(1)); - } - if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) { - return false; - } - int amountCounters = fromPermanent.getCounters().getCount(CounterType.P1P1); - if (amountCounters > 0) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller.getAmount(0, amountCounters, "How many counters do you want to move?", game) > 0){ - fromPermanent.getCounters().removeCounter(CounterType.P1P1, amountCounters); - toPermanent.addCounters(CounterType.P1P1.createInstance(amountCounters), game); + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent fromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + Permanent toPermanent = null; + if (source.getTargets().size() > 1) { + toPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); } + if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) { + return false; + } + int amountCounters = fromPermanent.getCounters().getCount(CounterType.P1P1); + if (amountCounters > 0) { + int amountToMove = controller.getAmount(0, amountCounters, "How many counters do you want to move?", game); + if (amountToMove > 0) { + fromPermanent.removeCounters(CounterType.P1P1.createInstance(amountToMove), game); + toPermanent.addCounters(CounterType.P1P1.createInstance(amountToMove), game); + } + } + return true; } - return true; + return false; + + } +} + +class BioshiftSecondTargetPermanent extends TargetPermanent { + + BioshiftSecondTargetPermanent() { + super(); + this.filter = new FilterCreaturePermanent("another target creature with the same controller (counters go to)"); + } + + BioshiftSecondTargetPermanent(final BioshiftSecondTargetPermanent target) { + super(target); + } + + @Override + public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { + Permanent firstPermanent = game.getPermanent(source.getTargets().getFirstTarget()); + Permanent secondPermanent = game.getPermanent(id); + if (firstPermanent != null && secondPermanent != null) { + if (!firstPermanent.getId().equals(id) && firstPermanent.getControllerId().equals(secondPermanent.getControllerId())) { + return super.canTarget(controllerId, id, source, game); + } + } + return false; + } + + @Override + public BioshiftSecondTargetPermanent copy() { + return new BioshiftSecondTargetPermanent(this); } } diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index feb2ccc3206..9ca788f1489 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -49,6 +49,7 @@ import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import java.util.UUID; +import mage.abilities.effects.PreventionEffectData; /** * @@ -121,7 +122,7 @@ public class ProteanHydra extends CardImpl { class ProteanHydraEffect2 extends PreventionEffectImpl { public ProteanHydraEffect2() { - super(Duration.WhileOnBattlefield); + super(Duration.WhileOnBattlefield, Integer.MAX_VALUE, false, false); staticText = "If damage would be dealt to {this}, prevent that damage and remove that many +1/+1 counters from it"; } @@ -141,19 +142,14 @@ public class ProteanHydra extends CardImpl { @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { - boolean retValue = false; - GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false); - int damage = event.getAmount(); - if (!game.replaceEvent(preventEvent)) { - event.setAmount(0); - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage)); - retValue = true; + PreventionEffectData preventionEffectData = preventDamageAction(event, source, game); + if (preventionEffectData.getPreventedDamage() > 0) { + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + permanent.removeCounters(CounterType.P1P1.createInstance(preventionEffectData.getPreventedDamage()), game); + } } - Permanent permanent = game.getPermanent(source.getSourceId()); - if (permanent != null) { - permanent.removeCounters(CounterType.P1P1.createInstance(damage), game); - } - return retValue; + return false; } @Override @@ -183,9 +179,14 @@ public class ProteanHydra extends CardImpl { return new ProteanHydraAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.COUNTER_REMOVED && event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) { + if (event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) { return true; } return false; @@ -213,12 +214,14 @@ public class ProteanHydra extends CardImpl { return new ProteanHydraDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.END_TURN_STEP_PRE) { - return true; - } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java index 7b4916bdfd5..e94e6b2e98e 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java @@ -111,10 +111,11 @@ class GlamerSpinnersEffect extends OneShotEffect { 5/1/2008 You may target a permanent that has no Auras enchanting it. 5/1/2008 When the ability resolves, you choose the permanent that will be receiving the Auras. It can't be the targeted permanent, it must have the same controller as the targeted permanent, and it must be able to be enchanted by all the Auras attached to the targeted permanent. If you can't choose a permanent that meets all those criteria, the Auras won't move. */ - Boolean passed = true; - Permanent targetPermanent = game.getPermanent(source.getFirstTarget()); + Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); - if (targetPermanent != null) { + Permanent sourcePermanent = (Permanent) source.getSourceObject(game); + if (targetPermanent != null && controller != null && sourcePermanent != null) { + Boolean passed = true; FilterPermanent filterChoice = new FilterPermanent("a different permanent with the same controller as the target to attach the enchantments to"); filterChoice.add(new ControllerIdPredicate(targetPermanent.getControllerId())); filterChoice.add(Predicates.not(new PermanentIdPredicate(targetPermanent.getId()))); @@ -122,11 +123,10 @@ class GlamerSpinnersEffect extends OneShotEffect { Target chosenPermanentToAttachAuras = new TargetPermanent(filterChoice); chosenPermanentToAttachAuras.setNotTarget(true); - LinkedList auras = new LinkedList(); + LinkedList auras = new LinkedList<>(); auras.addAll(targetPermanent.getAttachments()); - if (controller != null - && controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) { + if (controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) { Permanent permanentToAttachAuras = game.getPermanent(chosenPermanentToAttachAuras.getFirstTarget()); if (permanentToAttachAuras != null) { for (UUID auraId : auras) { @@ -148,7 +148,7 @@ class GlamerSpinnersEffect extends OneShotEffect { } } if (passed) { - LinkedList aurasToAttach = new LinkedList(); + LinkedList aurasToAttach = new LinkedList<>(); aurasToAttach.addAll(auras); for (UUID auraId : aurasToAttach) { @@ -158,10 +158,12 @@ class GlamerSpinnersEffect extends OneShotEffect { } return true; } + game.informPlayers(sourcePermanent.getLogName() + ": No enchantments were moved from the target permanent."); } } + return true; } - game.informPlayers("Glamer Spinners: No enchantments were moved from the target permanent."); + return false; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java new file mode 100644 index 00000000000..8e687a50e95 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java @@ -0,0 +1,80 @@ +/* + * 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.abilities.oneshot.counter; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class MovingCounterTest extends CardTestPlayerBase { + + /** + * I'm having an issue when using Bioshift to move only a portion of + * counters to another creature. When I attempt to do this, it moves all of + * the counters (and in some cases with my Simic deck) kills the creature. + */ + @Test + public void testCantBeCounteredNormal() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + + // Move any number of +1/+1 counters from target creature onto another target creature with the same controller. + addCard(Zone.HAND, playerA, "Bioshift", 1); + + // Protean Hydra enters the battlefield with X +1/+1 counters on it. + // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it. + // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step. + addCard(Zone.HAND, playerA, "Protean Hydra", 1); + + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra"); + setChoice(playerA, "X=4"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bioshift", "Protean Hydra^Silvercoat Lion"); + setChoice(playerA, "X=2"); + + setStopAt(2, PhaseStep.UPKEEP); + execute(); + + assertGraveyardCount(playerA, "Bioshift", 1); + + assertPermanentCount(playerA, "Silvercoat Lion", 1); + assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); // added 2 counters + + assertPermanentCount(playerA, "Protean Hydra", 1); + assertPowerToughness(playerA, "Protean Hydra", 6, 6); // started with 4, removed 2, added 4 at end = 6 + + + } + +} \ No newline at end of file From 8caa3087bdae2fea19391ea1b935debb7f1c6686 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jun 2015 17:00:21 +0200 Subject: [PATCH 099/148] * Some minor changes, some fixes to Dideon Battle-Forged. --- .../src/mage/sets/magicorigins/GideonBattleForged.java | 10 ++++++++++ .../src/mage/sets/zendikar/PyromancerAscension.java | 2 +- .../effects/common/CopyTargetSpellEffect.java | 5 +++-- Mage/src/mage/abilities/keyword/StormAbility.java | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java index 5c291b6c299..729c7ca129d 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java @@ -88,6 +88,7 @@ public class GideonBattleForged extends CardImpl { Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn); effect.setText("Until your next turn, target creature gains indestructible"); loyaltyAbility = new LoyaltyAbility(effect, 1); + loyaltyAbility.addTarget(new TargetCreaturePermanent()); effect = new UntapTargetEffect(); effect.setText("Untap that creature"); loyaltyAbility.addEffect(effect); @@ -149,6 +150,9 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { @Override public boolean isInactive(Ability source, Game game) { + if (targetPermanentReference == null) { + return true; + } Permanent targetPermanent = targetPermanentReference.getPermanent(game); if (targetPermanent == null) { return false; @@ -158,6 +162,12 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { } return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController; } + + @Override + public void init(Ability source, Game game) { + targetPermanentReference = new MageObjectReference(getTargetPointer().getFirst(game, source), game); + super.init(source, game); + } @Override public boolean applies(Permanent permanent, Ability source, Game game) { diff --git a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java index 5eb3676dc2a..55898b1d78c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java @@ -54,9 +54,9 @@ public class PyromancerAscension extends CardImpl { super(ownerId, 143, "Pyromancer Ascension", Rarity.RARE, new CardType[] { CardType.ENCHANTMENT }, "{1}{R}"); this.expansionSetCode = "ZEN"; - // Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on Pyromancer Ascension. this.addAbility(new PyromancerAscensionQuestTriggeredAbility()); + // Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy. this.addAbility(new PyromancerAscensionCopyTriggeredAbility()); } diff --git a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java index 2037ef3833e..6d02c2cb8e0 100644 --- a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java @@ -69,8 +69,9 @@ public class CopyTargetSpellEffect extends OneShotEffect { if (activateMessage.startsWith(" casts ")) { activateMessage = activateMessage.substring(6); } - if (!game.isSimulation()) - game.informPlayers(player.getLogName() + " copies " + activateMessage); + if (!game.isSimulation()) { + game.informPlayers(player.getLogName() + activateMessage); + } return true; } return false; diff --git a/Mage/src/mage/abilities/keyword/StormAbility.java b/Mage/src/mage/abilities/keyword/StormAbility.java index 10377a0b1f9..df0352dece5 100644 --- a/Mage/src/mage/abilities/keyword/StormAbility.java +++ b/Mage/src/mage/abilities/keyword/StormAbility.java @@ -69,8 +69,8 @@ public class StormAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getSourceId().equals(this.sourceId)) { - StackObject spell = game.getStack().getStackObject(this.sourceId); + if (event.getSourceId().equals(getSourceId())) { + StackObject spell = game.getStack().getStackObject(getSourceId()); if (spell instanceof Spell) { for (Effect effect : this.getEffects()) { effect.setValue("StormSpell", spell); @@ -108,7 +108,7 @@ class StormEffect extends OneShotEffect { Spell spell = (Spell) this.getValue("StormSpell"); if (spell != null) { if (!game.isSimulation()) { - game.informPlayers("Storm: " + spell.getName() + " will be copied " + stormCount + " time" + (stormCount > 1 ?"s":"")); + game.informPlayers("Storm: " + spell.getLogName() + " will be copied " + stormCount + " time" + (stormCount > 1 ?"s":"")); } for (int i = 0; i < stormCount; i++) { Spell copy = spell.copySpell(); From 1fb56df894671cf18219cb2b96be34df518de288 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 19:25:48 +0300 Subject: [PATCH 100/148] Some tooltip fixes --- Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java | 2 +- Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java | 4 ++-- Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java index d736ece2f8d..12f7fedf8ad 100644 --- a/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java +++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java @@ -80,7 +80,7 @@ class LlanowarEmpathEffect extends OneShotEffect { public LlanowarEmpathEffect() { super(Outcome.Benefit); - this.staticText = "reveal the top card of your library. If it's a creature card, put it into your hand."; + this.staticText = ", then reveal the top card of your library. If it's a creature card, put it into your hand."; } public LlanowarEmpathEffect(final LlanowarEmpathEffect effect) { diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java index 753c475ff9b..7dea5c1fd8f 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java @@ -60,10 +60,10 @@ public class PowerMatrix extends CardImpl { effect.setText("Target creature gets +1/+1"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); - effect.setText("and gains flying,"); + effect.setText("and gains flying"); ability.addEffect(effect); effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn); - effect.setText("first strike,"); + effect.setText(", first strike,"); ability.addEffect(effect); effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); effect.setText("and trample until end of turn."); diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java index 8536466c70b..70af01ee4ff 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java @@ -80,7 +80,7 @@ class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl { KaerveksTorchCostIncreaseEffect() { super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.INCREASE_COST); - staticText = "Spells that target Kaervek's Torch cost {2} more to cast"; + staticText = "Spells that target {this} cost {2} more to cast"; } KaerveksTorchCostIncreaseEffect(KaerveksTorchCostIncreaseEffect effect) { From 81744a31a7638b43184e64e6ec1f466c2a7165d4 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 19:30:31 +0300 Subject: [PATCH 101/148] Add null check for player --- .../src/mage/sets/timespiral/SengirNosferatu.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java index 7767552a68c..725eb972356 100644 --- a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java +++ b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java @@ -31,9 +31,9 @@ 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.costs.common.ExileSourceCost; import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; @@ -48,6 +48,7 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.game.permanent.token.Token; +import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCardInExile; @@ -132,10 +133,13 @@ class ReturnSengirNosferatuEffect extends OneShotEffect { if(!target.canChoose(source.getSourceId(), controllerId, game)) { return false; } - game.getPlayer(controllerId).chooseTarget(Outcome.PutCreatureInPlay, target, source, game); - Card card = game.getCard(target.getTargets().get(0)); - if(card != null) { - return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); + Player player = game.getPlayer(controllerId); + if(player != null) { + player.chooseTarget(Outcome.PutCreatureInPlay, target, source, game); + Card card = game.getCard(target.getTargets().get(0)); + if(card != null) { + return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); + } } return false; } From ee7cb581a2a9a851f49fdad6828fe1cc7eb89d2a Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 21:40:12 +0300 Subject: [PATCH 102/148] Fix Errantry tooltip text --- Mage.Sets/src/mage/sets/masterseditionii/Errantry.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java index 923902b513c..b9214d5aa2a 100644 --- a/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java +++ b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java @@ -30,6 +30,7 @@ package mage.sets.masterseditionii; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; @@ -64,8 +65,11 @@ public class Errantry extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +3/+0 and can only attack alone. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(CanAttackOnlyAloneAbility.getInstance(), AttachmentType.AURA))); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield)); + Effect effect = new GainAbilityAttachedEffect(CanAttackOnlyAloneAbility.getInstance(), AttachmentType.AURA); + effect.setText("and can only attack alone."); + ability.addEffect(effect); + this.addAbility(ability); } public Errantry(final Errantry card) { From f194af03216a47988a4165387fccbaed3dedb493 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 18 Jun 2015 21:40:38 +0300 Subject: [PATCH 103/148] Fix Kaervek's Torch vs. multi-mode spells like Cryptic Command --- .../src/mage/sets/vintagemasters/KaerveksTorch.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java index 70af01ee4ff..d94e06339c3 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java @@ -97,13 +97,16 @@ class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl { public boolean applies(Ability abilityToModify, Ability source, Game game) { if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) { - for(Target target: abilityToModify.getTargets()) { - for(UUID id: target.getTargets()) { - if(id.equals(source.getSourceObject(game).getId())) { - return true; + for(UUID modeId: abilityToModify.getModes().getSelectedModes()) { + abilityToModify.getModes().setActiveMode(modeId); + for(Target target: abilityToModify.getTargets()) { + for(UUID id: target.getTargets()) { + if(id.equals(source.getSourceObject(game).getId())) { + return true; + } } } - } + } } return false; } From 42cf7f1f4e7087cca0bf09f5bc8e4cbef9876ceb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jun 2015 22:42:13 +0200 Subject: [PATCH 104/148] Fixed possible npe, added some tests. --- .../mirrodinbesieged/BlackSunsZenith.java | 1 + .../sets/mirrodinbesieged/BlueSunsZenith.java | 1 + .../test/AI/basic/CostModificationTest.java | 64 +++++++++++++++++++ .../test/cards/triggers/SpellskiteTest.java | 41 ++++++++++++ .../effects/common/ShuffleSpellEffect.java | 16 +++-- 5 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java index 410eaa83e94..c344a161b43 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java @@ -51,6 +51,7 @@ public class BlackSunsZenith extends CardImpl { super(ownerId, 39, "Black Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); this.expansionSetCode = "MBS"; + // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library. this.getSpellAbility().addEffect(new BlackSunsZenithEffect()); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java index 6f0f4e2ac2a..ec71848b5b5 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java @@ -47,6 +47,7 @@ public class BlueSunsZenith extends CardImpl { super(ownerId, 20, "Blue Sun's Zenith", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}"); this.expansionSetCode = "MBS"; + // Target player draws X cards. Shuffle Blue Sun's Zenith into its owner's library. this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue())); this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance()); this.getSpellAbility().addTarget(new TargetPlayer()); diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java new file mode 100644 index 00000000000..82c1889c081 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.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 org.mage.test.AI.basic; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBaseAI; + +/** + * + * @author LevelX2 + */ + +public class CostModificationTest extends CardTestPlayerBaseAI { + + /** + * There seems to be a problem when playing Fluctuator against Computer. + * Once played, I am stuck at "Waiting for Computer" forever... + */ + @Test + public void testFluctuator() { + addCard(Zone.HAND, playerA, "Silvercoat Lion"); + // Destroy all artifacts, creatures, and enchantments. + // Cycling ({3}, Discard this card: Draw a card.) + addCard(Zone.HAND, playerA, "Akroma's Vengeance"); + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + // Cycling abilities you activate cost you up to {2} less to activate. + addCard(Zone.BATTLEFIELD, playerA, "Fluctuator"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Akroma's Vengeance", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java index 7884d15402b..083a1936058 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java @@ -113,4 +113,45 @@ public class SpellskiteTest extends CardTestPlayerBase { } + /** + * Spellskite fails to redirect Cryptic Command on itself + */ + @Test + public void testSpellskite() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + // Choose two - + // Counter target spell; + // or return target permanent to its owner's hand; + // or tap all creatures your opponents control; + // or draw a card. + addCard(Zone.HAND, playerA, "Cryptic Command"); + + addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Island", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=1Lightning Bolt^mode=2Silvercoat Lion", "Lightning Bolt"); + setModeChoice(playerA, "1"); // Counter target spell + setModeChoice(playerA, "2"); // return target permanent to its owner's hand + + activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Cryptic Command"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + + assertGraveyardCount(playerA, "Cryptic Command", 1); + + assertHandCount(playerB, "Spellskite", 1); + assertPermanentCount(playerB, "Silvercoat Lion", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java index ef4b9ae1bfa..47b4322115a 100644 --- a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java +++ b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java @@ -35,6 +35,7 @@ import mage.cards.Card; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; +import mage.game.stack.Spell; import mage.players.Player; /** @@ -58,12 +59,15 @@ public class ShuffleSpellEffect extends OneShotEffect implements MageSingleton { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); - if (spellCard != null) { - Player owner = game.getPlayer(spellCard.getOwnerId()); - if (owner != null) { - controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true); - owner.shuffleLibrary(game); + Spell spell = game.getStack().getSpell(source.getSourceId()); + if (spell != null) { + Card spellCard = spell.getCard(); + if (spellCard != null) { + Player owner = game.getPlayer(spellCard.getOwnerId()); + if (owner != null) { + controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true); + owner.shuffleLibrary(game); + } } } return true; From 359f47a99d381cf5f9da827333845ea3904731c0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 00:04:24 +0200 Subject: [PATCH 105/148] Fixed Gideon Battle-Forge. --- .../sets/magicorigins/GideonBattleForged.java | 17 +++-- .../AddingCountersToPermanentsTest.java | 72 +++++++++++++++++++ 2 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java index 729c7ca129d..67c718987ce 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java +++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java @@ -155,18 +155,25 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { } Permanent targetPermanent = targetPermanentReference.getPermanent(game); if (targetPermanent == null) { - return false; + return true; } if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) { nextTurnTargetController = game.getTurnNum(); } - return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController; + if (game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController) { + return true; + } + return false; } @Override public void init(Ability source, Game game) { - targetPermanentReference = new MageObjectReference(getTargetPointer().getFirst(game, source), game); super.init(source, game); + if (getTargetPointer().getFirst(game, source) == null) { + discard(); + } else { + targetPermanentReference = new MageObjectReference(getTargetPointer().getFirst(game, source), game); + } } @Override @@ -175,9 +182,7 @@ class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect { if (game.getActivePlayerId().equals(permanent.getControllerId())) { Permanent planeswalker = game.getPermanent(source.getSourceId()); if (planeswalker != null) { - if (planeswalker.getCardType().contains(CardType.CREATURE)) { - return true; - } + return true; } else { discard(); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java new file mode 100644 index 00000000000..ecd169b3272 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package org.mage.test.cards.abilities.oneshot.counter; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class AddingCountersToPermanentsTest extends CardTestPlayerBase { + + @Test + public void testBlackSunsZenith() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Witch's Familiar", 1); + + // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library. + addCard(Zone.HAND, playerA, "Black Sun's Zenith", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerB, "Witch's Familiar", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Black Sun's Zenith"); + setChoice(playerA, "X=2"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + + assertPermanentCount(playerA, "Witch's Familiar", 1); + assertPowerToughness(playerA, "Witch's Familiar", 0, 1); + + assertPermanentCount(playerB, "Witch's Familiar", 1); + assertPowerToughness(playerB, "Witch's Familiar", 0, 1); + + + } + +} \ No newline at end of file From 9b53f239db258b5e759e5ef068a3bd0f82f70ced Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 00:11:43 +0200 Subject: [PATCH 106/148] [ORI] Updated mtg-cards-data.txt (87 cards). --- Utils/mtg-cards-data.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 8073fae95d8..7539be256da 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -26196,7 +26196,7 @@ Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Ta Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."| Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.| Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.| -Gideon, Battle-Forged|Magic Origins|023|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| +Gideon, Battle-Forged|Magic Origins|23|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.| Kytheon, Hero of Akros|Magic Origins|23|M|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.| Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance (Attacking doesn't cause this creature to tap.)$At the beginning of combat on each opponent's turn, tap target creature that player controls.| Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.| @@ -26225,6 +26225,7 @@ Cruel Revival|Magic Origins|?|C|{4}{B}{4}{B}|Instant|||Destroy target non-Zombie Weight of the Underworld|Magic Origins|?|C|{3}{B}{3}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -3/-2.$Enchant creature$Enchanted creature gets -3/-2.| Deadbridge Shaman|Magic Origins|91|C|{2}{B}|Creature - Elf Shaman|3|1|When Deadbridge Shaman dies, target opponent discards a card.| Eyeblight Assassin|Magic Origins|95|C|{2}{B}|Creature - Elf Assassin|2|2|When Eyeblight Assassin enters the battlefield, target creature an opponent controls gets -1/-1 until end of turn.| +Infernal Scarring|Magic Origins|102|C|{1}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+0 and has "When this creature dies, draw a card."| Liliana, Defiant Necromancer|Magic Origins|106|M||Planeswalker - Liliana|3|+2: Each player discards a card.$-X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.$-8: You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."| Liliana, Heretical Healer|Magic Origins|106|M|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.| Malakir Cullblade|Magic Origins|108|U|{1}{B}|Creature - Vampire Warrior|1|1|Whenever a creature an opponent controls dies, put a +1/+1 counter on Malakir Cullblade.| @@ -26236,19 +26237,20 @@ Mind Rot|Magic Origins|281|C|{2}{B}{2}{B}|Sorcery|||Target player discards two c Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.$Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.| Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.| Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.| -Chandra's Fury|Magic Origins|?|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| -Chandra's Ignition|Magic Origins|?|R|{3}{R}{R}{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.$Target creature you control deals damage equal to its power to each other creature and each opponent.| Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2|| Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.| -Ravaging Blaze|Magic Origins|?|U|{X}{R}{R}{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.$Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.| Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.| Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.| Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.| Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace (This creature can't be blocked except by two or more creatures.)| Chandra, Fire of Kaladesh|Magic Origins|135|M|{1}{R}{R}{1}{R}{R}|Legendary Creature - Human Shaman|2|22|2|Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.$Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.| Chandra, Roaring Flame|Magic Origins|135|M||Planeswalker - Chandra|44|+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."$+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."| +Chandra's Fury|Magic Origins|136|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.| +Chandra's Ignition|Magic Origins|137|R|{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.| Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.| Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.| +Pia and Kiran Nalaar|Magic Origins|157|R|{2}{R}{R}|Legendary Creature - Human Artificer|2|2|When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.${2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.| +Ravaging Blaze|Magic Origins|159|U|{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.| Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.| Subterranean Scout|Magic Origins|164|C|{1}{R}|Creature - Goblin Scout|2|1|When Subterranean Scout enters the battlefield, target creature with power 2 or less can't be blocked this turn.| Volcanic Rambler|Magic Origins|167|C|{5}{R}|Creature - Elemental|6|4|{2}{R}: Volcanic Rambler deals 1 damage to target player.| @@ -26260,6 +26262,7 @@ Titanic Growth|Magic Origins|?|C|{1}{G}{1}{G}|Instant|||Target creature gets +4/ Vastwood Gorger|Magic Origins|?|C|{5}{G}{5}{G}|Creature - Wurm|5|65|6|| Yeva's Forcemage|Magic Origins|?|C|{2}{G}{2}{G}|Creature - Elf Shaman|2|22|2|When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.$When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.| Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.| +Dwynen, Gilt-Leaf Daen|Magic Origins|172|R|{2}{G}{G}|Legendary Creature - Elf Warrior|3|4|Reach$Other Elf creatures you control get +1/+1.$Whenever Dwynen, Gilt-Leaf Daen attacks, you gain 1 life for each attacking Elf you control.| Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach| Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.| Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.| From fe25b8c38ba9b8a05a9f417739650f7082d11bac Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 00:34:37 +0200 Subject: [PATCH 107/148] [ORI] Added Chandra's Ignition and Avaricious Dragon. --- .../sets/magicorigins/AvariciousDragon.java | 72 +++++++++++++ .../sets/magicorigins/ChandrasIgnition.java | 102 ++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java b/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java new file mode 100644 index 00000000000..6b63ce07dee --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfDrawTriggeredAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.discard.DiscardHandControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class AvariciousDragon extends CardImpl { + + public AvariciousDragon(UUID ownerId) { + super(ownerId, 131, "Avaricious Dragon", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your draw step, draw an additional card. + this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false)); + // At the beginning of your end step, discard your hand. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new DiscardHandControllerEffect(), TargetController.YOU, false)); + } + + public AvariciousDragon(final AvariciousDragon card) { + super(card); + } + + @Override + public AvariciousDragon copy() { + return new AvariciousDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java new file mode 100644 index 00000000000..b6c28101735 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java @@ -0,0 +1,102 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ChandrasIgnition extends CardImpl { + + public ChandrasIgnition(UUID ownerId) { + super(ownerId, 137, "Chandra's Ignition", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "ORI"; + + // Target creature you control deals damage equal to its power to each other creature and each opponent. + this.getSpellAbility().addEffect(new ChandrasIgnitionEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + public ChandrasIgnition(final ChandrasIgnition card) { + super(card); + } + + @Override + public ChandrasIgnition copy() { + return new ChandrasIgnition(this); + } +} + +class ChandrasIgnitionEffect extends OneShotEffect { + + public ChandrasIgnitionEffect() { + super(Outcome.Benefit); + this.staticText = "Target creature you control deals damage equal to its power to each other creature and each opponent"; + } + + public ChandrasIgnitionEffect(final ChandrasIgnitionEffect effect) { + super(effect); + } + + @Override + public ChandrasIgnitionEffect copy() { + return new ChandrasIgnitionEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (targetCreature != null && targetCreature.getPower().getValue() > 0) { + for (Permanent creature : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + if (!creature.getId().equals(targetCreature.getId())) { + creature.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true); + } + } + for(UUID opponentId : game.getOpponents(source.getControllerId())) { + Player opponent = game.getPlayer(opponentId); + if (opponent != null) { + opponent.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true); + } + } + } + return true; + } +} From f8c478aa76221e829faed88ec5d98e02e2659e1f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 00:37:56 +0200 Subject: [PATCH 108/148] * Dulcet Sirens - Added the missing tap cost. --- Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java b/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java index af27c34f58d..3279b98d431 100644 --- a/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java +++ b/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java @@ -31,6 +31,7 @@ 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.RequirementEffect; import mage.abilities.keyword.MorphAbility; @@ -61,6 +62,7 @@ public class DulcetSirens extends CardImpl { // {U}, {T}: Target creature attacks target opponent this turn if able. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DulcetSirensForceAttackEffect(Duration.EndOfTurn), new ManaCostsImpl("{U}")); + ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); ability.addTarget(new TargetOpponent()); this.addAbility(ability); From 7a4d4265a45f9cfb93e10f0dcd595c1bbf521deb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 00:52:03 +0200 Subject: [PATCH 109/148] Added a test. --- .../src/mage/sets/urzassaga/Fecundity.java | 1 - .../cards/triggers/dies/FecundityTest.java | 65 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java diff --git a/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java b/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java index 5de2da03f66..488fa3ab478 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java @@ -50,7 +50,6 @@ public class Fecundity extends CardImpl { super(ownerId, 251, "Fecundity", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.expansionSetCode = "USG"; - // Whenever a creature dies, that creature's controller may draw a card. this.addAbility(new DiesCreatureTriggeredAbility(new FecundityEffect(), false, false, true)); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java new file mode 100644 index 00000000000..cf68ca2549e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java @@ -0,0 +1,65 @@ +package org.mage.test.cards.triggers.dies; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/* + * 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. + */ + +/** + * + * @author LevelX2 + */ + +public class FecundityTest extends CardTestPlayerBase { + + /** + * + */ + @Test + public void testOpponentDrawsACard() { + addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt", 1); + // Whenever a creature dies, that creature's controller may draw a card. + addCard(Zone.BATTLEFIELD, playerB, "Fecundity", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + assertGraveyardCount(playerA, "Silvercoat Lion", 1); + + assertHandCount(playerA, 1); + } + +} From ad32dec79a0aefefac8093921b5310b05bbde0db Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:16:34 -0400 Subject: [PATCH 110/148] Onulet and Horn of Deafening implemented --- .../src/mage/sets/antiquities/Onulet.java | 54 ++++++++++++++ .../src/mage/sets/fourthedition/Onulet.java | 54 ++++++++++++++ .../mage/sets/legends/HornOfDeafening.java | 70 +++++++++++++++++++ .../src/mage/sets/mastersedition/Onulet.java | 63 +++++++++++++++++ .../masterseditioniv/HornOfDeafening.java | 54 ++++++++++++++ .../mage/sets/masterseditioniv/Onulet.java | 52 ++++++++++++++ .../src/mage/sets/revisededition/Onulet.java | 54 ++++++++++++++ 7 files changed, 401 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/legends/HornOfDeafening.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Onulet.java diff --git a/Mage.Sets/src/mage/sets/antiquities/Onulet.java b/Mage.Sets/src/mage/sets/antiquities/Onulet.java new file mode 100644 index 00000000000..d27a886f10f --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/Onulet.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Onulet.java b/Mage.Sets/src/mage/sets/fourthedition/Onulet.java new file mode 100644 index 00000000000..f058249f256 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Onulet.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.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 358; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java new file mode 100644 index 00000000000..4ce8837efc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java @@ -0,0 +1,70 @@ +/* + * 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.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class HornOfDeafening extends CardImpl { + + public HornOfDeafening(UUID ownerId) { + super(ownerId, 224, "Horn of Deafening", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "LEG"; + + // {2}, {tap}: Prevent all combat damage that would be dealt by target creature this turn. + 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("{2}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public HornOfDeafening(final HornOfDeafening card) { + super(card); + } + + @Override + public HornOfDeafening copy() { + return new HornOfDeafening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Onulet.java b/Mage.Sets/src/mage/sets/mastersedition/Onulet.java new file mode 100644 index 00000000000..26d81b2f413 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Onulet.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.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends CardImpl { + + public Onulet(UUID ownerId) { + super(ownerId, 161, "Onulet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MED"; + this.subtype.add("Construct"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Onulet dies, you gain 2 life. + this.addAbility(new DiesTriggeredAbility(new GainLifeEffect(2))); + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java new file mode 100644 index 00000000000..0b311293e79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class HornOfDeafening extends mage.sets.legends.HornOfDeafening { + + public HornOfDeafening(UUID ownerId) { + super(ownerId); + this.cardNumber = 205; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public HornOfDeafening(final HornOfDeafening card) { + super(card); + } + + @Override + public HornOfDeafening copy() { + return new HornOfDeafening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java new file mode 100644 index 00000000000..c60fa210652 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 219; + this.expansionSetCode = "ME4"; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Onulet.java b/Mage.Sets/src/mage/sets/revisededition/Onulet.java new file mode 100644 index 00000000000..9289aa7ff50 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Onulet.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.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.RARE; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} From 63d1aa716ecc90d87da618d18502c8f3498ff165 Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:36:03 -0400 Subject: [PATCH 111/148] Serra Aviary and Staff of Zegon added --- .../mage/sets/antiquities/StaffOfZegon.java | 52 ++++++++++++++ .../src/mage/sets/homelands/SerraAviary.java | 71 +++++++++++++++++++ .../sets/masterseditioniv/SerraAviary.java | 54 ++++++++++++++ .../sets/masterseditioniv/StaffOfZegon.java | 66 +++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java create mode 100644 Mage.Sets/src/mage/sets/homelands/SerraAviary.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java diff --git a/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java new file mode 100644 index 00000000000..e1e494a7351 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.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.antiquities; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class StaffOfZegon extends mage.sets.masterseditioniv.StaffOfZegon { + + public StaffOfZegon(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "ATQ"; + } + + public StaffOfZegon(final StaffOfZegon card) { + super(card); + } + + @Override + public StaffOfZegon copy() { + return new StaffOfZegon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/SerraAviary.java b/Mage.Sets/src/mage/sets/homelands/SerraAviary.java new file mode 100644 index 00000000000..56700a59dbd --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/SerraAviary.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.homelands; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +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; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author anonymous + */ +public class SerraAviary extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Creatures with flying"); + + static { + filter1.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SerraAviary(UUID ownerId) { + super(ownerId, 118, "Serra Aviary", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "HML"; + this.supertype.add("World"); + + // Creatures with flying get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter1, false))); + } + + public SerraAviary(final SerraAviary card) { + super(card); + } + + @Override + public SerraAviary copy() { + return new SerraAviary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java new file mode 100644 index 00000000000..466ff99dd01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class SerraAviary extends mage.sets.homelands.SerraAviary { + + public SerraAviary(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public SerraAviary(final SerraAviary card) { + super(card); + } + + @Override + public SerraAviary copy() { + return new SerraAviary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java new file mode 100644 index 00000000000..98ad22ed8a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.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.masterseditioniv; + +import java.util.UUID; +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.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class StaffOfZegon extends CardImpl { + + public StaffOfZegon(UUID ownerId) { + super(ownerId, 229, "Staff of Zegon", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "ME4"; + + // {3}, {tap}: Target creature gets -2/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-2, 0, Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public StaffOfZegon(final StaffOfZegon card) { + super(card); + } + + @Override + public StaffOfZegon copy() { + return new StaffOfZegon(this); + } +} From b825ec18088bbf6dddaae45aede05b7a9f55f388 Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:39:49 -0400 Subject: [PATCH 112/148] Acid Rain added --- Mage.Sets/src/mage/sets/legends/AcidRain.java | 65 +++++++++++++++++++ .../mage/sets/masterseditioniv/AcidRain.java | 52 +++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legends/AcidRain.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java diff --git a/Mage.Sets/src/mage/sets/legends/AcidRain.java b/Mage.Sets/src/mage/sets/legends/AcidRain.java new file mode 100644 index 00000000000..77cbd23ba5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AcidRain.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.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author anonymous + */ +public class AcidRain extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Forests"); + static { + filter.add(new SubtypePredicate("Forests")); + } + + public AcidRain(UUID ownerId) { + super(ownerId, 44, "Acid Rain", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "LEG"; + + // Destroy all Forests. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public AcidRain(final AcidRain card) { + super(card); + } + + @Override + public AcidRain copy() { + return new AcidRain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java new file mode 100644 index 00000000000..3364fb827a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AcidRain extends mage.sets.legends.AcidRain { + + public AcidRain(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "ME4"; + } + + public AcidRain(final AcidRain card) { + super(card); + } + + @Override + public AcidRain copy() { + return new AcidRain(this); + } +} From dffda98c909c980d5a4acdb16de64db22db501fe Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:43:15 -0400 Subject: [PATCH 113/148] Cloud Dragon added --- .../sets/masterseditioniv/CloudDragon.java | 66 +++++++++++++++++++ .../src/mage/sets/portal/CloudDragon.java | 52 +++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java create mode 100644 Mage.Sets/src/mage/sets/portal/CloudDragon.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java new file mode 100644 index 00000000000..346ed2c10a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class CloudDragon extends CardImpl { + + public CloudDragon(UUID ownerId) { + super(ownerId, 41, "Cloud Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Illusion"); + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cloud Dragon can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public CloudDragon(final CloudDragon card) { + super(card); + } + + @Override + public CloudDragon copy() { + return new CloudDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CloudDragon.java b/Mage.Sets/src/mage/sets/portal/CloudDragon.java new file mode 100644 index 00000000000..0f296f7deae --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CloudDragon.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.portal; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class CloudDragon extends mage.sets.masterseditioniv.CloudDragon { + + public CloudDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "POR"; + } + + public CloudDragon(final CloudDragon card) { + super(card); + } + + @Override + public CloudDragon copy() { + return new CloudDragon(this); + } +} From 78b018679c30842cc62f53ea2e59647d4cfd0311 Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:48:32 -0400 Subject: [PATCH 114/148] Phantasmal Forces added --- .../sets/fifthedition/PhantasmalForces.java | 52 ++++++++++++++ .../sets/fourthedition/PhantasmalForces.java | 68 +++++++++++++++++++ .../sets/limitedalpha/PhantasmalForces.java | 52 ++++++++++++++ .../sets/limitedbeta/PhantasmalForces.java | 52 ++++++++++++++ .../masterseditioniv/PhantasmalForces.java | 54 +++++++++++++++ .../sets/revisededition/PhantasmalForces.java | 52 ++++++++++++++ .../unlimitededition/PhantasmalForces.java | 52 ++++++++++++++ 7 files changed, 382 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java new file mode 100644 index 00000000000..66a87d3c2c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "5ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java new file mode 100644 index 00000000000..eb4c8632ca2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.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.fourthedition; + +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.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends CardImpl { + + public PhantasmalForces(UUID ownerId) { + super(ownerId, 88, "Phantasmal Forces", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Illusion"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Phantasmal Forces unless you pay {U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), TargetController.YOU, false)); + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java new file mode 100644 index 00000000000..2a21c51caf1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "LEA"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java new file mode 100644 index 00000000000..26f73deb1c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "LEB"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java new file mode 100644 index 00000000000..a0423b8bc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java new file mode 100644 index 00000000000..2dd68aefcc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.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.revisededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "3ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java new file mode 100644 index 00000000000..bfcfed29b27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "2ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} From cfd92dc8d5a9b987fac2129aa6c70e410fdc78e6 Mon Sep 17 00:00:00 2001 From: emerald000 Date: Fri, 19 Jun 2015 02:29:16 -0400 Subject: [PATCH 115/148] Made TriggeredAbility.checkEventType() abstract. Added missing implementations. --- .../sets/alarareborn/Crystallization.java | 22 ++--- .../sets/alarareborn/DragonAppeasement.java | 14 ++-- .../mage/sets/alarareborn/EnigmaSphinx.java | 36 +++++---- .../src/mage/sets/alarareborn/FinestHour.java | 28 ++++--- .../sets/alarareborn/GloryscaleViashino.java | 23 +++--- .../mage/sets/alarareborn/MycoidShepherd.java | 43 +++++----- .../mage/sets/alarareborn/SigilCaptain.java | 28 ++++--- .../alarareborn/SovereignsOfLostAlara.java | 20 ++--- .../mage/sets/alarareborn/Thraximundar.java | 15 ++-- .../sets/alarareborn/TraceOfAbundance.java | 17 ++-- .../alarareborn/UnscytheKillerOfKings.java | 8 +- .../mage/sets/alarareborn/VedalkenGhoul.java | 8 +- .../src/mage/sets/apocalypse/BogGnarr.java | 20 ++--- .../src/mage/sets/apocalypse/GladeGnarr.java | 22 ++--- .../sets/avacynrestored/ExquisiteBlood.java | 15 ++-- .../sets/avacynrestored/HavengulSkaab.java | 15 ++-- .../sets/avacynrestored/LoneRevenant.java | 9 ++- .../sets/avacynrestored/SpectralPrison.java | 32 ++++---- .../betrayersofkamigawa/JettingGlasskite.java | 14 ++-- .../KamiOfTheHonoredDead.java | 19 +++-- .../KiraGreatGlassSpinner.java | 21 +++-- .../betrayersofkamigawa/MarkOfSakiko.java | 26 +++--- .../betrayersofkamigawa/MistbladeShinobi.java | 15 ++-- .../PatronOfTheNezumi.java | 27 ++++--- .../betrayersofkamigawa/RoninWarclub.java | 44 +++++----- .../SakikoMotherOfSummer.java | 28 ++++--- .../ShimmeringGlasskite.java | 14 ++-- .../ShireiShizosCaretaker.java | 31 +++---- .../betrayersofkamigawa/Skullsnatcher.java | 14 ++-- .../betrayersofkamigawa/ThroatSlitter.java | 15 ++-- .../sets/bornofthegods/PerplexingChimera.java | 8 +- .../mage/sets/bornofthegods/SearingBlood.java | 7 +- .../sets/bornofthegods/SpitefulReturned.java | 35 ++++---- .../championsofkamigawa/AkkiLavarunner.java | 24 +++--- .../championsofkamigawa/AkkiUnderminer.java | 23 +++--- .../championsofkamigawa/GlimpseOfNature.java | 13 ++- .../GodoBanditWarlord.java | 13 ++- .../championsofkamigawa/HorobiDeathsWail.java | 15 ++-- .../sets/championsofkamigawa/KusariGama.java | 21 ++--- .../sets/championsofkamigawa/NaturesWill.java | 10 ++- .../sets/championsofkamigawa/RaggedVeins.java | 29 ++++--- .../SeshiroTheAnointed.java | 21 ++--- .../SosukeSonOfSeshiro.java | 29 ++++--- .../TatsumasaTheDragonsFang.java | 8 +- .../sets/championsofkamigawa/TideOfWar.java | 14 ++-- .../championsofkamigawa/ZoZuThePunisher.java | 25 +++--- .../mage/sets/coldsnap/AdarkarValkyrie.java | 18 +++-- .../sets/coldsnap/DarienKingOfKjeldor.java | 14 +++- .../mage/sets/coldsnap/FuryOfTheHorde.java | 6 ++ .../sets/commander/EdricSpymasterOfTrest.java | 9 ++- .../mage/sets/commander/KaaliaOfTheVast.java | 13 ++- .../src/mage/sets/commander/SewerNemesis.java | 26 +++--- .../mage/sets/commander2013/CurseOfChaos.java | 21 ++--- .../sets/commander2013/CurseOfPredation.java | 35 ++++---- .../commander2013/CurseOfShallowGraves.java | 22 ++--- .../commander2013/CurseOfTheForsaken.java | 35 ++++---- .../DereviEmpyrialTactician.java | 6 ++ .../sets/commander2013/GahijiHonoredOne.java | 31 +++---- .../src/mage/sets/commander2013/Mirari.java | 8 +- .../mage/sets/commander2013/PlagueBoiler.java | 7 +- .../sets/commander2013/Reincarnation.java | 7 +- .../mage/sets/commander2013/SunDroplet.java | 8 +- .../sets/commander2013/WidespreadPanic.java | 15 ++-- .../commander2014/DarettiScrapSavant.java | 23 +++--- .../src/mage/sets/conflux/BloodTyrant.java | 7 +- .../src/mage/sets/conflux/BloodhallOoze.java | 23 ++++-- .../src/mage/sets/conflux/CorruptedRoots.java | 22 ++--- .../src/mage/sets/conflux/FontOfMythos.java | 23 +++--- .../mage/sets/conflux/KederektParasite.java | 13 ++- .../src/mage/sets/conflux/ParasiticStrix.java | 10 ++- .../src/mage/sets/conflux/QuenchableFire.java | 15 ++-- .../src/mage/sets/conflux/SludgeStrider.java | 6 ++ .../src/mage/sets/conspiracy/DackFayden.java | 8 +- .../sets/darkascension/AvacynsCollar.java | 18 +++-- .../sets/darkascension/CurseOfThirst.java | 23 +++--- .../sets/darkascension/DiregrafCaptain.java | 15 ++-- .../sets/darkascension/DrogskolReaver.java | 8 +- .../darkascension/FlayerOfTheHatebound.java | 31 +++---- .../mage/sets/darkascension/HavengulLich.java | 8 +- .../mage/sets/darkascension/Hellrider.java | 24 +++--- .../sets/darkascension/JarOfEyeballs.java | 17 ++-- .../mage/sets/darkascension/Shriekgeist.java | 24 +++--- .../mage/sets/darkascension/SoulSeizer.java | 35 ++++---- .../sets/darkascension/SpitefulShadows.java | 28 ++++--- .../darkascension/TovolarsMagehunter.java | 16 ++-- .../sets/darkascension/WerewolfRansacker.java | 23 ++++-- .../sets/darkascension/WithengarUnbound.java | 15 ++-- .../src/mage/sets/darksteel/LichsTomb.java | 7 +- .../sets/darksteel/SwordOfFireAndIce.java | 28 +++---- .../sets/darksteel/SwordOfLightAndShadow.java | 17 ++-- .../mage/sets/dissension/ProperBurial.java | 15 ++-- .../mage/sets/dissension/UtopiaSprawl.java | 21 ++--- .../src/mage/sets/dragonsmaze/BeckCall.java | 25 +++--- .../mage/sets/dragonsmaze/BredForTheHunt.java | 20 ++--- .../sets/dragonsmaze/CarnageGladiator.java | 27 +++---- .../sets/dragonsmaze/MasterOfCruelties.java | 37 +++++---- .../sets/dragonsmaze/MelekIzzetParagon.java | 15 ++-- .../mage/sets/dragonsmaze/PyrewildShaman.java | 24 +++--- .../mage/sets/dragonsmaze/RenegadeKrasis.java | 19 ++--- .../sets/dragonsmaze/RuricTharTheUnbowed.java | 18 +++-- .../sets/dragonsmaze/VoiceOfResurgence.java | 7 +- .../mage/sets/dragonsmaze/ZhurTaaDruid.java | 19 +++-- .../sets/dragonsoftarkir/ArashinForemost.java | 7 +- .../sets/dragonsoftarkir/FoeRazerRegent.java | 13 ++- .../dragonsoftarkir/RuthlessDeathfang.java | 14 ++-- .../sets/eventide/AshlingTheExtinguisher.java | 33 ++++---- .../src/mage/sets/eventide/Necroskitter.java | 34 ++++---- .../src/mage/sets/eventide/Spitemare.java | 8 +- .../src/mage/sets/eventide/WakeThrasher.java | 16 ++-- .../mage/sets/eventide/WavesOfAggression.java | 6 ++ .../src/mage/sets/exodus/CityOfTraitors.java | 24 +++--- .../mage/sets/exodus/SoltariVisionary.java | 31 +++---- .../src/mage/sets/fallenempires/HighTide.java | 20 +++-- .../src/mage/sets/fifthdawn/BlindCreeper.java | 20 +++-- .../mage/sets/fifthdawn/DawnsReflection.java | 15 ++-- .../mage/sets/fifthdawn/RiteOfPassage.java | 20 +++-- .../src/mage/sets/fifthedition/Blight.java | 27 ++++--- .../src/mage/sets/fifthedition/Justice.java | 35 ++++---- .../src/mage/sets/fourthedition/TheRack.java | 11 ++- .../mage/sets/futuresight/FrenzySliver.java | 18 +++-- .../futuresight/HeartwoodStoryteller.java | 18 +++-- .../sets/gatecrash/AureliaTheWarleader.java | 20 +++-- .../src/mage/sets/gatecrash/CryptGhast.java | 21 ++--- .../sets/gatecrash/DuskmantleGuildmage.java | 31 +++---- .../src/mage/sets/gatecrash/FathomMage.java | 18 ++--- .../mage/sets/gatecrash/FiveAlarmFire.java | 18 +++-- .../mage/sets/gatecrash/GruulRagebeast.java | 33 +++++--- .../sets/gatecrash/HighPriestOfPenance.java | 18 ++--- .../sets/gatecrash/IllusionistsBracers.java | 30 ++++--- .../sets/gatecrash/IncursionSpecialist.java | 15 +++- .../mage/sets/gatecrash/LeylinePhantom.java | 19 +++-- .../sets/gatecrash/ObzedatGhostCouncil.java | 13 ++- .../src/mage/sets/gatecrash/RustScarab.java | 14 ++-- .../src/mage/sets/gatecrash/VerdantHaven.java | 17 ++-- .../mage/sets/gatecrash/VizkopaGuildmage.java | 21 +++-- .../sets/guildpact/BurningTreeShaman.java | 25 +++--- .../sets/guildpact/InkTreaderNephilim.java | 34 ++++---- .../sets/guildpact/SoulsOfTheFaultless.java | 9 ++- .../sets/heroesvsmonsters/DeusOfCalamity.java | 8 +- .../sets/heroesvsmonsters/KavuPredator.java | 8 +- .../mage/sets/iceage/MagusOfTheUnseen.java | 8 +- .../src/mage/sets/iceage/Necropotence.java | 8 +- .../src/mage/sets/iceage/RayOfCommand.java | 9 ++- .../src/mage/sets/iceage/WildGrowth.java | 31 +++---- .../mage/sets/innistrad/BurningVengeance.java | 20 ++--- .../src/mage/sets/innistrad/CreepyDoll.java | 21 ++--- .../src/mage/sets/innistrad/Curiosity.java | 23 +++--- .../mage/sets/innistrad/CurseOfOblivion.java | 26 +++--- .../sets/innistrad/CurseOfStalkedPrey.java | 14 ++-- .../sets/innistrad/CurseOfTheBloodyTome.java | 27 ++++--- .../innistrad/CurseOfThePiercedHeart.java | 26 +++--- .../mage/sets/innistrad/FalkenrathNoble.java | 30 ++++--- .../mage/sets/innistrad/GarrukRelentless.java | 15 ++-- .../sets/innistrad/GrimgrinCorpseBorn.java | 8 +- .../src/mage/sets/innistrad/GutterGrime.java | 38 +++++---- .../mage/sets/innistrad/HomicidalBrute.java | 15 ++-- .../src/mage/sets/innistrad/RakishHeir.java | 32 ++++---- .../sets/innistrad/ReaperFromTheAbyss.java | 18 +++-- .../mage/sets/innistrad/ScreechingBat.java | 22 ++--- .../mage/sets/innistrad/ThrabenSentry.java | 41 +++++----- .../mage/sets/innistrad/VillageCannibals.java | 26 +++--- .../src/mage/sets/innistrad/WoodenStake.java | 49 +++++------ .../sets/jacevsvraska/AeonChronicler.java | 7 +- .../journeyintonyx/AthreosGodOfPassage.java | 22 ++--- .../journeyintonyx/BloodcrazedHoplite.java | 13 +-- .../sets/journeyintonyx/DictateOfKruphix.java | 13 +-- .../EidolonOfTheGreatRevel.java | 18 +++-- .../src/mage/sets/journeyintonyx/Godsend.java | 77 +++++++++--------- .../journeyintonyx/KeranosGodOfStorms.java | 8 +- .../journeyintonyx/KnowledgeAndPower.java | 14 ++-- .../sets/journeyintonyx/MarketFestival.java | 15 ++-- .../sets/journeyintonyx/MortalObstinacy.java | 17 ++-- .../sets/journeyintonyx/SwarmbornGiant.java | 8 +- .../src/mage/sets/legends/Abomination.java | 81 ++++++++++--------- .../src/mage/sets/legions/ToxinSliver.java | 39 ++++----- .../src/mage/sets/legions/WallOfHope.java | 25 +++--- .../mage/sets/limitedalpha/AnkhOfMishra.java | 20 +++-- .../src/mage/sets/limitedalpha/BlackVise.java | 12 +-- .../mage/sets/limitedalpha/Cockatrice.java | 46 ++++++----- .../mage/sets/limitedalpha/CrystalRod.java | 16 ++-- .../src/mage/sets/limitedalpha/DingusEgg.java | 29 ++++--- .../src/mage/sets/limitedalpha/Fastbond.java | 17 ++-- .../src/mage/sets/limitedalpha/IronStar.java | 16 ++-- .../src/mage/sets/limitedalpha/IvoryCup.java | 16 ++-- .../mage/sets/limitedalpha/PsychicVenom.java | 23 +++--- .../sets/limitedalpha/ThicketBasilisk.java | 46 ++++++----- .../mage/sets/limitedalpha/ThroneOfBone.java | 16 ++-- .../mage/sets/limitedalpha/WoodenSphere.java | 16 ++-- Mage.Sets/src/mage/sets/lorwyn/Dread.java | 7 +- .../src/mage/sets/lorwyn/EntanglingTrap.java | 7 +- .../mage/sets/lorwyn/RingsOfBrighthearth.java | 7 +- .../src/mage/sets/magic2010/HowlingMine.java | 18 +++-- .../src/mage/sets/magic2010/IceCage.java | 25 +++--- .../sets/magic2010/LightwielderPaladin.java | 14 ++-- .../src/mage/sets/magic2010/SanguineBond.java | 14 +++- .../mage/sets/magic2011/AjanisPridemate.java | 16 ++-- .../mage/sets/magic2011/ChandrasSpitfire.java | 23 +++--- .../src/mage/sets/magic2011/GraveTitan.java | 11 ++- .../src/mage/sets/magic2011/InfernoTitan.java | 15 ++-- .../mage/sets/magic2011/LilianasCaress.java | 9 ++- .../src/mage/sets/magic2011/PrimalCocoon.java | 38 ++++----- .../src/mage/sets/magic2011/SunTitan.java | 11 ++- .../sets/magic2012/ChandraTheFirebrand.java | 14 +++- .../mage/sets/magic2012/ChandrasPhoenix.java | 23 +++--- .../mage/sets/magic2012/CircleOfFlame.java | 54 +++++++------ .../mage/sets/magic2012/GideonsAvenger.java | 21 ++--- .../mage/sets/magic2012/HuntersInsight.java | 16 ++-- .../sets/magic2012/RitesOfFlourishing.java | 19 +++-- .../mage/sets/magic2012/WarstormSurge.java | 27 ++++--- .../src/mage/sets/magic2012/Worldslayer.java | 25 +++--- .../mage/sets/magic2013/BloodReckoning.java | 53 ++++++------ .../sets/magic2013/HamletbackGoliath.java | 27 ++++--- .../magic2013/NefaroxOverlordOfGrixis.java | 15 ++-- .../sets/magic2013/OdricMasterTactician.java | 25 +++--- .../mage/sets/magic2013/SlumberingDragon.java | 29 ++++--- .../mage/sets/magic2014/ArchangelOfThune.java | 11 ++- .../mage/sets/magic2014/ColossalWhale.java | 8 +- .../mage/sets/magic2014/DoorOfDestinies.java | 22 ++--- .../sets/magic2014/GuardianOfTheAges.java | 24 +++--- .../mage/sets/magic2014/IllusionaryArmor.java | 16 ++-- .../mage/sets/magic2014/PathOfBravery.java | 13 +-- .../mage/sets/magic2014/WindreaderSphinx.java | 15 ++-- .../src/mage/sets/magic2014/Witchstalker.java | 22 ++--- .../src/mage/sets/magic2015/HotSoup.java | 22 ++--- .../sets/magic2015/KurkeshOnakkeAncient.java | 21 ++--- .../sets/magic2015/MilitaryIntelligence.java | 13 +-- .../mage/sets/magic2015/NetcasterSpider.java | 12 +-- .../sets/magic2015/ObNixilisUnshackled.java | 17 ++-- .../mage/sets/magic2015/ProfaneMemento.java | 8 +- .../src/mage/sets/magic2015/SiegeDragon.java | 8 +- .../src/mage/sets/magic2015/WallOfLimbs.java | 8 +- .../src/mage/sets/magic2015/WasteNot.java | 22 ++++- .../sets/mercadianmasques/CausticWasps.java | 8 +- .../mage/sets/mercadianmasques/Larceny.java | 27 ++++--- .../sets/mercadianmasques/NoblePurpose.java | 26 +++--- .../sets/mercadianmasques/PiousWarrior.java | 16 ++-- .../src/mage/sets/mirage/AmberPrison.java | 12 ++- .../src/mage/sets/mirage/RockBasilisk.java | 47 ++++++----- .../src/mage/sets/mirrodin/BansheesBlade.java | 9 +++ .../src/mage/sets/mirrodin/Glimmervoid.java | 21 ++--- .../src/mage/sets/mirrodin/MesmericOrb.java | 16 ++-- .../src/mage/sets/mirrodin/RustmouthOgre.java | 26 +++--- .../src/mage/sets/mirrodin/SwordOfKaldra.java | 24 +++--- .../mirrodinbesieged/ConsecratedSphinx.java | 16 ++-- .../mirrodinbesieged/GlissaTheTraitor.java | 13 ++- .../sets/mirrodinbesieged/KnowledgePool.java | 17 ++-- .../sets/mirrodinbesieged/MagneticMine.java | 27 ++++--- .../sets/mirrodinbesieged/MassacreWurm.java | 13 ++- .../sets/mirrodinbesieged/Mirrorworks.java | 8 +- .../sets/mirrodinbesieged/NestedGhoul.java | 11 ++- .../sets/mirrodinbesieged/Sangromancer.java | 23 ++++-- .../sets/mirrodinbesieged/SepticRats.java | 19 +++-- .../SwordOfFeastAndFamine.java | 31 +++---- .../mirrodinbesieged/ThopterAssembly.java | 8 +- .../sets/mirrodinbesieged/VirulentWound.java | 17 ++-- .../sets/modernmasters/AuntiesSnitch.java | 17 ++-- .../modernmasters/DreamspoilerWitches.java | 15 ++-- .../sets/modernmasters/TrygonPredator.java | 8 +- .../mage/sets/morningtide/GreatbowDoyen.java | 36 +++++---- .../sets/morningtide/OonasBlackguard.java | 7 +- .../mage/sets/newphyrexia/ArmWithAEther.java | 16 ++-- .../mage/sets/newphyrexia/BlindZealot.java | 15 ++-- .../src/mage/sets/newphyrexia/CagedSun.java | 20 ++--- .../newphyrexia/ChancellorOfTheAnnex.java | 14 +++- .../newphyrexia/ChancellorOfTheDross.java | 20 +++-- .../newphyrexia/ChancellorOfTheForge.java | 17 ++-- .../newphyrexia/ChancellorOfTheSpires.java | 16 ++-- .../newphyrexia/ChancellorOfTheTangle.java | 17 ++-- .../sets/newphyrexia/InvaderParasite.java | 13 ++- .../mage/sets/newphyrexia/KarnLiberated.java | 10 ++- .../mage/sets/newphyrexia/NumbingDose.java | 24 +++--- .../newphyrexia/PhyrexianObliterator.java | 13 ++- .../mage/sets/newphyrexia/PsychicSurgery.java | 16 ++-- .../mage/sets/newphyrexia/RageExtractor.java | 14 ++-- .../sets/newphyrexia/ReaperOfSheoldred.java | 13 ++- .../mage/sets/newphyrexia/SuturePriest.java | 13 ++- .../sets/newphyrexia/SwordOfWarAndPeace.java | 29 ++++--- .../newphyrexia/VorinclexVoiceOfHunger.java | 8 +- .../src/mage/sets/ninthedition/Cowardice.java | 19 +++-- .../mage/sets/ninthedition/Deathgazer.java | 39 ++++----- .../src/mage/sets/ninthedition/GravePact.java | 17 ++-- .../sets/ninthedition/GuerrillaTactics.java | 13 +-- .../ninthedition/ViashinoSandstalker.java | 16 ++-- .../src/mage/sets/odyssey/BattleStrain.java | 16 ++-- .../src/mage/sets/odyssey/BombSquad.java | 7 +- .../src/mage/sets/odyssey/DecayingSoil.java | 31 +++---- .../src/mage/sets/odyssey/DruidsCall.java | 20 +++-- .../src/mage/sets/odyssey/FilthyCur.java | 16 ++-- .../src/mage/sets/odyssey/KarmicJustice.java | 7 +- .../src/mage/sets/odyssey/PriceOfGlory.java | 24 +++--- .../src/mage/sets/odyssey/SavageFirecat.java | 17 ++-- .../src/mage/sets/odyssey/SparkMage.java | 40 ++++----- .../src/mage/sets/odyssey/Spiritualize.java | 22 ++--- .../src/mage/sets/odyssey/Standstill.java | 13 +-- .../src/mage/sets/onslaught/FalseCure.java | 18 +++-- .../sets/planarchaos/BenalishCommander.java | 7 +- .../mage/sets/planarchaos/Detritivore.java | 8 +- .../mage/sets/planarchaos/FungalBehemoth.java | 7 +- .../mage/sets/planarchaos/RoilingHorror.java | 7 +- .../planechase2012/PollenbrightWings.java | 31 +++---- .../sets/planeshift/PhyrexianTyranny.java | 17 ++-- .../mage/sets/ravnica/BelltowerSphinx.java | 15 ++-- .../src/mage/sets/ravnica/BreathOfFury.java | 56 +++++++------ .../src/mage/sets/ravnica/TwilightDrover.java | 20 +++-- .../mage/sets/returntoravnica/AshZealot.java | 13 ++- .../sets/returntoravnica/AzorsElocutors.java | 22 ++--- .../sets/returntoravnica/ChronicFlooding.java | 29 ++++--- .../returntoravnica/CrosstownCourier.java | 16 ++-- .../sets/returntoravnica/DeathsPresence.java | 14 ++-- .../sets/returntoravnica/GraveBetrayal.java | 18 +++-- .../JaceArchitectOfThought.java | 31 ++++--- .../mage/sets/returntoravnica/LobberCrew.java | 23 +++--- .../returntoravnica/NecropolisRegent.java | 29 ++++--- .../sets/returntoravnica/Pyroconvergence.java | 20 ++--- .../sets/returntoravnica/SearchTheCity.java | 16 ++-- .../returntoravnica/ShriekingAffliction.java | 15 ++-- .../mage/sets/returntoravnica/SkymarkRoc.java | 13 ++- .../TrostaniSelesnyasVoice.java | 27 ++++--- .../sets/returntoravnica/VolatileRig.java | 15 ++-- .../sets/returntoravnica/VraskaTheUnseen.java | 22 +++-- .../sets/riseoftheeldrazi/AngelheartVial.java | 29 ++++--- .../sets/riseoftheeldrazi/BanefulOmen.java | 31 +++---- .../riseoftheeldrazi/ContaminatedGround.java | 32 ++++---- .../riseoftheeldrazi/CurseOfWizardry.java | 23 +++--- .../riseoftheeldrazi/EmrakulTheAeonsTorn.java | 24 +++--- .../sets/riseoftheeldrazi/GravityWell.java | 75 +++++++++-------- .../LighthouseChronologist.java | 20 ++--- .../sets/riseoftheeldrazi/LightmineField.java | 16 ++-- .../riseoftheeldrazi/MorticianBeetle.java | 14 ++-- .../riseoftheeldrazi/NirkanaRevenant.java | 68 ++++++++-------- .../sets/riseoftheeldrazi/PawnOfUlamog.java | 13 +-- .../riseoftheeldrazi/RaidBombardment.java | 13 ++- .../sets/riseoftheeldrazi/RapaciousOne.java | 14 ++-- .../RenegadeDoppelganger.java | 18 +++-- .../UlamogTheInfiniteGyre.java | 14 ++-- .../mage/sets/riseoftheeldrazi/Vengevine.java | 15 ++-- .../sets/riseoftheeldrazi/WorldAtWar.java | 15 ++-- .../saviorsofkamigawa/EbonyOwlNetsuke.java | 14 ++-- .../ErayoSoratamiAscendant.java | 38 +++++---- .../KiyomaroFirstToStand.java | 19 +++-- .../saviorsofkamigawa/PureIntentions.java | 22 +++-- .../sets/scarsofmirrodin/CopperhornScout.java | 18 +++-- .../scarsofmirrodin/DissipationField.java | 13 ++- .../sets/scarsofmirrodin/EzurisArchers.java | 19 ++--- .../scarsofmirrodin/FurnaceCelebration.java | 17 ++-- .../sets/scarsofmirrodin/GolemsHeart.java | 21 ++--- .../scarsofmirrodin/InfiltrationLens.java | 26 +++--- .../sets/scarsofmirrodin/KothOfTheHammer.java | 14 +++- .../scarsofmirrodin/LiegeOfTheTangle.java | 32 ++++---- .../sets/scarsofmirrodin/LivewireLash.java | 17 ++-- .../mage/sets/scarsofmirrodin/MimicVat.java | 50 ++++++------ .../sets/scarsofmirrodin/MolderBeast.java | 25 +++--- .../scarsofmirrodin/MoltenTailMasticore.java | 8 +- .../sets/scarsofmirrodin/NimDeathmantle.java | 53 ++++++------ .../sets/scarsofmirrodin/OgreGeargrabber.java | 21 ++--- .../sets/scarsofmirrodin/PrecursorGolem.java | 30 +++---- .../scarsofmirrodin/RelicPutrescence.java | 22 ++--- .../scarsofmirrodin/SwordOfBodyAndMind.java | 35 ++++---- .../sets/scarsofmirrodin/TunnelIgnus.java | 33 ++++---- .../scarsofmirrodin/VenserTheSojourner.java | 17 ++-- .../sets/scarsofmirrodin/VigilForTheLost.java | 16 ++-- .../sets/scarsofmirrodin/ViridianRevel.java | 13 ++- .../mage/sets/scourge/PyrostaticPillar.java | 19 +++-- .../src/mage/sets/scourge/XantidSwarm.java | 8 +- .../mage/sets/seventhedition/AEtherFlash.java | 22 ++--- .../sets/seventhedition/FinalFortune.java | 13 +-- .../seventhedition/RelentlessAssault.java | 7 ++ .../src/mage/sets/seventhedition/Rowen.java | 8 +- .../mage/sets/shadowmoor/AshenmoorLiege.java | 7 +- .../sets/shadowmoor/DemigodOfRevenge.java | 11 ++- .../sets/shadowmoor/FlourishingDefenses.java | 9 ++- .../sets/shadowmoor/HollowbornBarghest.java | 8 +- .../mage/sets/shadowmoor/RakingCanopy.java | 24 +++--- .../mage/sets/shadowmoor/SpitefulVisions.java | 13 ++- .../src/mage/sets/shadowmoor/TowerAbove.java | 9 ++- .../shardsofalara/AngelicBenediction.java | 13 ++- .../sets/shardsofalara/BattlegraceAngel.java | 7 +- .../sets/shardsofalara/CradleOfVitality.java | 15 ++-- .../mage/sets/shardsofalara/Drumhunter.java | 12 ++- .../shardsofalara/ExuberantFirestoker.java | 17 ++-- .../mage/sets/shardsofalara/Manaplasm.java | 27 ++++--- .../sets/shardsofalara/MemoryErosion.java | 21 ++--- .../sets/shardsofalara/MightyEmergence.java | 29 ++++--- .../sets/shardsofalara/PrinceOfThralls.java | 31 +++---- .../mage/sets/shardsofalara/QuietusSpike.java | 30 ++++--- .../sets/shardsofalara/RafiqOfTheMany.java | 7 +- .../mage/sets/shardsofalara/Skeletonize.java | 27 ++++--- .../sets/shardsofalara/SunseedNurturer.java | 17 ++-- .../src/mage/sets/stronghold/HornOfGreed.java | 13 +-- .../src/mage/sets/stronghold/Overgrowth.java | 20 +++-- .../mage/sets/stronghold/SacredGround.java | 12 +-- .../mage/sets/stronghold/WallOfEssence.java | 9 ++- .../sets/tempestremastered/CoffinQueen.java | 8 +- .../sets/tempestremastered/Spellshock.java | 18 +++-- .../sets/tempestremastered/WallOfSouls.java | 9 ++- .../mage/sets/tenthedition/AngelsFeather.java | 20 ++--- .../mage/sets/tenthedition/KrakensEye.java | 20 ++--- .../src/mage/sets/tenthedition/Megrim.java | 14 +++- .../mage/sets/tenthedition/WurmsTooth.java | 20 ++--- Mage.Sets/src/mage/sets/thedark/Venom.java | 53 ++++++------ .../src/mage/sets/theros/BidentOfThassa.java | 17 ++-- .../mage/sets/theros/FlamespeakerAdept.java | 10 ++- .../sets/theros/RescueFromTheUnderworld.java | 17 +++- .../src/mage/sets/theros/ThassasEmissary.java | 9 ++- .../src/mage/sets/theros/TimeToFeed.java | 8 +- .../src/mage/sets/theros/TritonTactics.java | 8 +- .../mage/sets/timeshifted/EssenceSliver.java | 25 +++--- .../mage/sets/timeshifted/GrinningTotem.java | 8 +- .../timeshifted/SolkanarTheSwampKing.java | 21 +++-- .../mage/sets/timespiral/GauntletOfPower.java | 70 ++++++++-------- .../mage/sets/timespiral/NorinTheWary.java | 14 ++-- .../src/mage/sets/timespiral/ParadoxHaze.java | 22 ++--- .../sets/timespiral/SaffiEriksdotter.java | 10 ++- .../src/mage/sets/timespiral/StuffyDoll.java | 16 ++-- .../mage/sets/urzasdestiny/AetherSting.java | 15 ++-- .../sets/urzasdestiny/PhyrexianNegator.java | 20 +++-- .../urzasdestiny/RayneAcademyChancellor.java | 25 +++--- .../src/mage/sets/urzaslegacy/MemoryJar.java | 19 ++--- .../src/mage/sets/urzaslegacy/NoMercy.java | 36 +++++---- .../src/mage/sets/urzaslegacy/Rivalry.java | 22 ++--- .../src/mage/sets/urzaslegacy/Scrapheap.java | 23 +++--- .../src/mage/sets/urzassaga/Bereavement.java | 14 +++- .../mage/sets/urzassaga/CarpetOfFlowers.java | 13 +-- .../sets/urzassaga/DiabolicServitude.java | 8 +- .../mage/sets/urzassaga/FertileGround.java | 10 ++- .../src/mage/sets/urzassaga/GoblinLackey.java | 21 ++--- .../mage/sets/urzassaga/SpreadingAlgae.java | 23 +++--- .../src/mage/sets/urzassaga/ThranQuarry.java | 20 ++--- .../mage/sets/urzassaga/TitaniasChosen.java | 20 ++--- .../vintagemasters/MarchesaTheBlackRose.java | 9 ++- .../vintagemasters/ScourgeOfTheThrone.java | 52 ++++++------ .../mage/sets/vintagemasters/SpinalGraft.java | 20 +++-- .../src/mage/sets/visions/Necromancy.java | 14 ++-- .../mage/sets/weatherlight/GoblinVandal.java | 28 ++++--- .../mage/sets/worldwake/AmuletOfVigor.java | 24 +++--- .../sets/worldwake/ArchonOfRedemption.java | 31 +++---- .../mage/sets/worldwake/BrinkOfDisaster.java | 23 +++--- .../src/mage/sets/worldwake/HammerOfRuin.java | 39 ++++----- .../sets/worldwake/KalastriaHighborn.java | 30 +++---- .../worldwake/KazuulTyrantOfTheCliffs.java | 26 +++--- .../mage/sets/worldwake/KorFirewalker.java | 21 ++--- .../mage/sets/worldwake/PerimeterCaptain.java | 21 ++--- .../sets/worldwake/QuestForTheNihilStone.java | 24 +++--- .../sets/worldwake/QuestForUlasTemple.java | 22 +++-- .../sets/worldwake/RumblingAftershocks.java | 48 +++++------ .../mage/sets/worldwake/SlaveringNulls.java | 14 ++-- .../src/mage/sets/worldwake/TalusPaladin.java | 31 +++---- .../sets/zendikar/BladeOfTheBloodchief.java | 45 ++++++----- .../src/mage/sets/zendikar/BloodSeeker.java | 19 +++-- .../mage/sets/zendikar/CelestialMantle.java | 24 +++--- .../mage/sets/zendikar/CosisTrickster.java | 17 ++-- .../mage/sets/zendikar/Electropotence.java | 26 +++--- .../mage/sets/zendikar/EmeriaTheSkyRuin.java | 20 ++--- .../src/mage/sets/zendikar/GoblinGuide.java | 15 ++-- .../mage/sets/zendikar/LullmageMentor.java | 23 +++--- .../sets/zendikar/LuminarchAscension.java | 59 +++++++------- .../src/mage/sets/zendikar/MireBlight.java | 26 +++--- .../src/mage/sets/zendikar/PunishingFire.java | 17 ++-- .../mage/sets/zendikar/QuestForPureFlame.java | 9 ++- .../sets/zendikar/QuestForTheGemblades.java | 22 ++--- .../src/mage/sets/zendikar/ScuteMob.java | 16 ++-- .../zendikar/ValakutTheMoltenPinnacle.java | 19 +++-- .../mage/sets/zendikar/WarrenInstigator.java | 21 ++--- .../mage/abilities/TriggeredAbilityImpl.java | 4 +- 464 files changed, 5501 insertions(+), 3845 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java b/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java index 89ec238a681..66af16ece13 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java @@ -32,8 +32,8 @@ import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.AttachmentType; @@ -43,6 +43,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -101,17 +102,20 @@ class CrystallizationTriggeredAbility extends TriggeredAbilityImpl { public CrystallizationTriggeredAbility copy() { return new CrystallizationTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TARGETED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - UUID enchanted = enchantment.getAttachedTo(); - if (event.getTargetId().equals(enchanted)) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchanted)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + UUID enchanted = enchantment.getAttachedTo(); + if (event.getTargetId().equals(enchanted)) { + getEffects().get(0).setTargetPointer(new FixedTarget(enchanted)); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java index 6f7d65cb1b2..5ee8ca52d96 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java +++ b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -86,14 +87,15 @@ class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl { return new DragonAppeasementTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT - && event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) { - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE); } @Override diff --git a/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java b/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java index 819fd8fda9f..7cc940a7bf4 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java +++ b/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java @@ -28,10 +28,6 @@ package mage.sets.alarareborn; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -41,8 +37,13 @@ import mage.abilities.keyword.CascadeAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Library; @@ -101,20 +102,23 @@ class EnigmaSphinxTriggeredAbility extends TriggeredAbilityImpl { return new EnigmaSphinxTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); - if (permanent != null && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - permanent.getId().equals(this.getSourceId()) && - // 5/1/2009 If you control an Enigma Sphinx that's owned by another player, it's put into that player's - // graveyard from the battlefield, so Enigma Sphinx's middle ability won't trigger. - permanent.getOwnerId().equals(permanent.getControllerId())) { - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); + if (permanent != null && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + permanent.getId().equals(this.getSourceId()) && + // 5/1/2009 If you control an Enigma Sphinx that's owned by another player, it's put into that player's + // graveyard from the battlefield, so Enigma Sphinx's middle ability won't trigger. + permanent.getOwnerId().equals(permanent.getControllerId())) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java index 6bc9d7e20fd..6680bd1cd15 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java @@ -29,23 +29,22 @@ package mage.sets.alarareborn; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TurnPhase; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ExaltedAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TurnPhase; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; -import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; /** @@ -95,16 +94,19 @@ class FinestHourAbility extends TriggeredAbilityImpl { return new FinestHourAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) { - if (event.getType() == EventType.DECLARED_ATTACKERS) { - if (game.getCombat().attacksAlone()) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); - } - return true; + if (game.getActivePlayerId().equals(this.controllerId)) { + if (game.getCombat().attacksAlone()) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java index 46d20e93bba..7d87143fc83 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java +++ b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java @@ -29,16 +29,17 @@ package mage.sets.alarareborn; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; 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; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -85,15 +86,15 @@ class GloryscaleViashinoAbility extends TriggeredAbilityImpl { return new GloryscaleViashinoAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java b/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java index b3227fb7012..5f68c93393f 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java @@ -28,17 +28,17 @@ package mage.sets.alarareborn; 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.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -83,24 +83,27 @@ class MycoidShepherdTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - MageObject lastKnown = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (lastKnown == null) { - return false; - } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); - if (permanent == null) { - return false; - } - if (super.getSourceId().equals(event.getTargetId()) - || permanent.getPower().getValue() > 4 - && permanent.getControllerId().equals(controllerId)) { - Zone after = game.getState().getZone(event.getTargetId()); - return after != null && Zone.GRAVEYARD.match(after); - } + MageObject lastKnown = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (lastKnown == null) { + return false; + } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); + if (permanent == null) { + return false; + } + if (super.getSourceId().equals(event.getTargetId()) + || permanent.getPower().getValue() > 4 + && permanent.getControllerId().equals(controllerId)) { + Zone after = game.getState().getZone(event.getTargetId()); + return after != null && Zone.GRAVEYARD.match(after); } return false; } diff --git a/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java b/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java index 02289774433..fa3a33e7ef5 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java @@ -39,6 +39,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -83,21 +84,24 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent == null) { - return false; - } - if (permanent.getControllerId().equals(controllerId) - && permanent.getPower().getValue() == 1 - && permanent.getToughness().getValue() == 1) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent == null) { + return false; + } + if (permanent.getControllerId().equals(controllerId) + && permanent.getPower().getValue() == 1 + && permanent.getToughness().getValue() == 1) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java b/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java index 60407470419..f6f70200a1d 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java @@ -28,10 +28,6 @@ package mage.sets.alarareborn; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,7 +35,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ExaltedAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.other.AuraCardCanAttachToPermanentId; @@ -99,14 +98,17 @@ class CreatureControlledAttacksAloneTriggeredAbility extends TriggeredAbilityImp return new CreatureControlledAttacksAloneTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getActivePlayerId().equals(this.controllerId)) { - if (event.getType() == EventType.DECLARED_ATTACKERS) { - if (game.getCombat().attacksAlone()) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); - return true; - } + if (game.getCombat().attacksAlone()) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java index 3028eded661..9fe05560f06 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java +++ b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java @@ -44,6 +44,7 @@ import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -139,15 +140,15 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT) { - MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (mageObject != null && mageObject.getCardType().contains(CardType.CREATURE)) { - return true; - } - } - return false; + MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + return mageObject != null && mageObject.getCardType().contains(CardType.CREATURE); } @Override diff --git a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java index 5edada9ccb2..388649436cd 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java +++ b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java @@ -28,18 +28,15 @@ package mage.sets.alarareborn; import java.util.UUID; -import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AddManaAnyColorAttachedControllerEffect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.ManaEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.ShroudAbility; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.Duration; @@ -48,8 +45,8 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -109,15 +106,15 @@ class TraceOfAbundanceTriggeredAbility extends TriggeredManaAbility { return new TraceOfAbundanceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; + return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); } @Override diff --git a/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java b/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java index b4bf3105dd5..b89373ee45c 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java +++ b/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java @@ -48,6 +48,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; @@ -103,9 +104,14 @@ class UnscytheKillerOfKingsTriggeredAbility extends TriggeredAbilityImpl { return new UnscytheKillerOfKingsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) { // target token can't create Zombie Permanent equipment = game.getPermanent(getSourceId()); diff --git a/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java b/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java index f69fcb53d0c..ddd5bc56763 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -82,9 +83,14 @@ class VedalkenGhoulTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.CREATURE_BLOCKED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) { + if (event.getTargetId().equals(this.getSourceId())) { UUID defendingPlayer = game.getCombat().getDefenderId(this.getSourceId()); if (defendingPlayer != null) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java index 303c2e9131c..efc75cfd615 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java @@ -29,20 +29,20 @@ package mage.sets.apocalypse; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; 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; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -87,15 +87,15 @@ class BogGnarrTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, game)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && filter.match(spell, game); } @Override diff --git a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java index 537e1291d33..4ff643a49d7 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java @@ -27,23 +27,23 @@ */ package mage.sets.apocalypse; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; 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; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; -import java.util.UUID; - /** * @author Loki */ @@ -85,15 +85,15 @@ class GladeGnarrTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, game)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && filter.match(spell, game); } @Override diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java b/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java index 14fb15e506a..3dae9353e98 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java @@ -27,16 +27,16 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; - -import java.util.UUID; +import mage.game.events.GameEvent.EventType; /** * @author noxx @@ -78,9 +78,14 @@ class ExquisiteBloodTriggeredAbility extends TriggeredAbilityImpl { return new ExquisiteBloodTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LOST_LIFE && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { this.getEffects().clear(); this.addEffect(new GainLifeEffect(event.getAmount())); return true; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java b/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java index b4bbb836910..68e82eb0f99 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java @@ -27,22 +27,22 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author noxx @@ -89,9 +89,14 @@ class HavengulSkaabAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, filter, false); this.addTarget(target); return true; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java index 515e0e80d7e..0024d46d9cb 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java @@ -42,6 +42,7 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -91,10 +92,14 @@ class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl { return new LoneRevenantTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { Permanent permanent = game.getPermanent(event.getSourceId()); int number = game.getBattlefield().countAll(filter, controllerId, game); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java b/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java index 244365d90a4..7923ce030b3 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java @@ -27,9 +27,8 @@ */ package mage.sets.avacynrestored; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.abilities.Ability; +import java.util.UUID; +import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -37,18 +36,18 @@ import mage.abilities.effects.common.DestroySourceEffect; import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; +import mage.game.stack.Spell; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; -import mage.MageObject; -import mage.game.stack.Spell; - /** * * @author noxx @@ -99,16 +98,19 @@ class SpectralPrisonAbility extends TriggeredAbilityImpl { return new SpectralPrisonAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TARGETED) { - MageObject eventSourceObject = game.getObject(event.getSourceId()); - if (eventSourceObject != null && eventSourceObject instanceof Spell) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } + MageObject eventSourceObject = game.getObject(event.getSourceId()); + if (eventSourceObject != null && eventSourceObject instanceof Spell) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java index 7c265a37cec..992fc08f1af 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java @@ -28,14 +28,14 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -93,9 +93,13 @@ class JettingGlasskiteAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { this.getTargets().clear(); TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java index 21a31b702d6..921e4ddb136 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java @@ -28,10 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,9 +35,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.SoulshiftAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -92,11 +92,16 @@ class KamiOfTheHonoredDeadTriggeredAbility extends TriggeredAbilityImpl { return new KamiOfTheHonoredDeadTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - return true; + if (event.getTargetId().equals(this.sourceId)) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java index 4fb87fe03d0..abdfe0da0fe 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java @@ -30,10 +30,6 @@ package mage.sets.betrayersofkamigawa; import java.util.HashMap; import java.util.Map; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -41,6 +37,10 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; 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; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -102,20 +102,25 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { return new KiraGreatGlassSpinnerAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId())) { + if (event.getTargetId().equals(this.getSourceId())) { Integer turn = turnUsed.get(event.getTargetId()); - if (turn == null || turn.intValue() < game.getTurnNum()) { + if (turn == null || turn < game.getTurnNum()) { this.getTargets().clear(); TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); this.addTarget(target); if (turnUsed.containsKey(event.getTargetId())) { turnUsed.remove(event.getTargetId()); - turnUsed.put(event.getTargetId(),new Integer(game.getTurnNum())); + turnUsed.put(event.getTargetId(), game.getTurnNum()); } else { - turnUsed.put(event.getTargetId(), new Integer(game.getTurnNum())); + turnUsed.put(event.getTargetId(), game.getTurnNum()); } return true; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java index 9ba3ec0dcae..98dbfb2c5b4 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java @@ -44,8 +44,9 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.DamagedPlayerEvent; +import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -101,18 +102,21 @@ class MarkOfSakikoTriggeredAbility extends TriggeredAbilityImpl { return new MarkOfSakikoTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { - if (event.getSourceId().equals(getSourceId())) { - this.getEffects().clear(); - Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true); - effect.setTargetPointer(new FixedTarget(getControllerId())); - effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end"); - this.addEffect(effect); - return true; - } + if (((DamagedEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(getSourceId())) { + this.getEffects().clear(); + Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true); + effect.setTargetPointer(new FixedTarget(getControllerId())); + effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end"); + this.addEffect(effect); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java index 27ae8a62520..c791bf1df22 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java @@ -28,20 +28,21 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.NinjutsuAbility; 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.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -92,10 +93,14 @@ class MistbladeShinobiTriggeredAbility extends TriggeredAbilityImpl { return new MistbladeShinobiTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent - && ((DamagedPlayerEvent) event).isCombatDamage() + if (((DamagedPlayerEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { Player opponent = game.getPlayer(event.getPlayerId()); if (opponent != null) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java index 12998823283..4ad31655ef8 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java @@ -28,9 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -38,6 +35,9 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.keyword.OfferingAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -87,17 +87,20 @@ class PatronOfTheNezumiTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD) { - Card card = game.getCard(zEvent.getTargetId()); - if (card != null && game.getOpponents(controllerId).contains(card.getOwnerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(zEvent.getPlayerId())); - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD) { + Card card = game.getCard(zEvent.getTargetId()); + if (card != null && game.getOpponents(controllerId).contains(card.getOwnerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(zEvent.getPlayerId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java index 76bacd56dc5..fedf501ce0e 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java @@ -28,10 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -40,8 +36,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -88,25 +89,28 @@ public class RoninWarclub extends CardImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE) - && (permanent.getControllerId().equals(this.controllerId))) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } - if (!this.getTargets().isEmpty()) { - // remove previous target - if (this.getTargets().get(0).getTargets().size() > 0) { - this.getTargets().clear(); - this.addTarget(new TargetCreaturePermanent()); - } - Target target = this.getTargets().get(0); - if (target instanceof TargetCreaturePermanent) { - target.add(event.getTargetId(), game); - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.CREATURE) + && (permanent.getControllerId().equals(this.controllerId))) { + + if (!this.getTargets().isEmpty()) { + // remove previous target + if (this.getTargets().get(0).getTargets().size() > 0) { + this.getTargets().clear(); + this.addTarget(new TargetCreaturePermanent()); + } + Target target = this.getTargets().get(0); + if (target instanceof TargetCreaturePermanent) { + target.add(event.getTargetId(), game); } - return true; } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java index 11375e1b5bb..fe8a3787c2f 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java @@ -33,15 +33,14 @@ import mage.Mana; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; -import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -91,19 +90,22 @@ class SakikoMotherOfSummerTriggeredAbility extends TriggeredAbilityImpl { return new SakikoMotherOfSummerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { - this.getEffects().clear(); - Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true); - effect.setTargetPointer(new FixedTarget(creature.getControllerId())); - effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end"); - this.addEffect(effect); - return true; - } + if (((DamagedPlayerEvent) event).isCombatDamage()) { + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && creature.getControllerId().equals(controllerId)) { + this.getEffects().clear(); + Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true); + effect.setTargetPointer(new FixedTarget(creature.getControllerId())); + effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end"); + this.addEffect(effect); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java index 4f22ae29dad..9d43915b660 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java @@ -28,14 +28,14 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -93,9 +93,13 @@ class ShimmeringGlasskiteAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) { this.getTargets().clear(); TargetStackObject target = new TargetStackObject(); target.add(event.getSourceId(), game); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java index 0cec7744018..58f970e9d42 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java @@ -92,25 +92,28 @@ class ShireiShizosCaretakerTriggeredAbility extends TriggeredAbilityImpl { public ShireiShizosCaretakerTriggeredAbility copy() { return new ShireiShizosCaretakerTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent LKIpermanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId()); - Card card = game.getCard(zEvent.getTargetId()); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent LKIpermanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId()); + Card card = game.getCard(zEvent.getTargetId()); - if (card != null && LKIpermanent != null && - card.getOwnerId().equals(this.controllerId) && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - card.getCardType().contains(CardType.CREATURE) && - LKIpermanent.getPower().getValue() <= 1) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(zEvent.getTargetId())); - } - return true; + if (card != null && LKIpermanent != null && + card.getOwnerId().equals(this.controllerId) && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + card.getCardType().contains(CardType.CREATURE) && + LKIpermanent.getPower().getValue() <= 1) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(zEvent.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java index 9cec6dbae47..7031cef6449 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java @@ -28,9 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; @@ -38,6 +35,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.NinjutsuAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; @@ -46,6 +45,7 @@ import mage.filter.predicate.permanent.UnblockedPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCardInOpponentsGraveyard; /** @@ -103,10 +103,14 @@ class SkullsnatcherTriggeredAbility extends TriggeredAbilityImpl { return new SkullsnatcherTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent - && ((DamagedPlayerEvent) event).isCombatDamage() + if (((DamagedPlayerEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { FilterCard filter = new FilterCard("up to two target cards from that player's graveyard"); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java index 96855f251f4..73ae590b27d 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java @@ -28,9 +28,6 @@ package mage.sets.betrayersofkamigawa; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; @@ -38,6 +35,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.NinjutsuAbility; 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.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; @@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.TargetPermanent; /** @@ -94,10 +95,14 @@ class ThroatSlitterTriggeredAbility extends TriggeredAbilityImpl { return new ThroatSlitterTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent - && ((DamagedPlayerEvent) event).isCombatDamage() + if (((DamagedPlayerEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature that player controls"); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java index 625795542a5..a249d46d935 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java @@ -45,6 +45,7 @@ import mage.constants.SubLayer; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -130,9 +131,14 @@ class PerplexingChimeraTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java index 7b5e3326382..c7e59facd09 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java @@ -115,9 +115,14 @@ class SearingBloodDelayedTriggeredAbility extends DelayedTriggeredAbility { this.target = ability.target; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) { + if (event.getTargetId().equals(target)) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { return true; diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java index bb39ac5c1ec..3f132ca5074 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -94,26 +95,28 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl { return new SpitefulReturnedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - Permanent sourcePermanent = game.getPermanent(this.getSourceId()); - if (sourcePermanent != null) { - if (sourcePermanent.getCardType().contains(CardType.CREATURE)) { - if (event.getSourceId() == this.getSourceId()) { - UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); - return true; - } - } else { - if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) { - UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); - return true; - } + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + if (sourcePermanent != null) { + if (sourcePermanent.getCardType().contains(CardType.CREATURE)) { + if (event.getSourceId() == this.getSourceId()) { + UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); + return true; + } + } else { + if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) { + UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); + return true; } } - } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java index f0edd96bc58..c4afd226be2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java @@ -1,5 +1,6 @@ package mage.sets.championsofkamigawa; +import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -11,16 +12,19 @@ import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.*; +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.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.Token; -import java.util.UUID; - /** * @author Loki */ @@ -68,15 +72,15 @@ class AkkiLavarunnerAbility extends TriggeredAbilityImpl { return new AkkiLavarunnerAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - if (damageEvent.isCombatDamage() && this.sourceId.equals(event.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + return damageEvent.isCombatDamage() && this.sourceId.equals(event.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java index 43b28458e80..d27a1170aa6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java @@ -29,19 +29,19 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -88,16 +88,19 @@ class AkkiUnderminerAbility extends TriggeredAbilityImpl { return new AkkiUnderminerAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java index 932d3982658..14e5a67bdf4 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java @@ -28,18 +28,18 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; public class GlimpseOfNature extends CardImpl { @@ -79,9 +79,14 @@ class GlimpseOfNatureTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && filter.match(spell, game)) { return true; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java index 3215be1d38f..6e08a587c1d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java @@ -109,16 +109,21 @@ class GodoBanditWarlordAttacksTriggeredAbility extends TriggeredAbilityImpl { @Override public void reset(Game game) { - game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game), new Integer(0)); + game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game), 0); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + if (event.getSourceId().equals(this.getSourceId()) ) { Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game)); - if (amountAttacks == null || amountAttacks.intValue() < 1) { + if (amountAttacks == null || amountAttacks < 1) { if (amountAttacks == null) { - amountAttacks = new Integer(1); + amountAttacks = 1; } else { ++amountAttacks; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java index d3bb27b64e8..a254027b6a5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java @@ -97,14 +97,17 @@ class HorobiDeathsWailAbility extends TriggeredAbilityImpl { return new HorobiDeathsWailAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED) { - Permanent creature = game.getPermanent(event.getTargetId()); - if (creature != null && creature.getCardType().contains(CardType.CREATURE)) { - getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } + Permanent creature = game.getPermanent(event.getTargetId()); + if (creature != null && creature.getCardType().contains(CardType.CREATURE)) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java index 0ec6c8e799e..2745e9eb4f7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java @@ -48,8 +48,8 @@ import mage.constants.Zone; import mage.filter.common.FilterBlockingCreature; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; -import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -102,16 +102,19 @@ class KusariGamaAbility extends TriggeredAbilityImpl { return new KusariGamaAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedEvent) { - Permanent sourcePermanet = game.getPermanent(event.getSourceId()); - Permanent targetPermanet = game.getPermanent(event.getTargetId()); - if (sourcePermanet != null && targetPermanet != null && sourcePermanet.getAttachments().contains(this.getSourceId()) && filter.match(targetPermanet, game)) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setValue("damagedCreatureId", targetPermanet.getId()); - return true; - } + Permanent sourcePermanet = game.getPermanent(event.getSourceId()); + Permanent targetPermanet = game.getPermanent(event.getTargetId()); + if (sourcePermanet != null && targetPermanet != null && sourcePermanet.getAttachments().contains(this.getSourceId()) && filter.match(targetPermanet, game)) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setValue("damagedCreatureId", targetPermanet.getId()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java index f3f5312183c..6c5ed8f79d3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java @@ -44,6 +44,7 @@ import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -92,9 +93,14 @@ class NaturesWillTriggeredAbility extends TriggeredAbilityImpl { return new NaturesWillTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.COMBAT_DAMAGE_STEP_POST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { + if (event.getType() == EventType.DAMAGED_PLAYER) { DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; Permanent p = game.getPermanent(event.getSourceId()); if (damageEvent.isCombatDamage() && p != null && p.getControllerId().equals(this.getControllerId())) { @@ -102,7 +108,7 @@ class NaturesWillTriggeredAbility extends TriggeredAbilityImpl { damagedPlayers.add(event.getPlayerId()); } } - if (event.getType().equals(GameEvent.EventType.COMBAT_DAMAGE_STEP_POST)) { + if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_POST)) { if (madeDamge) { Set damagedPlayersCopy = new HashSet(); damagedPlayersCopy.addAll(damagedPlayers); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java index a95b255300b..551f3c750df 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java @@ -29,11 +29,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; @@ -41,8 +36,13 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlashAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -99,16 +99,19 @@ class RaggedVeinsTriggeredAbility extends TriggeredAbilityImpl { return new RaggedVeinsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent enchantment = game.getPermanent(sourceId); - UUID targetId = event.getTargetId(); - if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + UUID targetId = event.getTargetId(); + if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java index 3ed8eadffa1..ea8a4e12288 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java @@ -29,22 +29,22 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -97,14 +97,17 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl { return new SeshiroTheAnointedAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake") && p.getControllerId().equals(controllerId)) { - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake") && p.getControllerId().equals(controllerId)) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java index 6a73491ac9a..29c128af844 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java @@ -28,8 +28,6 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,11 +37,17 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; 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.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -100,17 +104,20 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl { return new SosukeSonOfSeshiroTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedCreatureEvent) { - if (((DamagedCreatureEvent) event).isCombatDamage()) { - Permanent sourceCreature = game.getPermanent(event.getSourceId()); - Permanent targetCreature = game.getPermanent(event.getTargetId()); - if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId()) - && targetCreature != null && sourceCreature.hasSubtype("Warrior")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); - return true; - } + if (((DamagedCreatureEvent) event).isCombatDamage()) { + Permanent sourceCreature = game.getPermanent(event.getSourceId()); + Permanent targetCreature = game.getPermanent(event.getTargetId()); + if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId()) + && targetCreature != null && sourceCreature.hasSubtype("Warrior")) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java index 419f09538d8..a9e7ff37dbf 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java @@ -49,6 +49,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; @@ -137,9 +138,14 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility { return new TatsumaTheDragonsFangTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) { return true; } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java index f729fef98f0..60799576bd0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java @@ -42,6 +42,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.combat.CombatGroup; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -80,13 +81,16 @@ class BlocksTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) { - for (CombatGroup combatGroup: game.getCombat().getGroups()) { - if (!combatGroup.getBlockers().isEmpty()) { - return true; - } + for (CombatGroup combatGroup: game.getCombat().getGroups()) { + if (!combatGroup.getBlockers().isEmpty()) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java index 723286834da..d34bb5e8faa 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java @@ -28,19 +28,19 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -95,18 +95,21 @@ class ZoZuThePunisherAbility extends TriggeredAbilityImpl { return new ZoZuThePunisherAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(player.getId())); - } - return true; + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(player.getId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java b/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java index 13e284417b6..cf4356084d8 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java +++ b/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java @@ -28,11 +28,6 @@ package mage.sets.coldsnap; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -43,10 +38,16 @@ import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEf import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VigilanceAbility; 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.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -141,9 +142,14 @@ class AdarkarValkyrieDelayedTriggeredAbility extends DelayedTriggeredAbility { return new AdarkarValkyrieDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) { return true; } diff --git a/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java b/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java index 560a5f0f70b..d1d2b43d7bc 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java +++ b/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.SoldierToken; import mage.players.Player; @@ -87,12 +88,17 @@ class DarienKingOfKjeldorTriggeredAbility extends TriggeredAbilityImpl { return new DarienKingOfKjeldorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - return true; - } + if ((event.getTargetId().equals(this.getControllerId()))) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; + } return false; } diff --git a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java index 68c678de3a2..d672dfc494a 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java +++ b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java @@ -45,6 +45,7 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.target.common.TargetCardInHand; @@ -180,6 +181,11 @@ class DelayedAddMainPhaseAbility extends DelayedTriggeredAbility { return new DelayedAddMainPhaseAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java b/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java index 2803c0e36ef..1da8c8e947a 100644 --- a/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java +++ b/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java @@ -87,10 +87,13 @@ class EdricSpymasterOfTrestTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } - if (event.getType().equals(EventType.DAMAGED_PLAYER) && - ((DamagedPlayerEvent) event).isCombatDamage() && + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (((DamagedPlayerEvent) event).isCombatDamage() && game.getOpponents(this.controllerId).contains(((DamagedPlayerEvent) event).getPlayerId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getPermanent(event.getSourceId()).getControllerId())); diff --git a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java index 1fda32b5b58..562935d4c6a 100644 --- a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java +++ b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java @@ -30,15 +30,15 @@ package mage.sets.commander; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -94,9 +94,14 @@ class KaaliaOfTheVastAttacksAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { Player opponent = game.getPlayer(event.getTargetId()); if (opponent != null) { return true; diff --git a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java index ee6da4ab795..fa7df34d3fa 100644 --- a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java +++ b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java @@ -27,6 +27,7 @@ */ package mage.sets.commander; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -38,16 +39,19 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author LevelX2 @@ -155,15 +159,17 @@ class SewerNemesisTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - // chosen player casts a spell - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - UUID playerId = (UUID) game.getState().getValue(getSourceId() + "_player"); - if (playerId.equals(event.getPlayerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(playerId)); - return true; - } + UUID playerId = (UUID) game.getState().getValue(getSourceId() + "_player"); + if (playerId.equals(event.getPlayerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(playerId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java index aba960d1bc1..cb4931a6e3c 100644 --- a/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java +++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java @@ -90,18 +90,21 @@ class CurseOfChaosTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.DECLARED_ATTACKERS)) { - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null - && enchantment.getAttachedTo() != null - && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); - } - return true; + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null + && enchantment.getAttachedTo() != null + && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java index 755913c61bf..12aa2df4bae 100644 --- a/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java +++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java @@ -94,26 +94,29 @@ class CurseOfPredationTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ATTACKER_DECLARED)) { - Player defender = game.getPlayer(event.getTargetId()); - if (defender == null) { - Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null) { - defender = game.getPlayer(planeswalker.getControllerId()); - } + Player defender = game.getPlayer(event.getTargetId()); + if (defender == null) { + Permanent planeswalker = game.getPermanent(event.getTargetId()); + if (planeswalker != null) { + defender = game.getPlayer(planeswalker.getControllerId()); } - if (defender != null) { - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null - && enchantment.getAttachedTo() != null - && enchantment.getAttachedTo().equals(defender.getId())) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + } + if (defender != null) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null + && enchantment.getAttachedTo() != null + && enchantment.getAttachedTo().equals(defender.getId())) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java index c466a4aba1b..fa2e34e982f 100644 --- a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java +++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java @@ -44,7 +44,6 @@ import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; -import mage.players.Player; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; @@ -95,18 +94,21 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.DECLARED_ATTACKERS)) { - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null - && enchantment.getAttachedTo() != null - && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); - } - return true; + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null + && enchantment.getAttachedTo() != null + && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java index 038f0b9a841..8011fafb75c 100644 --- a/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java +++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java @@ -93,26 +93,29 @@ class CurseOfTheForsakenTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ATTACKER_DECLARED)) { - Player defender = game.getPlayer(event.getTargetId()); - if (defender == null) { - Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null) { - defender = game.getPlayer(planeswalker.getControllerId()); - } + Player defender = game.getPlayer(event.getTargetId()); + if (defender == null) { + Permanent planeswalker = game.getPermanent(event.getTargetId()); + if (planeswalker != null) { + defender = game.getPlayer(planeswalker.getControllerId()); } - if (defender != null) { - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null - && enchantment.getAttachedTo() != null - && enchantment.getAttachedTo().equals(defender.getId())) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + } + if (defender != null) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null + && enchantment.getAttachedTo() != null + && enchantment.getAttachedTo().equals(defender.getId())) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java b/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java index 5d0cf42452d..125f9f87484 100644 --- a/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java +++ b/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java @@ -46,6 +46,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -97,6 +98,11 @@ class DereviEmpyrialTacticianTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD || event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD diff --git a/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java b/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java index 3efebe96d8a..6207f2a8db6 100644 --- a/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java +++ b/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java @@ -89,24 +89,27 @@ class GahijiHonoredOneTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ATTACKER_DECLARED)) { - Player defender = game.getPlayer(event.getTargetId()); - if (defender == null) { - Permanent planeswalker = game.getPermanent(event.getTargetId()); - if (planeswalker != null) { - defender = game.getPlayer(planeswalker.getControllerId()); - } + Player defender = game.getPlayer(event.getTargetId()); + if (defender == null) { + Permanent planeswalker = game.getPermanent(event.getTargetId()); + if (planeswalker != null) { + defender = game.getPlayer(planeswalker.getControllerId()); } - if (defender != null) { - Set opponents = game.getOpponents(this.getControllerId()); - if (opponents != null && opponents.contains(defender.getId())) { - for (Effect effect: this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + } + if (defender != null) { + Set opponents = game.getOpponents(this.getControllerId()); + if (opponents != null && opponents.contains(defender.getId())) { + for (Effect effect: this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/commander2013/Mirari.java b/Mage.Sets/src/mage/sets/commander2013/Mirari.java index 5d985d6293f..a0ed6f66ee0 100644 --- a/Mage.Sets/src/mage/sets/commander2013/Mirari.java +++ b/Mage.Sets/src/mage/sets/commander2013/Mirari.java @@ -41,6 +41,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.TargetSpell; @@ -95,9 +96,14 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl { return new MirariTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (isControlledInstantOrSorcery(spell)) { this.getTargets().get(0).clearChosen(); diff --git a/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java b/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java index 89fedf703ad..4ea19f2722f 100644 --- a/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java +++ b/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java @@ -126,9 +126,14 @@ class PlagueBoilerTriggeredAbility extends TriggeredAbilityImpl { return new PlagueBoilerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.COUNTER_ADDED) && event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.PLAGUE.getName())) { + if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.PLAGUE.getName())) { Permanent sourcePermanent = game.getPermanent(this.getSourceId()); if (sourcePermanent != null && sourcePermanent.getCounters().getCount(CounterType.PLAGUE) >= 3) { return true; diff --git a/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java b/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java index 6ee57c9c0a4..2afdb2d69b1 100644 --- a/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java +++ b/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java @@ -117,9 +117,14 @@ class ReincarnationDelayedTriggeredAbility extends DelayedTriggeredAbility { this.target = ability.target; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) { + if (event.getTargetId().equals(target)) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { return true; diff --git a/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java b/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java index 379782a1a7a..acc33c800a6 100644 --- a/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java +++ b/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java @@ -48,6 +48,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -93,9 +94,14 @@ class SunDropletTriggeredAbility extends TriggeredAbilityImpl { return new SunDropletTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { + if (event.getTargetId().equals(this.getControllerId())) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java b/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java index 4b498f8db46..7dd5c75d80c 100644 --- a/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java +++ b/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCardInHand; import mage.target.targetpointer.FixedTarget; @@ -84,15 +85,17 @@ class WidespreadPanicTriggeredAbility extends TriggeredAbilityImpl { return new WidespreadPanicTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LIBRARY_SHUFFLED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.LIBRARY_SHUFFLED)) { - for(Effect effect :this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + for (Effect effect :this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java index 862aa72691f..3436c1fb33d 100644 --- a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java +++ b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java @@ -200,19 +200,22 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl { return new DarettiScrapSavantTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) && - zEvent.getTarget().getOwnerId().equals(this.controllerId)) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(zEvent.getTargetId())); - } - return true; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) && + zEvent.getTarget().getOwnerId().equals(this.controllerId)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(zEvent.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java b/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java index 648fc5179ae..1bb4dd28be4 100644 --- a/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java +++ b/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java @@ -103,10 +103,15 @@ class PlayerLosesTheGameTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { + public boolean checkEventType(GameEvent event, Game game) { return event.getType() == EventType.LOSES; } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return true; + } + @Override public String getRule() { return "Whenever a player loses the game, put five +1/+1 counters on {this}."; diff --git a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java index 484a1864a58..3100b029dc9 100644 --- a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java +++ b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java @@ -28,14 +28,15 @@ package mage.sets.conflux; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; @@ -44,8 +45,6 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import java.util.UUID; - /** * * @author loki @@ -95,9 +94,14 @@ class BloodhallOozeTriggeredAbility1 extends TriggeredAbilityImpl { return new BloodhallOozeTriggeredAbility1(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { return true; } return false; @@ -135,9 +139,14 @@ class BloodhallOozeTriggeredAbility2 extends TriggeredAbilityImpl { return new BloodhallOozeTriggeredAbility2(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { return true; } return false; diff --git a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java index 9dc77e7ee7b..71acd4c156a 100644 --- a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java +++ b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java @@ -44,6 +44,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -101,18 +102,21 @@ class CorruptedRootsTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(enchantment.getAttachedTo()); - if (attached != null) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { + Permanent attached = game.getPermanent(enchantment.getAttachedTo()); + if (attached != null) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(attached.getControllerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java index 05b2b5d0219..47667373b22 100644 --- a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java +++ b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java @@ -29,16 +29,15 @@ package mage.sets.conflux; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; - import mage.target.TargetPlayer; /** @@ -79,15 +78,17 @@ class FontOfMythosAbility extends TriggeredAbilityImpl { return new FontOfMythosAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DRAW_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { - this.getTargets().clear(); - this.addTarget(new TargetPlayer()); - getTargets().get(0).add(event.getPlayerId(),game); - return true; - } - return false; + this.getTargets().clear(); + this.addTarget(new TargetPlayer()); + getTargets().get(0).add(event.getPlayerId(),game); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/conflux/KederektParasite.java b/Mage.Sets/src/mage/sets/conflux/KederektParasite.java index cf42f9ab4af..a55fb2f9178 100644 --- a/Mage.Sets/src/mage/sets/conflux/KederektParasite.java +++ b/Mage.Sets/src/mage/sets/conflux/KederektParasite.java @@ -28,16 +28,16 @@ package mage.sets.conflux; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -84,9 +84,14 @@ class KederektParasiteTriggeredAbility extends TriggeredAbilityImpl { return new KederektParasiteTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { boolean youControlRedPermanent = false; for (Permanent permanent : game.getBattlefield().getAllActivePermanents(this.getControllerId())) { if (permanent.getColor(game).isRed()) { diff --git a/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java b/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java index a0138fa9071..a0113ee14b3 100644 --- a/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java +++ b/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java @@ -92,12 +92,14 @@ class ParasiticStrixTriggeredAbility extends TriggeredAbilityImpl { return new ParasiticStrixTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD) && event.getTargetId().equals(this.getSourceId())) { - return true; - } - return false; + return event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java index 7338637ae0e..881d4bbb18a 100644 --- a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java +++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java @@ -30,9 +30,6 @@ package mage.sets.conflux; import java.util.UUID; import mage.MageObject; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.SpecialAction; @@ -43,10 +40,12 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.RemoveDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.RemoveSpecialActionEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; - import mage.target.TargetPlayer; /** @@ -148,9 +147,14 @@ class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility { return new QuenchableFireDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { for (SpecialAction action: game.getState().getSpecialActions()) { if (action.getId().equals(specialActionId)) { game.getState().getSpecialActions().remove(action); @@ -178,5 +182,4 @@ class QuenchableFireSpecialAction extends SpecialAction { public QuenchableFireSpecialAction copy() { return new QuenchableFireSpecialAction(this); } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java b/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java index cfaa23940e1..bb67a818b42 100644 --- a/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java +++ b/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java @@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -98,6 +99,11 @@ class SludgeStriderTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD || event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { diff --git a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java index 0ad44a2f54a..e9d62fe6ab5 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java +++ b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java @@ -54,6 +54,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -129,6 +130,11 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { public DackFaydenEmblemTriggeredAbility copy() { return new DackFaydenEmblemTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } @Override public boolean checkTrigger(GameEvent event, Game game) { @@ -136,7 +142,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl { List targettedPermanents = new ArrayList<>(0); Player player = game.getPlayer(this.getControllerId()); if (player != null) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { SpellAbility spellAbility = spell.getSpellAbility(); diff --git a/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java index a4fc613a6b8..40064cb8583 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java +++ b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java @@ -28,11 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -42,8 +37,14 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.token.SpiritWhiteToken; @@ -93,9 +94,14 @@ class AvacynsCollarTriggeredAbility extends TriggeredAbilityImpl { return new AvacynsCollarTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human")) { return true; diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java index 3fcdd765c38..9a5b75ad48d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java +++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java @@ -27,6 +27,7 @@ */ package mage.sets.darkascension; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.DynamicValue; @@ -41,13 +42,12 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author BetaSteward @@ -97,16 +97,19 @@ class CurseOfThirstAbility extends TriggeredAbilityImpl { return new CurseOfThirstAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; - } + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player != null && game.getActivePlayerId().equals(player.getId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java index 1feaf489553..ccbb3cf69f8 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java +++ b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java @@ -27,8 +27,7 @@ */ package mage.sets.darkascension; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -36,18 +35,19 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetOpponent; -import java.util.UUID; - /** * * @author Loki @@ -103,9 +103,14 @@ class DiregrafCaptainTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) { + if (!event.getTargetId().equals(this.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); diff --git a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java index 67978444b93..a3198b7d868 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java +++ b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -87,9 +88,14 @@ class DrogskolReaverAbility extends TriggeredAbilityImpl { return new DrogskolReaverAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId); + return event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java index d629ffaaced..41e66775f09 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java +++ b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java @@ -27,8 +27,7 @@ */ package mage.sets.darkascension; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -36,17 +35,18 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.UndyingAbility; 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.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; -import java.util.UUID; -import mage.game.events.EntersTheBattlefieldEvent; - /** * * @author BetaSteward @@ -89,17 +89,20 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD - && permanent.getOwnerId().equals(controllerId) - && permanent.getCardType().contains(CardType.CREATURE)) { - Effect effect = this.getEffects().get(0); - effect.setValue("damageSource", event.getTargetId()); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD + && permanent.getOwnerId().equals(controllerId) + && permanent.getCardType().contains(CardType.CREATURE)) { + Effect effect = this.getEffects().get(0); + effect.setValue("damageSource", event.getTargetId()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java index 33c7c884a2d..61935aede9b 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java +++ b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java @@ -51,6 +51,7 @@ import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInGraveyard; @@ -169,9 +170,14 @@ class HavengulLichDelayedTriggeredAbility extends DelayedTriggeredAbility { this.cardId = ability.cardId; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.SPELL_CAST && event.getSourceId().equals(cardId); + return event.getSourceId().equals(cardId); } @Override diff --git a/Mage.Sets/src/mage/sets/darkascension/Hellrider.java b/Mage.Sets/src/mage/sets/darkascension/Hellrider.java index b2915a627bf..54fe016e31b 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Hellrider.java +++ b/Mage.Sets/src/mage/sets/darkascension/Hellrider.java @@ -28,16 +28,17 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -85,15 +86,18 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl { return new HellriderTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - Permanent source = game.getPermanent(event.getSourceId()); - if (source != null && source.getControllerId().equals(controllerId)) { - UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId)); - return true; - } + Permanent source = game.getPermanent(event.getSourceId()); + if (source != null && source.getControllerId().equals(controllerId)) { + UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java b/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java index 6f1eac04a6d..4e2890e6403 100644 --- a/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java +++ b/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java @@ -28,10 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -45,10 +41,15 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -100,10 +101,14 @@ class JarOfEyeballsTriggeredAbility extends TriggeredAbilityImpl { return new JarOfEyeballsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java b/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java index 7fb564d35ac..e03da865fa6 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java +++ b/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java @@ -28,18 +28,19 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -86,16 +87,19 @@ class ShriekgeistTriggeredAbility extends TriggeredAbilityImpl { return new ShriekgeistTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java b/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java index fb1853dca43..02e4cb5f09d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java +++ b/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java @@ -28,10 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,12 +35,16 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -99,19 +99,22 @@ class SoulSeizerTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - Player opponent = game.getPlayer(event.getPlayerId()); - if (opponent != null) { - FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); - filter.add(new ControllerIdPredicate(opponent.getId())); + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } - this.getTargets().clear(); - this.addTarget(new TargetCreaturePermanent(filter)); - return true; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + Player opponent = game.getPlayer(event.getPlayerId()); + if (opponent != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); + filter.add(new ControllerIdPredicate(opponent.getId())); + + this.getTargets().clear(); + this.addTarget(new TargetCreaturePermanent(filter)); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java b/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java index 08df247c52e..0d273b38a4e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java +++ b/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java @@ -28,18 +28,19 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -92,16 +93,19 @@ class SpitefulShadowsTriggeredAbility extends TriggeredAbilityImpl { return new SpitefulShadowsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent enchantment = game.getPermanent(sourceId); - UUID targetId = event.getTargetId(); - if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + UUID targetId = event.getTargetId(); + if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java b/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java index 2ef04e4c7b7..43246ddf7e7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java +++ b/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java @@ -28,10 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; @@ -42,8 +38,13 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -99,9 +100,14 @@ class TovolarsMagehunterTriggeredAbility extends TriggeredAbilityImpl { return new TovolarsMagehunterTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java index 20b2619b740..bf1a2905c5d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java +++ b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java @@ -28,7 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbility; @@ -42,11 +41,15 @@ import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.FilterPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterArtifactPermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; @@ -108,13 +111,17 @@ class WerewolfRansackerAbility extends TriggeredAbilityImpl { return new WerewolfRansackerAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TRANSFORMED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TRANSFORMED) { - if (event.getTargetId().equals(sourceId)) { - Permanent permanent = game.getPermanent(sourceId); - if (permanent != null && permanent.isTransformed()) - return true; + if (event.getTargetId().equals(sourceId)) { + Permanent permanent = game.getPermanent(sourceId); + if (permanent != null && permanent.isTransformed()) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java index 95c340d8b7d..6803181b753 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java +++ b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java @@ -28,9 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -38,10 +35,13 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.IntimidateAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -96,11 +96,14 @@ class WithengarUnboundTriggeredAbility extends TriggeredAbilityImpl { return new WithengarUnboundTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LOST) - return true; - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java index 522a57acdd4..3ec918d0114 100644 --- a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java +++ b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java @@ -85,10 +85,15 @@ class LichsTombTriggeredAbility extends TriggeredAbilityImpl { public LichsTombTriggeredAbility copy() { return new LichsTombTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_LIFE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.LOST_LIFE && event.getPlayerId() == this.getControllerId()) { + if (event.getPlayerId() == this.getControllerId()) { ((SacrificeEffect) this.getEffects().get(0)).setAmount(new StaticValue(event.getAmount())); return true; } diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java index e519e617778..7843ac73fcf 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java +++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java @@ -29,12 +29,6 @@ package mage.sets.darksteel; import java.util.UUID; - -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -46,12 +40,18 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreatureOrPlayer; @@ -111,16 +111,16 @@ class SwordOfFireAndIceAbility extends TriggeredAbilityImpl { return new SwordOfFireAndIceAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java index b4be8adc413..1d4414a3c46 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java +++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java @@ -55,6 +55,7 @@ import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -129,16 +130,16 @@ class SwordOfLightAndShadowAbility extends TriggeredAbilityImpl { return new SwordOfLightAndShadowAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/dissension/ProperBurial.java b/Mage.Sets/src/mage/sets/dissension/ProperBurial.java index e09d61985ed..a63d354ae58 100644 --- a/Mage.Sets/src/mage/sets/dissension/ProperBurial.java +++ b/Mage.Sets/src/mage/sets/dissension/ProperBurial.java @@ -28,14 +28,15 @@ package mage.sets.dissension; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -79,10 +80,14 @@ class ProperBurialTriggeredAbility extends TriggeredAbilityImpl { return new ProperBurialTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java index c2a687e9e82..c92e93989b1 100644 --- a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java +++ b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java @@ -28,10 +28,6 @@ package mage.sets.dissension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.Mana; import mage.ObjectColor; import mage.abilities.Ability; @@ -43,12 +39,16 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; +import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -138,14 +138,17 @@ class UtopiaSprawlTriggeredAbility extends TriggeredManaAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } + if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { + return true; + } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java index ad25ec436b2..8bed02cb907 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java @@ -29,24 +29,20 @@ package mage.sets.dragonsmaze; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.SplitCard; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -/** - * - * @author LevelX2 - */ public class BeckCall extends SplitCard { @@ -88,14 +84,17 @@ class BeckTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (filter.match(permanent, getSourceId(), getControllerId(), game)) { - return true; - } + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (filter.match(permanent, getSourceId(), getControllerId(), game)) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java b/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java index bcac27da9be..2deae6da5c2 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java @@ -28,22 +28,19 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; -import mage.game.events.DamagedPlayerEvent; +import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -/** - * - * @author LevelX2 - */ public class BredForTheHunt extends CardImpl { @@ -83,9 +80,14 @@ class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl { return new BredForTheHuntTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (((DamagedEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters().getCount(CounterType.P1P1) > 0) { return true; diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java b/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java index 865e8d8b75f..452b6a2a433 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java @@ -29,10 +29,6 @@ package mage.sets.dragonsmaze; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -40,15 +36,15 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -/** - * - * @author LevelX2 - */ public class CarnageGladiator extends CardImpl { @@ -97,14 +93,17 @@ class CarnageGladiatorTriggeredAbility extends TriggeredAbilityImpl { return new CarnageGladiatorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - if (blocker != null) { - getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId())); - return true; - } + Permanent blocker = game.getPermanent(event.getSourceId()); + if (blocker != null) { + getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java b/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java index ff74e7bdacc..776570e5a0f 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java @@ -28,25 +28,25 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.CanAttackOnlyAloneAbility; -import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.FirstStrikeAbility; 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.game.Game; import mage.game.combat.CombatGroup; import mage.game.events.DamageEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -102,18 +102,21 @@ class MasterOfCrueltiesTriggeredAbility extends TriggeredAbilityImpl { return new MasterOfCrueltiesTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) { - Permanent sourcePermanent = game.getPermanent(getSourceId()); - if (sourcePermanent.isAttacking()) { - for (CombatGroup combatGroup: game.getCombat().getGroups()) { - if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { - // check if a player is attacked (instead of a planeswalker) - Player defendingPlayer = game.getPlayer(combatGroup.getDefenderId()); - if (defendingPlayer != null) { - return true; - } + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent.isAttacking()) { + for (CombatGroup combatGroup: game.getCombat().getGroups()) { + if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { + // check if a player is attacked (instead of a planeswalker) + Player defendingPlayer = game.getPlayer(combatGroup.getDefenderId()); + if (defendingPlayer != null) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java b/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java index 86ab55c65f8..f174c83e2f2 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java @@ -28,10 +28,6 @@ package mage.sets.dragonsmaze; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -40,6 +36,9 @@ import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.continuous.PlayTheTopCardEffect; import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; @@ -108,10 +107,14 @@ class MelekIzzetParagonTriggeredAbility extends TriggeredAbilityImpl { return new MelekIzzetParagonTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST - && event.getZone() == Zone.LIBRARY) { + if (event.getZone() == Zone.LIBRARY) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && spell.getControllerId().equals(super.getControllerId()) diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java b/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java index a03b595e714..bc2c1c60145 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java @@ -31,10 +31,6 @@ package mage.sets.dragonsmaze; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; @@ -43,16 +39,17 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.keyword.BloodrushAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; -import mage.game.events.DamagedPlayerEvent; +import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -/** - * - * @author LevelX2 - */ public class PyrewildShaman extends CardImpl { @@ -102,10 +99,17 @@ class PyrewildShamanTriggeredAbility extends TriggeredAbilityImpl { return new PyrewildShamanTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.END_COMBAT_STEP_POST + || event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { + if (((DamagedEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null && creature.getControllerId().equals(controllerId) && !damagedPlayerIds.contains(event.getTargetId())) { damagedPlayerIds.add(event.getTargetId()); diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java index efafb1dac5b..6bd8f47bef9 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java @@ -29,26 +29,23 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.keyword.EvolveAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.CounterPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.StackObject; -/** - * - * @author LevelX2 - */ public class RenegadeKrasis extends CardImpl { @@ -101,10 +98,14 @@ class RenegadeKrasisTriggeredAbility extends TriggeredAbilityImpl { return new RenegadeKrasisTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.COUNTER_ADDED) - && event.getTargetId().equals(getSourceId())) { + if (event.getTargetId().equals(getSourceId())) { Object object = game.getState().getValue("EvolveAddCounterActive"); if (object != null && (Boolean) object) { StackObject stackObject = game.getStack().getLast(); diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java b/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java index 161f0aa220c..9dbc81fb428 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java @@ -28,20 +28,20 @@ package mage.sets.dragonsmaze; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AttacksEachTurnStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -99,18 +99,20 @@ class RuricTharTheUnbowedAbility extends TriggeredAbilityImpl { return new RuricTharTheUnbowedAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null - && !spell.getCardType().contains(CardType.CREATURE)) { + if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; } - } return false; } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java index bad8df6dab8..8bebbae8f2e 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java @@ -29,7 +29,6 @@ package mage.sets.dragonsmaze; import java.util.UUID; import mage.MageInt; -import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.DynamicValue; @@ -45,6 +44,7 @@ import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.token.Token; import mage.game.stack.Spell; @@ -88,6 +88,11 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST || event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { // Opponent casts spell during your turn diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java b/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java index 844cfa4b97b..783fafd52f6 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java @@ -28,17 +28,18 @@ package mage.sets.dragonsmaze; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -82,12 +83,14 @@ class ZhurTaaDruidAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && event.getSourceId().equals(getSourceId())) { - return true; - } - return false; + return event.getSourceId().equals(getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java index 786d8eb7b96..46169d9541e 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java @@ -38,11 +38,11 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -99,6 +99,11 @@ class ArashinForemostAbility extends TriggeredAbilityImpl { return new ArashinForemostAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java index 93568ecf4f2..9e801b7b500 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java @@ -34,14 +34,12 @@ import mage.abilities.DelayedTriggeredAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.FightTargetSourceEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; @@ -149,17 +147,18 @@ class FoeRazerRegentDelayedTriggeredAbility extends DelayedTriggeredAbility { return new FoeRazerRegentDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.END_TURN_STEP_PRE) { - return true; - } - return false; + return true; } @Override public String getRule() { return "put two +1/+1 counters on it at the beginning of the next end step"; } - } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java index aa633789f00..b3385304d2b 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java @@ -40,6 +40,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetOpponent; /** @@ -89,14 +90,15 @@ class RuthlessDeathfangTriggeredAbility extends TriggeredAbilityImpl { return new RuthlessDeathfangTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT - && event.getPlayerId().equals(this.getControllerId()) - && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) { - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()) + && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE); } @Override diff --git a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java index dea771ba4ba..3b525f22126 100644 --- a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java +++ b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java @@ -29,19 +29,19 @@ package mage.sets.eventide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeTargetEffect; 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.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -90,19 +90,22 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - Player opponent = game.getPlayer(event.getPlayerId()); - if (opponent != null) { - FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); - filter.add(new ControllerIdPredicate(opponent.getId())); + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } - this.getTargets().clear(); - this.addTarget(new TargetCreaturePermanent(filter)); - return true; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + Player opponent = game.getPlayer(event.getPlayerId()); + if (opponent != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); + filter.add(new ControllerIdPredicate(opponent.getId())); + + this.getTargets().clear(); + this.addTarget(new TargetCreaturePermanent(filter)); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java index 0b71d9524b5..5d67ee26ccd 100644 --- a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java +++ b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java @@ -40,6 +40,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -91,25 +92,28 @@ class NecroskitterTriggeredAbility extends TriggeredAbilityImpl { return new NecroskitterTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (game.getPermanent(sourceId) == null) { - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (game.getPermanent(sourceId) == null) { + if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { + return false; } - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null - && permanent.getCounters().containsKey(CounterType.M1M1) - && game.getOpponents(controllerId).contains(permanent.getControllerId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + } + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (permanent != null + && permanent.getCounters().containsKey(CounterType.M1M1) + && game.getOpponents(controllerId).contains(permanent.getControllerId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/eventide/Spitemare.java b/Mage.Sets/src/mage/sets/eventide/Spitemare.java index e1f0be4bf9a..0f121a7a963 100644 --- a/Mage.Sets/src/mage/sets/eventide/Spitemare.java +++ b/Mage.Sets/src/mage/sets/eventide/Spitemare.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; @@ -88,9 +89,14 @@ class SpitemareTriggeredAbility extends TriggeredAbilityImpl { return new SpitemareTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(this.sourceId)) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java b/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java index c98427c63e3..b2b2cd080a0 100644 --- a/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java +++ b/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java @@ -28,18 +28,18 @@ package mage.sets.eventide; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; 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; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -86,12 +86,14 @@ class BecomesUntappedControlledPermanentTriggeredAbility extends TriggeredAbilit return new BecomesUntappedControlledPermanentTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UNTAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UNTAPPED && game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId)) { - return true; - } - return false; + return game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java b/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java index c41dc5fdfa7..8b0ee765545 100644 --- a/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java +++ b/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.TurnPhase; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.watchers.Watcher; @@ -162,6 +163,11 @@ class WavesOfAggressionDelayedAddMainPhaseAbility extends DelayedTriggeredAbilit return new WavesOfAggressionDelayedAddMainPhaseAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java b/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java index 0659cbd5c0d..07d2ccdfd64 100644 --- a/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java +++ b/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java @@ -28,18 +28,18 @@ package mage.sets.exodus; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -79,17 +79,17 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LAND_PLAYED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LAND_PLAYED) { - Permanent land = game.getPermanent(event.getTargetId()); - if (land.getCardType().contains(CardType.LAND) - && land.getControllerId().equals(this.controllerId) - && event.getTargetId() != this.getSourceId()) { - return true; - } - } - return false; + Permanent land = game.getPermanent(event.getTargetId()); + return land.getCardType().contains(CardType.LAND) + && land.getControllerId().equals(this.controllerId) + && event.getTargetId() != this.getSourceId(); } @Override diff --git a/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java b/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java index 6e9b73d8b87..4e07f51447c 100644 --- a/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java +++ b/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java @@ -28,19 +28,19 @@ package mage.sets.exodus; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.ShadowAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterEnchantmentPermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; -import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -91,18 +91,21 @@ class SoltariVisionaryTriggeredAbility extends TriggeredAbilityImpl { return new SoltariVisionaryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - Permanent soltari = game.getPermanent(event.getSourceId()); - if (soltari != null && soltari.getId() == this.getSourceId()) { - FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls."); - filter.add(new ControllerIdPredicate(event.getPlayerId())); - filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getLogName()); - this.getTargets().clear(); - this.addTarget(new TargetPermanent(filter)); - return true; - } + Permanent soltari = game.getPermanent(event.getSourceId()); + if (soltari != null && soltari.getId() == this.getSourceId()) { + FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls."); + filter.add(new ControllerIdPredicate(event.getPlayerId())); + filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + this.getTargets().clear(); + this.addTarget(new TargetPermanent(filter)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/fallenempires/HighTide.java b/Mage.Sets/src/mage/sets/fallenempires/HighTide.java index e4a947dc8ae..a05092aa2e8 100644 --- a/Mage.Sets/src/mage/sets/fallenempires/HighTide.java +++ b/Mage.Sets/src/mage/sets/fallenempires/HighTide.java @@ -28,21 +28,21 @@ package mage.sets.fallenempires; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.mana.DelayedTriggeredManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Duration; +import mage.constants.Rarity; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -56,10 +56,9 @@ public class HighTide extends CardImpl { super(ownerId, 35, "High Tide", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "FEM"; - // Until end of turn, whenever a player taps an Island for mana, that player adds {U} to his or her mana pool. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new HighTideTriggeredAbility())); - + } public HighTide(final HighTide card) { @@ -75,9 +74,9 @@ public class HighTide extends CardImpl { class HighTideTriggeredAbility extends DelayedTriggeredManaAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Island"); - + static { - filter.add(new SubtypePredicate("Island")); + filter.add(new SubtypePredicate("Island")); } public HighTideTriggeredAbility() { @@ -89,10 +88,15 @@ class HighTideTriggeredAbility extends DelayedTriggeredManaAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent land = game.getPermanent(event.getTargetId()); - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && land != null && filter.match(land, game)) { + if (land != null && filter.match(land, game)) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(land.getControllerId())); } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java b/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java index 19991829197..b810c8e7265 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java @@ -28,18 +28,17 @@ package mage.sets.fifthdawn; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; 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; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.stack.Spell; +import mage.game.events.GameEvent.EventType; /** * @@ -85,15 +84,14 @@ class BlindCreeperAbility extends TriggeredAbilityImpl { return new BlindCreeperAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null) { - return true; - } - } - return false; + return game.getStack().getSpell(event.getTargetId()) != null; } @Override diff --git a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java index 88c61fc57d8..8a06a839efe 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -93,15 +94,15 @@ class DawnsReflectionTriggeredAbility extends TriggeredManaAbility { return new DawnsReflectionTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; + Permanent enchantment = game.getPermanent(this.getSourceId()); + return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); } diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java index b67288d2365..b0e425fdd15 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java @@ -39,6 +39,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -87,16 +88,19 @@ class RiteOfPassageTriggeredAbility extends TriggeredAbilityImpl { return new RiteOfPassageTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/fifthedition/Blight.java b/Mage.Sets/src/mage/sets/fifthedition/Blight.java index 252c62715a6..dc7821b2b6a 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Blight.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Blight.java @@ -28,9 +28,6 @@ package mage.sets.fifthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -38,10 +35,13 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -89,18 +89,21 @@ class BlightTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(enchantment.getAttachedTo()); - if (attached != null) { - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getId())); - } - return true; + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) { + Permanent attached = game.getPermanent(enchantment.getAttachedTo()); + if (attached != null) { + for (Effect e : getEffects()) { + e.setTargetPointer(new FixedTarget(attached.getId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/fifthedition/Justice.java b/Mage.Sets/src/mage/sets/fifthedition/Justice.java index ffa932141df..0782eddfe83 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Justice.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Justice.java @@ -27,7 +27,7 @@ */ package mage.sets.fifthedition; -import mage.constants.*; +import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -37,15 +37,19 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author jeffwadsworth @@ -89,19 +93,22 @@ class JusticeTriggeredAbility extends TriggeredAbilityImpl { return new JusticeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE - || event.getType() == GameEvent.EventType.DAMAGED_PLAYER - || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) { - MageObject sourceObject = game.getObject(event.getSourceId()); - if (sourceObject.getColor(game).isRed()) { - if (sourceObject instanceof Permanent && sourceObject.getCardType().contains(CardType.CREATURE) - || sourceObject instanceof Spell) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId()))); - return true; - } + MageObject sourceObject = game.getObject(event.getSourceId()); + if (sourceObject.getColor(game).isRed()) { + if (sourceObject instanceof Permanent && sourceObject.getCardType().contains(CardType.CREATURE) + || sourceObject instanceof Spell) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId()))); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java index d87b9cab0b3..98b564a6bbf 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java +++ b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -85,12 +86,14 @@ class TheRackTriggeredAbility extends TriggeredAbilityImpl { return new TheRackTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return event.getPlayerId().equals((UUID) game.getState().getValue(new StringBuilder(this.getSourceId().toString()).append("_player").toString())); - } - return false; + return event.getPlayerId().equals((UUID) game.getState().getValue(new StringBuilder(this.getSourceId().toString()).append("_player").toString())); } @Override diff --git a/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java b/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java index 893abce9671..dd106c5a4a1 100644 --- a/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java +++ b/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java @@ -43,6 +43,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.combat.CombatGroup; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -99,15 +100,18 @@ class FrenzyAbility extends TriggeredAbilityImpl { return new FrenzyAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) { - Permanent sourcePermanent = game.getPermanent(getSourceId()); - if (sourcePermanent.isAttacking()) { - for (CombatGroup combatGroup: game.getCombat().getGroups()) { - if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { - return true; - } + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent.isAttacking()) { + for (CombatGroup combatGroup: game.getCombat().getGroups()) { + if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java index 287277332dc..2ae7c2d510c 100644 --- a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java +++ b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -85,17 +86,20 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl { public HeartwoodStorytellerTriggeredAbility copy() { return new HeartwoodStorytellerTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java index 2a83f0ab877..11cfa55720f 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java @@ -28,10 +28,6 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -43,8 +39,11 @@ import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TurnPhase; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -110,17 +109,22 @@ class AureliaAttacksTriggeredAbility extends TriggeredAbilityImpl { @Override public void reset(Game game) { Card sourceCard = game.getCard(getSourceId()); - game.getState().setValue(getValueKey(sourceCard, game), new Integer(0)); + game.getState().setValue(getValueKey(sourceCard, game), 0); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + if (event.getSourceId().equals(this.getSourceId()) ) { Card sourceCard = game.getCard(getSourceId()); Integer amountAttacks = (Integer) game.getState().getValue(getValueKey(sourceCard, game)); - if (amountAttacks == null || amountAttacks.intValue() < 1) { + if (amountAttacks == null || amountAttacks < 1) { if (amountAttacks == null) { - amountAttacks = new Integer(1); + amountAttacks = 1; } else { ++amountAttacks; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java b/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java index 69d29454f28..87693e80a76 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java +++ b/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java @@ -29,19 +29,20 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.Mana; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.keyword.ExtortAbility; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -90,15 +91,15 @@ class CryptGhastTriggeredAbility extends TriggeredManaAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { - Permanent land = game.getPermanent(event.getTargetId()); - if (land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game)) { - return true; - } - } - return false; + Permanent land = game.getPermanent(event.getTargetId()); + return land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game); } @Override diff --git a/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java index 6cfb3ad6b2d..c608882f9a0 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java @@ -28,10 +28,6 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -43,6 +39,10 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -99,19 +99,22 @@ class CardPutIntoOpponentGraveThisTurn extends DelayedTriggeredAbility { return new CardPutIntoOpponentGraveThisTurn(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - UUID cardId = event.getTargetId(); - Card card = game.getCard(cardId); - if (card != null && zEvent.getToZone() == Zone.GRAVEYARD && !card.isCopy() - && game.getOpponents(controllerId).contains(card.getOwnerId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(card.getOwnerId())); - } - return true; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + UUID cardId = event.getTargetId(); + Card card = game.getCard(cardId); + if (card != null && zEvent.getToZone() == Zone.GRAVEYARD && !card.isCopy() + && game.getOpponents(controllerId).contains(card.getOwnerId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(card.getOwnerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java index 2a399e55387..67f67d0d830 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java @@ -29,18 +29,18 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.EvolveAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -86,14 +86,14 @@ class FathomMageTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.COUNTER_ADDED) { - if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName())) { - return true; - } - } - return false; + return event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName()); } @Override diff --git a/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java b/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java index 1d18de1d7df..cfb6dce7dc3 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java +++ b/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java @@ -101,23 +101,29 @@ class FiveAlarmFireTriggeredAbility extends TriggeredAbilityImpl { return new FiveAlarmFireTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLANESWALKER + || event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE - || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER - || event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { + if (event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLANESWALKER + || event.getType() == EventType.DAMAGED_PLAYER) { if (((DamagedEvent) event).isCombatDamage() && !triggeringCreatures.contains(event.getSourceId())) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { triggeringCreatures.add(event.getSourceId()); return true; } - } - } // reset the remembered creatures for every combat damage step - if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_PRE)) { + if (event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE) { triggeringCreatures.clear(); } return false; diff --git a/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java b/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java index d2e18c0c0dd..d1f3b76f5e9 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java +++ b/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java @@ -28,19 +28,23 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardIdPredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -100,20 +104,23 @@ class GruulRagebeastTriggeredAbility extends TriggeredAbilityImpl { return new GruulRagebeastTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (permanent.getControllerId().equals(this.controllerId) - && permanent.getCardType().contains(CardType.CREATURE) - && (targetId.equals(this.getSourceId()) - || !targetId.equals(this.getSourceId()))) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (permanent.getControllerId().equals(this.controllerId) + && permanent.getCardType().contains(CardType.CREATURE) + && (targetId.equals(this.getSourceId()) + || !targetId.equals(this.getSourceId()))) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java b/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java index 40afe2cf989..1c2196d126b 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java +++ b/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java @@ -29,16 +29,16 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetNonlandPermanent; /** @@ -88,14 +88,14 @@ class HighPriestOfPenanceTriggeredAbility extends TriggeredAbilityImpl { return new HighPriestOfPenanceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - if (event.getTargetId().equals(this.sourceId)) { - return true; - } - } - return false; + return event.getTargetId().equals(this.sourceId); } @Override diff --git a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java index ff3acf02366..83a86cc47b6 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java +++ b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java @@ -28,10 +28,6 @@ package mage.sets.gatecrash; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,8 +36,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.mana.ManaAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.StackAbility; import mage.players.Player; @@ -88,17 +89,20 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl { return new AbilityActivatedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ACTIVATED_ABILITY; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { - Permanent equipment = game.getPermanent(this.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null && equipment.getAttachedTo().equals(event.getSourceId())) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { - Effect effect = this.getEffects().get(0); - effect.setValue("stackAbility", stackAbility.getStackAbility()); - return true; - } + Permanent equipment = game.getPermanent(this.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null && equipment.getAttachedTo().equals(event.getSourceId())) { + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); + if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { + Effect effect = this.getEffects().get(0); + effect.setValue("stackAbility", stackAbility.getStackAbility()); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java b/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java index ffbdfecb931..915acc973a2 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java +++ b/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java @@ -28,15 +28,19 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; 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.WatcherScope; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.watchers.Watcher; @@ -85,9 +89,14 @@ class IncursionTriggeredAbility extends TriggeredAbilityImpl { return new IncursionTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { + if (event.getPlayerId().equals(controllerId)) { Watcher watcher = game.getState().getWatchers().get("SecondSpellCast", controllerId); if (watcher != null && watcher.conditionMet()) { return true; diff --git a/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java index 7738e497bce..211072dca85 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java +++ b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java @@ -29,17 +29,17 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -73,7 +73,6 @@ public class LeylinePhantom extends CardImpl { class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl { - public LeylinePhantomTriggeredAbility() { super(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), false); } @@ -87,14 +86,14 @@ class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl { return new LeylinePhantomTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE || event.getType() == EventType.DAMAGED_PLANESWALKER || event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if(((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(this.getSourceId())){ - return true; - } - } - return false; + return ((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java index 1e15e297516..8de83fd6c9d 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java +++ b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java @@ -29,9 +29,6 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -46,13 +43,16 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.HasteAbility; 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.TargetController; import mage.constants.Zone; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -138,9 +138,14 @@ class BeginningOfYourUpkeepdelayTriggeredAbility extends DelayedTriggeredAbility super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId); + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java b/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java index 1d29e0ce3ad..02819caf9d9 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java +++ b/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java @@ -28,15 +28,13 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; 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.FilterPermanent; import mage.filter.predicate.Predicates; @@ -44,6 +42,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.Target; import mage.target.TargetPermanent; @@ -89,9 +88,14 @@ class BecomesBlockedTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.CREATURE_BLOCKED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) { + if (event.getTargetId().equals(this.getSourceId())) { UUID defenderId = game.getState().getCombat().findGroup(this.getSourceId()).getDefenderId(); if (defenderId != null) { this.getTargets().clear(); diff --git a/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java b/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java index d0abdaa242c..f53b501b94a 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java +++ b/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -98,14 +99,14 @@ class VerdantHavenTriggeredAbility extends TriggeredManaAbility { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); } diff --git a/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java index cf9b249967c..04b112d2ef0 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java +++ b/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java @@ -29,12 +29,6 @@ package mage.sets.gatecrash; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -45,8 +39,14 @@ import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.LifelinkAbility; 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.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -106,10 +106,15 @@ class VizkopaGuildmageDelayedTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getTargetId().equals(controllerId)) { - getEffects().get(0).setValue("amountLifeGained", new Integer(event.getAmount())); + if (event.getTargetId().equals(controllerId)) { + getEffects().get(0).setValue("amountLifeGained", event.getAmount()); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java index 6147d04f377..dded38dbd82 100644 --- a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java +++ b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java @@ -29,17 +29,17 @@ package mage.sets.guildpact; import java.util.UUID; - -import mage.constants.AbilityType; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.AbilityType; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.StackAbility; import mage.target.TargetPlayer; @@ -86,14 +86,17 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl { return new BurningTreeShamanTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ACTIVATED_ABILITY; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) { - this.getTargets().get(0).add(event.getPlayerId(), game); - return true; - } + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); + if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) { + this.getTargets().get(0).add(event.getPlayerId(), game); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java b/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java index bba04f81dab..00dfc684c65 100644 --- a/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java +++ b/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java @@ -28,21 +28,22 @@ package mage.sets.guildpact; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; -import mage.cards.CardImpl; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.stack.Spell; import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterInPlay; import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; +import mage.game.stack.Spell; import mage.target.Target; import mage.util.TargetAddress; @@ -88,17 +89,20 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl { return new InkTreaderNephilimTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && - (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){ - for (Effect effect : getEffects()) { - effect.setValue("triggeringSpell", spell); - } - return true; + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && + (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){ + for (Effect effect : getEffects()) { + effect.setValue("triggeringSpell", spell); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java b/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java index 6cd66ece7e1..ca4f72da4ee 100644 --- a/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java +++ b/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java @@ -42,6 +42,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -90,10 +91,14 @@ class SoulsOfTheFaultlessTriggeredAbility extends TriggeredAbilityImpl { return new SoulsOfTheFaultlessTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE - && event.getTargetId().equals(this.sourceId) + if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent) event).isCombatDamage()) { Permanent source = game.getPermanent(event.getSourceId()); if (source == null) { diff --git a/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java b/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java index 1e344e09817..d81bd55dca7 100644 --- a/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java +++ b/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java @@ -90,10 +90,14 @@ class DeusOfCalamityTriggeredAbility extends TriggeredAbilityImpl { return new DeusOfCalamityTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.DAMAGED_PLAYER) - && event.getSourceId().equals(this.getSourceId()) + if (event.getSourceId().equals(this.getSourceId()) && event.getAmount() > 5 && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) { FilterLandPermanent filter = new FilterLandPermanent("land of the damaged player"); diff --git a/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java b/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java index 64654ecfdcc..853103d47ab 100644 --- a/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java +++ b/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java @@ -41,6 +41,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -89,9 +90,14 @@ class KavuPredatorTriggeredAbility extends TriggeredAbilityImpl { return new KavuPredatorTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.GAINED_LIFE) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { this.getEffects().get(0).setValue("gainedLife", new Integer(event.getAmount())); return true; } diff --git a/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java b/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java index a0de5638da4..9354f14178c 100644 --- a/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java +++ b/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java @@ -108,10 +108,14 @@ class MagusOfTheUnseenDelayedTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_CONTROL; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.LOST_CONTROL.equals(event.getType()) - && event.getPlayerId().equals(controllerId) + return event.getPlayerId().equals(controllerId) && event.getSourceId().equals(this.getEffects().get(0).getTargetPointer().getFirst(game, this)); } diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java index 0d5516191ba..60044a1b7bd 100644 --- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java +++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java @@ -49,6 +49,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -97,9 +98,14 @@ class NecropotenceTriggeredAbility extends TriggeredAbilityImpl { return new NecropotenceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) && getControllerId().equals(event.getPlayerId())) { + if (getControllerId().equals(event.getPlayerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java b/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java index 9a84518e77a..b94dc0b7930 100644 --- a/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java +++ b/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java @@ -44,6 +44,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreaturePermanent; /** @@ -91,11 +92,17 @@ class RayOfCommandDelayedTriggeredAbility extends DelayedTriggeredAbility { RayOfCommandDelayedTriggeredAbility(RayOfCommandDelayedTriggeredAbility ability) { super(ability); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_CONTROL; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - return GameEvent.EventType.LOST_CONTROL.equals(event.getType()) && event.getPlayerId().equals(controllerId); + return event.getPlayerId().equals(controllerId); } + @Override public RayOfCommandDelayedTriggeredAbility copy() { return new RayOfCommandDelayedTriggeredAbility(this); diff --git a/Mage.Sets/src/mage/sets/iceage/WildGrowth.java b/Mage.Sets/src/mage/sets/iceage/WildGrowth.java index 513e4568d09..b7fa06e0043 100644 --- a/Mage.Sets/src/mage/sets/iceage/WildGrowth.java +++ b/Mage.Sets/src/mage/sets/iceage/WildGrowth.java @@ -28,9 +28,6 @@ package mage.sets.iceage; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.Mana; import mage.abilities.Ability; import mage.abilities.effects.Effect; @@ -39,11 +36,14 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -98,19 +98,22 @@ class WildGrowthTriggeredAbility extends TriggeredManaAbility { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null) { - for(Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); - } - return true; + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null) { + for(Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); } + return true; } - } + } return false; } diff --git a/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java b/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java index 917a07f35a4..a417a498a93 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java +++ b/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java @@ -27,18 +27,18 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreatureOrPlayer; -import java.util.UUID; - /** * @author nantuko */ @@ -77,14 +77,14 @@ class BurningVengeanceOnCastAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST - && event.getPlayerId().equals(controllerId) - && event.getZone().equals(Zone.GRAVEYARD)) { - return true; - } - return false; + return event.getPlayerId().equals(controllerId) && event.getZone().equals(Zone.GRAVEYARD); } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java b/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java index 903130ea3dc..9d64dbcd5e2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java +++ b/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java @@ -26,25 +26,25 @@ * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.IndestructibleAbility; 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.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * @author nantuko */ @@ -90,13 +90,16 @@ class CreepyDollTriggeredAbility extends TriggeredAbilityImpl { return new CreepyDollTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedCreatureEvent) { - if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { - getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } + if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/innistrad/Curiosity.java b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java index 80226a7f55a..1293fda005a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Curiosity.java +++ b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java @@ -27,25 +27,24 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.EnchantAbility; 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.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author Alvin, noxx @@ -95,15 +94,15 @@ class CuriosityAbility extends TriggeredAbilityImpl { return new CuriosityAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && game.getOpponents(this.controllerId).contains(event.getTargetId()) && permanent.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + Permanent permanent = game.getPermanent(event.getSourceId()); + return permanent != null && game.getOpponents(this.controllerId).contains(event.getTargetId()) && permanent.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java index 5c736744649..19c77d5c77c 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java @@ -28,17 +28,16 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.ExileFromZoneTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; 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; @@ -97,16 +96,19 @@ class CurseOfOblivionAbility extends TriggeredAbilityImpl { return new CurseOfOblivionAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; - } + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player != null && game.getActivePlayerId().equals(player.getId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java index 898e0504477..0803298ad65 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java @@ -28,17 +28,16 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; @@ -99,9 +98,14 @@ class CurseOfStalkedPreyTriggeredAbility extends TriggeredAbilityImpl { return new CurseOfStalkedPreyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent enchantment = game.getPermanent(this.sourceId); if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java index 57821a1edd7..e50bce3c6ce 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java @@ -28,16 +28,16 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -95,16 +95,19 @@ class CurseOfTheBloodyTomeAbility extends TriggeredAbilityImpl { return new CurseOfTheBloodyTomeAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; - } + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player != null && game.getActivePlayerId().equals(player.getId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java index b0cc02e2dd7..35193e3cdfb 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java +++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java @@ -28,17 +28,16 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -96,16 +95,19 @@ class CurseOfThePiercedHeartAbility extends TriggeredAbilityImpl { return new CurseOfThePiercedHeartAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DRAW_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { - Permanent enchantment = game.getPermanent(this.sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; - } + Permanent enchantment = game.getPermanent(this.sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player != null && game.getActivePlayerId().equals(player.getId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java b/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java index 8e8e1bbf7e7..ce8a5d39fdc 100644 --- a/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java +++ b/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java @@ -28,17 +28,18 @@ 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.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.TargetPlayer; @@ -89,19 +90,22 @@ class FalkenrathNobleTriggeredAbility extends TriggeredAbilityImpl { return new FalkenrathNobleTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - 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())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + 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())) { + return true; + } else { + if (permanent.getCardType().contains(CardType.CREATURE)) { return true; - } else { - if (permanent.getCardType().contains(CardType.CREATURE)) { - return true; - } } } } diff --git a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java index 2bc737f28f6..3d3e258a14b 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java +++ b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java @@ -27,8 +27,7 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; @@ -39,17 +38,18 @@ import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfToken; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author nantuko */ @@ -105,9 +105,14 @@ class GarrukRelentlessTriggeredAbility extends TriggeredAbilityImpl { return new GarrukRelentlessTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER && event.getTargetId().equals(sourceId)) { + if (event.getTargetId().equals(sourceId)) { Permanent permanent = game.getPermanent(sourceId); if (permanent != null && !permanent.isTransformed() && permanent.getCounters().getCount(CounterType.LOYALTY) <= 2) { return true; diff --git a/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java b/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java index db9609e39cf..727d038438d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java +++ b/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java @@ -49,6 +49,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -109,9 +110,14 @@ class GrimgrinCorpseBornAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); UUID defenderId = game.getCombat().getDefenderId(sourceId); filter.add(new ControllerIdPredicate(defenderId)); diff --git a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java index 59e9efb8756..1994869f6a8 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java +++ b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java @@ -27,6 +27,7 @@ */ package mage.sets.innistrad; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -38,7 +39,11 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -48,8 +53,6 @@ import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.game.permanent.token.Token; -import java.util.UUID; - /** * * @author BetaSteward @@ -91,21 +94,24 @@ class GutterGrimeTriggeredAbility extends TriggeredAbilityImpl { return new GutterGrimeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - UUID targetId = event.getTargetId(); - MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); - if (card instanceof Permanent && !(card instanceof PermanentToken)) { - Permanent permanent = (Permanent) card; - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD - && permanent.getControllerId().equals(this.controllerId) - && (targetId.equals(this.getSourceId()) - || (permanent.getCardType().contains(CardType.CREATURE) - && !(permanent instanceof PermanentToken)))) { - return true; - } + UUID targetId = event.getTargetId(); + MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); + if (card instanceof Permanent && !(card instanceof PermanentToken)) { + Permanent permanent = (Permanent) card; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD + && permanent.getControllerId().equals(this.controllerId) + && (targetId.equals(this.getSourceId()) + || (permanent.getCardType().contains(CardType.CREATURE) + && !(permanent instanceof PermanentToken)))) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java b/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java index 6207edd2734..087265e34dd 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java +++ b/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java @@ -27,18 +27,18 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; - -import java.util.UUID; +import mage.game.events.GameEvent.EventType; import mage.watchers.Watcher; /** @@ -91,9 +91,14 @@ class HomicidalBruteTriggeredAbility extends TriggeredAbilityImpl { return new HomicidalBruteTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { Watcher watcher = game.getState().getWatchers().get("HomicidalBruteAttacked", sourceId); if (watcher == null || !watcher.conditionMet()) { return true; diff --git a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java index 8df3ac41ad6..1936fd5c492 100644 --- a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java +++ b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java @@ -28,17 +28,18 @@ 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.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -85,19 +86,22 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl { return new RakishHeirTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - Permanent permanent = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && permanent != null - && permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) { - this.getEffects().clear(); - AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); - effect.setTargetPointer(new FixedTarget(permanent.getId())); - this.addEffect(effect); - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent permanent = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && permanent != null + && permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) { + this.getEffects().clear(); + AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setTargetPointer(new FixedTarget(permanent.getId())); + this.addEffect(effect); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java index fccc03b9e34..c64bb9f2f06 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java +++ b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java @@ -29,21 +29,21 @@ package mage.sets.innistrad; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; 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.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreaturePermanent; import mage.watchers.Watcher; @@ -99,13 +99,15 @@ class ReaperFromTheAbyssAbility extends TriggeredAbilityImpl { return new ReaperFromTheAbyssAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { - Watcher watcher = game.getState().getWatchers().get("Morbid"); - return watcher.conditionMet(); - } - return false; + Watcher watcher = game.getState().getWatchers().get("Morbid"); + return watcher.conditionMet(); } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java b/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java index 7ebc1ee753c..5948bfa65c0 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java +++ b/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java @@ -27,27 +27,27 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.condition.common.TransformedCondition; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TransformAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import java.util.UUID; -import mage.abilities.condition.common.TransformedCondition; -import mage.abilities.decorator.ConditionalTriggeredAbility; - /** * @author nantuko */ @@ -96,12 +96,14 @@ class ScreechingBatBeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImp return new ScreechingBatBeginningOfUpkeepTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return event.getPlayerId().equals(this.controllerId); - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java b/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java index 4ca0ffb0748..a18f74df8d2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java +++ b/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java @@ -27,22 +27,22 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -import java.util.UUID; - /** * @author nantuko */ @@ -92,27 +92,24 @@ class ThrabenSentryTriggeredAbility extends TriggeredAbilityImpl { return new ThrabenSentryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - - Permanent source = game.getPermanent(this.sourceId); - if (source == null) { - return false; - } - - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); - - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - permanent.getControllerId().equals(this.getControllerId()) && - !source.isTransformed()) { - return true; - } + Permanent source = game.getPermanent(this.sourceId); + if (source == null) { + return false; } - return false; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); + return permanent != null && permanent.getCardType().contains(CardType.CREATURE) && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + permanent.getControllerId().equals(this.getControllerId()) && + !source.isTransformed(); } @Override diff --git a/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java b/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java index e00e0240adf..7a42dde251a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java +++ b/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java @@ -28,16 +28,17 @@ 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.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -84,16 +85,19 @@ class VillageCannibalsTriggeredAbility extends TriggeredAbilityImpl { return new VillageCannibalsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human") - && !permanent.getId().equals(this.getSourceId())) { - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human") + && !permanent.getId().equals(this.getSourceId())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java index ddc5fe84969..b0d1ceaa685 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java +++ b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java @@ -27,8 +27,7 @@ */ package mage.sets.innistrad; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -37,15 +36,16 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * @author nantuko */ @@ -86,31 +86,34 @@ class WoodenStakeBlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbility super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent equipment = game.getPermanent(sourceId); - if (equipment != null && equipment.getAttachedTo() != null) { - if (event.getSourceId().equals(equipment.getAttachedTo())) { - Permanent blocks = game.getPermanent(event.getTargetId()); - if (blocks != null && blocks.hasSubtype("Vampire")) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + Permanent equipment = game.getPermanent(sourceId); + if (equipment != null && equipment.getAttachedTo() != null) { + if (event.getSourceId().equals(equipment.getAttachedTo())) { + Permanent blocks = game.getPermanent(event.getTargetId()); + if (blocks != null && blocks.hasSubtype("Vampire")) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } - return false; + return true; } - if (event.getTargetId().equals(equipment.getAttachedTo())) { - Permanent blockedBy = game.getPermanent(event.getSourceId()); - if (blockedBy != null && blockedBy.hasSubtype("Vampire")) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + return false; + } + if (event.getTargetId().equals(equipment.getAttachedTo())) { + Permanent blockedBy = game.getPermanent(event.getSourceId()); + if (blockedBy != null && blockedBy.hasSubtype("Vampire")) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } - return false; + return true; } + return false; } } return false; diff --git a/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java b/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java index f801f9e50c7..8ee804a8952 100644 --- a/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java +++ b/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java @@ -95,9 +95,14 @@ class AeonChroniclerTriggeredAbility extends TriggeredAbilityImpl { return new AeonChroniclerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java b/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java index 59c9e325d88..412b1ecaad7 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java @@ -51,6 +51,7 @@ import mage.filter.predicate.other.OwnerPredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -166,18 +167,21 @@ class AthreosDiesCreatureTriggeredAbility extends TriggeredAbilityImpl { return new AthreosDiesCreatureTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { - for (Effect effect : this.getEffects()) { - effect.setValue("creatureId", event.getTargetId()); - } - return true; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { + for (Effect effect : this.getEffects()) { + effect.setValue("creatureId", event.getTargetId()); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java index f7cf7470313..c5b745b5894 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java @@ -44,6 +44,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreaturePermanent; /** @@ -95,14 +96,14 @@ class BloodcrazedHopliteTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.COUNTER_ADDED) { - if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName())) { - return true; - } - } - return false; + return event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName()); } @Override diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java index ccbaf681714..8918170eb32 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -81,13 +82,15 @@ class DictateOfKruphixAbility extends TriggeredAbilityImpl { return new DictateOfKruphixAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DRAW_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java b/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java index 988022c3b70..28bfbc5d63e 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -88,16 +89,19 @@ class EidolonOfTheGreatRevelTriggeredAbility extends TriggeredAbilityImpl { return new EidolonOfTheGreatRevelTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.SPELL_CAST){ - Spell spell = game.getStack().getSpell(event.getTargetId()); - if(spell != null && spell.getConvertedManaCost() <= 3){ - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getConvertedManaCost() <= 3){ + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java b/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java index 52aad224e4e..bb0f16bed26 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java @@ -113,47 +113,50 @@ class GodsendTriggeredAbility extends TriggeredAbilityImpl { return new GodsendTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.DECLARED_BLOCKERS)) { - Permanent equipment = game.getPermanentOrLKIBattlefield((this.getSourceId())); - if (equipment != null && equipment.getAttachedTo()!= null) { - Permanent equippedPermanent = game.getPermanentOrLKIBattlefield((equipment.getAttachedTo())); - if (equippedPermanent != null) { - possibleTargets.clear(); - String targetName = ""; - if (equippedPermanent.isAttacking()) { - for (CombatGroup group: game.getCombat().getGroups()) { - if (group.getAttackers().contains(equippedPermanent.getId())) { - possibleTargets.addAll(group.getBlockers()); - } + Permanent equipment = game.getPermanentOrLKIBattlefield((this.getSourceId())); + if (equipment != null && equipment.getAttachedTo()!= null) { + Permanent equippedPermanent = game.getPermanentOrLKIBattlefield((equipment.getAttachedTo())); + if (equippedPermanent != null) { + possibleTargets.clear(); + String targetName = ""; + if (equippedPermanent.isAttacking()) { + for (CombatGroup group: game.getCombat().getGroups()) { + if (group.getAttackers().contains(equippedPermanent.getId())) { + possibleTargets.addAll(group.getBlockers()); } - targetName = "a creature blocking attacker "; - } else if (equippedPermanent.getBlocking() > 0) { - for (CombatGroup group: game.getCombat().getGroups()) { - if (group.getBlockers().contains(equippedPermanent.getId())) { - possibleTargets.addAll(group.getAttackers()); - } - } - targetName = "a creature blocked by creature "; - } - if (possibleTargets.size() > 0) { - this.getTargets().clear(); - if (possibleTargets.size() == 1) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next())); - } else { - this.getEffects().get(0).setTargetPointer(new FirstTargetPointer()); - targetName = new StringBuilder(targetName).append("equipped by ").append(equipment.getName()).toString(); - FilterCreaturePermanent filter = new FilterCreaturePermanent(targetName); - List uuidPredicates = new ArrayList<>(); - for (UUID creatureId : possibleTargets) { - uuidPredicates.add(new PermanentIdPredicate(creatureId)); - } - filter.add(Predicates.or(uuidPredicates)); - this.getTargets().add(new TargetCreaturePermanent(filter)); - } - return true; } + targetName = "a creature blocking attacker "; + } else if (equippedPermanent.getBlocking() > 0) { + for (CombatGroup group: game.getCombat().getGroups()) { + if (group.getBlockers().contains(equippedPermanent.getId())) { + possibleTargets.addAll(group.getAttackers()); + } + } + targetName = "a creature blocked by creature "; + } + if (possibleTargets.size() > 0) { + this.getTargets().clear(); + if (possibleTargets.size() == 1) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next())); + } else { + this.getEffects().get(0).setTargetPointer(new FirstTargetPointer()); + targetName = new StringBuilder(targetName).append("equipped by ").append(equipment.getName()).toString(); + FilterCreaturePermanent filter = new FilterCreaturePermanent(targetName); + List uuidPredicates = new ArrayList<>(); + for (UUID creatureId : possibleTargets) { + uuidPredicates.add(new PermanentIdPredicate(creatureId)); + } + filter.add(Predicates.or(uuidPredicates)); + this.getTargets().add(new TargetCreaturePermanent(filter)); + } + return true; } } } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java b/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java index f94df13e691..fc36df89d6a 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java @@ -51,6 +51,7 @@ import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; @@ -112,9 +113,14 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl { return new KeranosGodOfStormsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { if (game.getActivePlayerId().equals(this.getControllerId())) { CardsDrawnDuringTurnWatcher watcher = (CardsDrawnDuringTurnWatcher) game.getState().getWatchers().get("CardsDrawnDuringTurn"); if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) != 1) { diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java b/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java index f9869338b55..024239a5aa7 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java @@ -32,12 +32,8 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DoIfCostPaid; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -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.game.Game; @@ -87,12 +83,14 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl { return new ScryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SCRY; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.SCRY) && event.getPlayerId().equals(this.getControllerId())) { - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java index b1e9946c821..6075982ce44 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java @@ -43,6 +43,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -96,15 +97,15 @@ class MarketFestivalTriggeredAbility extends TriggeredManaAbility { return new MarketFestivalTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; + Permanent enchantment = game.getPermanent(this.getSourceId()); + return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo()); } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java b/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java index 41db761d453..41311f25265 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java @@ -46,6 +46,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -103,16 +104,16 @@ class MortalObstinacyAbility extends TriggeredAbilityImpl { return new MortalObstinacyAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent damageMakingCreature = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && damageMakingCreature != null && damageMakingCreature.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent damageMakingCreature = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && damageMakingCreature != null && damageMakingCreature.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java b/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java index dd3ca1dd5ac..a19131e178d 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java @@ -46,6 +46,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -101,9 +102,14 @@ class SwarmbornGiantTriggeredAbility extends TriggeredAbilityImpl { return new SwarmbornGiantTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) && event.getTargetId().equals(this.getControllerId())) { + if (event.getTargetId().equals(this.getControllerId())) { DamagedEvent damagedEvent = (DamagedEvent) event; return damagedEvent.isCombatDamage(); } diff --git a/Mage.Sets/src/mage/sets/legends/Abomination.java b/Mage.Sets/src/mage/sets/legends/Abomination.java index 0c33a7c7818..5bf815d95f1 100644 --- a/Mage.Sets/src/mage/sets/legends/Abomination.java +++ b/Mage.Sets/src/mage/sets/legends/Abomination.java @@ -28,10 +28,6 @@ package mage.sets.legends; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -40,8 +36,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -89,42 +90,44 @@ class AbominationTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent abomination = game.getPermanent(sourceId); - if (blocker != null && blocker != abomination - && blocker.getColor(game).isWhite() - && blocked == abomination) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } - } - if (blocker != null && blocker == abomination - && game.getPermanent(event.getTargetId()).getColor(game).isWhite()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - } - if (blocker != null && blocker != abomination - && blocker.getColor(game).isGreen() - && blocked == abomination) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } - } - if (blocker != null && blocker == abomination - && game.getPermanent(event.getTargetId()).getColor(game).isGreen()) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } - } + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent blocker = game.getPermanent(event.getSourceId()); + Permanent blocked = game.getPermanent(event.getTargetId()); + Permanent abomination = game.getPermanent(sourceId); + if (blocker != null && blocker != abomination + && blocker.getColor(game).isWhite() + && blocked == abomination) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + return true; + } + } + if (blocker != null && blocker == abomination + && game.getPermanent(event.getTargetId()).getColor(game).isWhite()) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + } + if (blocker != null && blocker != abomination + && blocker.getColor(game).isGreen() + && blocked == abomination) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); + return true; + } + } + if (blocker != null && blocker == abomination + && game.getPermanent(event.getTargetId()).getColor(game).isGreen()) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/legions/ToxinSliver.java b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java index b7aa297b0ee..be0a4e660ac 100644 --- a/Mage.Sets/src/mage/sets/legions/ToxinSliver.java +++ b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -57,7 +58,7 @@ public class ToxinSliver extends CardImpl { // Whenever a Sliver deals combat damage to a creature, destroy that creature. It can't be regenerated. this.addAbility(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), true, false, true)); - + } public ToxinSliver(final ToxinSliver card) { @@ -71,8 +72,8 @@ public class ToxinSliver extends CardImpl { } class DealsDamageTriggeredAbility extends TriggeredAbilityImpl { - - private boolean setTargetPointer; + + private boolean setTargetPointer; public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { super(Zone.BATTLEFIELD, effect, optional); @@ -80,35 +81,37 @@ class DealsDamageTriggeredAbility extends TriggeredAbilityImpl { } public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) { - super(ability); - this.setTargetPointer = ability.setTargetPointer; + super(ability); + this.setTargetPointer = ability.setTargetPointer; } @Override public DealsDamageTriggeredAbility copy() { - return new DealsDamageTriggeredAbility(this); + return new DealsDamageTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) { - if (setTargetPointer) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId()))); - effect.setValue("damage", event.getAmount()); - } - } - return true; + if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) { + if (setTargetPointer) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId()))); + effect.setValue("damage", event.getAmount()); } - + } + return true; } - return false; + return false; } @Override public String getRule() { - return "Whenever a Sliver deals damage to a creature" + super.getRule(); + return "Whenever a Sliver deals damage to a creature" + super.getRule(); } } diff --git a/Mage.Sets/src/mage/sets/legions/WallOfHope.java b/Mage.Sets/src/mage/sets/legions/WallOfHope.java index a589525fcb8..5e56e96860f 100644 --- a/Mage.Sets/src/mage/sets/legions/WallOfHope.java +++ b/Mage.Sets/src/mage/sets/legions/WallOfHope.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -59,7 +60,7 @@ public class WallOfHope extends CardImpl { this.addAbility(DefenderAbility.getInstance()); // Whenever Wall of Hope is dealt damage, you gain that much life. this.addAbility(new WallOfHopeTriggeredAbility()); - + } public WallOfHope(final WallOfHope card) { @@ -87,11 +88,16 @@ class WallOfHopeTriggeredAbility extends TriggeredAbilityImpl { return new WallOfHopeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - return true; + if (event.getTargetId().equals(this.sourceId)) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; } return false; } @@ -104,10 +110,10 @@ class WallOfHopeTriggeredAbility extends TriggeredAbilityImpl { class WallOfHopeGainLifeEffect extends OneShotEffect { - public WallOfHopeGainLifeEffect() { - super(Outcome.GainLife); - staticText = "you gain that much life"; - } + public WallOfHopeGainLifeEffect() { + super(Outcome.GainLife); + staticText = "you gain that much life"; + } public WallOfHopeGainLifeEffect(final WallOfHopeGainLifeEffect effect) { super(effect); @@ -127,5 +133,4 @@ class WallOfHopeGainLifeEffect extends OneShotEffect { return true; } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java b/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java index e96a52d584f..b69b7d0f676 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -82,18 +83,21 @@ class AnkhOfMishraAbility extends TriggeredAbilityImpl { return new AnkhOfMishraAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(player.getId())); - } - return true; + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(player.getId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java index 26e436ef112..057ebaa541b 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -121,12 +121,14 @@ class BlackViseTriggeredAbility extends TriggeredAbilityImpl { return new BlackViseTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return event.getPlayerId().equals((UUID) game.getState().getValue(getSourceId().toString() + "_player")); - } - return false; + return event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + "_player")); } @Override diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java index 8cefbba278b..eb9712905e9 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java @@ -28,22 +28,23 @@ package mage.sets.limitedalpha; import java.util.UUID; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.abilities.effects.OneShotEffect; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import mage.cards.CardImpl; /** * @@ -90,23 +91,26 @@ class CockatriceTriggeredAbility extends TriggeredAbilityImpl { return new CockatriceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent cockatrice = game.getPermanent(sourceId); - if (blocker != null && blocker != cockatrice - && !blocker.getSubtype().contains("Wall") - && blocked == cockatrice) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == cockatrice - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } + Permanent blocker = game.getPermanent(event.getSourceId()); + Permanent blocked = game.getPermanent(event.getTargetId()); + Permanent cockatrice = game.getPermanent(sourceId); + if (blocker != null && blocker != cockatrice + && !blocker.getSubtype().contains("Wall") + && blocked == cockatrice) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); + return true; + } + if (blocker != null && blocker == cockatrice + && !blocked.getSubtype().contains("Wall")) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java b/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java index 3b0b24aff4a..789a1b08001 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -82,15 +82,15 @@ class CrystalRodAbility extends TriggeredAbilityImpl { return new CrystalRodAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).contains(ObjectColor.BLUE)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).contains(ObjectColor.BLUE); } @Override diff --git a/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java b/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java index 1198a0bbd9f..0c197a4e188 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -40,7 +39,6 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; -import mage.target.TargetPlayer; import mage.target.targetpointer.FixedTarget; /** @@ -77,23 +75,24 @@ class DingusEggTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD - && zEvent.getTarget().getCardType().contains(CardType.LAND)) { - - if (getTargets().size() == 0) { - UUID targetId = zEvent.getTarget().getControllerId(); - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(targetId)); - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(CardType.LAND)) { + if (getTargets().size() == 0) { + UUID targetId = zEvent.getTarget().getControllerId(); + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(targetId)); } - return true; - } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java index d220484fc1c..3be02bbc3d2 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -72,8 +73,6 @@ public class Fastbond extends CardImpl { class PlayALandTriggeredAbility extends TriggeredAbilityImpl { - - public PlayALandTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageControllerEffect(1), false); } @@ -82,19 +81,21 @@ class PlayALandTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LAND_PLAYED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LAND_PLAYED && event.getPlayerId() == this.getControllerId()) { - return true; - } - return false; + return event.getPlayerId() == this.getControllerId(); } @Override public boolean checkInterveningIfClause(Game game) { Player player = game.getPlayer(this.getControllerId()); - if(player != null){ - if(player.getLandsPlayed() != 1){ + if (player != null){ + if (player.getLandsPlayed() != 1){ return true; } } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java b/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java index 0ff69ced1f0..37be1119c46 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -82,15 +82,15 @@ class IronStarAbility extends TriggeredAbilityImpl { return new IronStarAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).contains(ObjectColor.RED)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).contains(ObjectColor.RED); } @Override diff --git a/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java b/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java index cfde122dc89..e94d96eb1ef 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -81,15 +81,15 @@ class IvoryCupAbility extends TriggeredAbilityImpl { return new IvoryCupAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).contains(ObjectColor.WHITE)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).contains(ObjectColor.WHITE); } @Override diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java index 1071952555a..20f2a5d9b91 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -89,18 +90,20 @@ class PsychicVenomAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(source.getAttachedTo()); - if (attached != null) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent source = game.getPermanent(this.sourceId); + if (source != null && source.getAttachedTo().equals(event.getTargetId())) { + Permanent attached = game.getPermanent(source.getAttachedTo()); + if (attached != null) { + for (Effect e : getEffects()) { + e.setTargetPointer(new FixedTarget(attached.getControllerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java index 448809c03cc..1c8dfda7ce2 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java @@ -28,21 +28,22 @@ package mage.sets.limitedalpha; import java.util.UUID; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.abilities.effects.OneShotEffect; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; +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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import mage.cards.CardImpl; /** * @@ -87,23 +88,26 @@ class ThicketBasiliskTriggeredAbility extends TriggeredAbilityImpl { return new ThicketBasiliskTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent thicketBasilisk = game.getPermanent(sourceId); - if (blocker != null && blocker != thicketBasilisk - && !blocker.getSubtype().contains("Wall") - && blocked == thicketBasilisk) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == thicketBasilisk - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } + Permanent blocker = game.getPermanent(event.getSourceId()); + Permanent blocked = game.getPermanent(event.getTargetId()); + Permanent thicketBasilisk = game.getPermanent(sourceId); + if (blocker != null && blocker != thicketBasilisk + && !blocker.getSubtype().contains("Wall") + && blocked == thicketBasilisk) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); + return true; + } + if (blocker != null && blocker == thicketBasilisk + && !blocked.getSubtype().contains("Wall")) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java b/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java index 529bd128f8d..18d571cf300 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -82,15 +82,15 @@ class ThroneOfBoneAbility extends TriggeredAbilityImpl { return new ThroneOfBoneAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).contains(ObjectColor.BLACK)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).contains(ObjectColor.BLACK); } @Override diff --git a/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java b/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java index f342a150cc6..156dfd3d6af 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java @@ -28,7 +28,6 @@ package mage.sets.limitedalpha; import java.util.UUID; - import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; @@ -40,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -82,15 +82,15 @@ class WoodenSphereAbility extends TriggeredAbilityImpl { return new WoodenSphereAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).contains(ObjectColor.GREEN)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).contains(ObjectColor.GREEN); } @Override diff --git a/Mage.Sets/src/mage/sets/lorwyn/Dread.java b/Mage.Sets/src/mage/sets/lorwyn/Dread.java index 16658558b8a..ec0d5f34708 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Dread.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Dread.java @@ -94,10 +94,15 @@ class DreadTriggeredAbility extends TriggeredAbilityImpl { public DreadTriggeredAbility copy() { return new DreadTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java b/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java index 2df798e1afe..8762ed5e81b 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java +++ b/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java @@ -94,9 +94,14 @@ class EntanglingClashTriggeredAbility extends TriggeredAbilityImpl { return new EntanglingClashTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.CLASHED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (EventType.CLASHED.equals(event.getType()) && event.getPlayerId().equals(getControllerId())) { + if (event.getPlayerId().equals(getControllerId())) { if (event.getFlag()) { // clash won addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature")); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java index 291cbdf40d1..51675f87b0c 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java +++ b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java @@ -84,10 +84,15 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { public RingsOfBrighthearthTriggeredAbility copy() { return new RingsOfBrighthearthTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ACTIVATED_ABILITY; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ACTIVATED_ABILITY && event.getPlayerId().equals(getControllerId())) { + if (event.getPlayerId().equals(getControllerId())) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { Effect effect = this.getEffects().get(0); diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java index 9ca2d3e923c..5ec15b0a5a3 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java @@ -29,12 +29,12 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -77,13 +77,15 @@ class HowlingMineAbility extends TriggeredAbilityImpl { return new HowlingMineAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DRAW_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DRAW_STEP_PRE) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java index 1a0b9bc894d..911d57ec0d6 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.java @@ -29,18 +29,18 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect; import mage.abilities.effects.common.DestroySourceEffect; +import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -99,14 +99,17 @@ class IceCageAbility extends TriggeredAbilityImpl { return new IceCageAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java index b85a1364463..b532f4207a4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java +++ b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java @@ -28,15 +28,15 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.FirstStrikeAbility; 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.ColorPredicate; @@ -92,10 +92,14 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl { return new LightwielderPaladinTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { Player player = game.getPlayer(event.getTargetId()); if (player != null) { FilterPermanent filter = new FilterPermanent("black or red permanent controlled by " + player.getLogName()); diff --git a/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java b/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java index b56127071c6..f72721de4f7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java +++ b/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java @@ -28,14 +28,15 @@ package mage.sets.magic2010; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetOpponent; /** @@ -80,9 +81,14 @@ class SanguineBondTriggeredAbility extends TriggeredAbilityImpl { return new SanguineBondTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { this.getEffects().clear(); this.addEffect(new LoseLifeTargetEffect(event.getAmount())); return true; diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java index 0818fa5dd96..57e2e4dd192 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java +++ b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java @@ -29,13 +29,13 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -85,12 +85,14 @@ class AjanisPridemateAbility extends TriggeredAbilityImpl { return new AjanisPridemateAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java index 1154a69bd6b..8a4c98ab7b6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java +++ b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java @@ -29,18 +29,19 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; 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; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -81,15 +82,15 @@ class ChandrasSpitfireAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (!damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + return !damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java index 4282f7e051a..b478145b76c 100644 --- a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java @@ -29,14 +29,14 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -86,6 +86,11 @@ class GraveTitanAbility extends TriggeredAbilityImpl { return new GraveTitanAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java index 083d75001fa..484242f65d6 100644 --- a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java @@ -29,17 +29,17 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.DamageMultiEffect; +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; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -90,6 +90,11 @@ class InfernoTitanAbility extends TriggeredAbilityImpl { return new InfernoTitanAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java index de0eea24e4f..3166f1aaed4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java +++ b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java @@ -82,10 +82,15 @@ class LilianasCaressAbility extends TriggeredAbilityImpl { return new LilianasCaressAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { - for (Effect effect :this.getEffects()) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java index 4cf1ce21498..a510afc62cd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java +++ b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java @@ -29,17 +29,17 @@ package mage.sets.magic2011; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DestroySourceEffect; +import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroySourceEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.cards.CardImpl; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -94,12 +94,14 @@ class PrimalCocoonAbility1 extends TriggeredAbilityImpl { return new PrimalCocoonAbility1(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override @@ -123,15 +125,15 @@ class PrimalCocoonAbility2 extends TriggeredAbilityImpl { return new PrimalCocoonAbility2(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; + Permanent enchantment = game.getPermanent(sourceId); + return enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java index 050b9d6ce2c..03f7d21a769 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java @@ -29,14 +29,14 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter.ComparisonType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; @@ -107,6 +107,11 @@ class SunTitanAbility extends TriggeredAbilityImpl { return new SunTitanAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java index f06f9cda101..3677a7b9cc7 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java +++ b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java @@ -29,9 +29,6 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; @@ -41,9 +38,13 @@ import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.common.TargetCreatureOrPlayer; import mage.target.targetpointer.FixedTarget; @@ -103,9 +104,14 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility { return new ChandraTheFirebrandAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java b/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java index 27c7871fafe..1aeed25f2da 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java +++ b/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java @@ -28,9 +28,6 @@ package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandSourceEffect; @@ -38,9 +35,12 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -85,15 +85,18 @@ class ChandrasPhoenixTriggeredAbility extends TriggeredAbilityImpl { return new ChandrasPhoenixTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { - Card c = game.getCard(event.getSourceId()); - if (c != null) { - if (c.getColor(game).isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) { - return true; - } + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + Card c = game.getCard(event.getSourceId()); + if (c != null) { + if (c.getColor(game).isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java index 7377f637e5f..be8206d7cb8 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java +++ b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java @@ -28,17 +28,17 @@ package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -82,33 +82,35 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl { return new CircleOfFlameTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { + // check has flying + Permanent attacker = game.getPermanent(event.getSourceId()); + if (attacker == null || attacker.getAbilities().contains(FlyingAbility.getInstance())) { + return false; + } - // check has flying - Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker == null || attacker.getAbilities().contains(FlyingAbility.getInstance())) { - return false; - } - - // check attacks you - boolean youOrYourPlaneswalker = false; - boolean you = event.getTargetId().equals(this.getControllerId()); - if (you) { - youOrYourPlaneswalker = true; - } else{ // check attacks your planeswalker - Permanent permanent = game.getPermanent(event.getTargetId()); - youOrYourPlaneswalker = permanent != null - && permanent.getCardType().contains(CardType.PLANESWALKER) - && permanent.getControllerId().equals(this.getControllerId()); - } - if (youOrYourPlaneswalker) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(attacker.getId())); - } - return true; + // check attacks you + boolean youOrYourPlaneswalker; + boolean you = event.getTargetId().equals(this.getControllerId()); + if (you) { + youOrYourPlaneswalker = true; + } else{ // check attacks your planeswalker + Permanent permanent = game.getPermanent(event.getTargetId()); + youOrYourPlaneswalker = permanent != null + && permanent.getCardType().contains(CardType.PLANESWALKER) + && permanent.getControllerId().equals(this.getControllerId()); + } + if (youOrYourPlaneswalker) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(attacker.getId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java index 77e9c98bab9..be7f26d1122 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java +++ b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java @@ -28,17 +28,17 @@ package mage.sets.magic2012; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -83,14 +83,17 @@ class GideonsAvengerTriggeredAbility extends TriggeredAbilityImpl { return new GideonsAvengerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - if (game.getOpponents(this.controllerId).contains(p.getControllerId())) - return true; - } + Permanent p = game.getPermanent(event.getTargetId()); + if (p != null && p.getCardType().contains(CardType.CREATURE)) { + if (game.getOpponents(this.controllerId).contains(p.getControllerId())) + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java b/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java index 2e54d863365..c580c5679b9 100644 --- a/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java +++ b/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java @@ -28,14 +28,14 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; @@ -83,10 +83,14 @@ class HuntersInsightTriggeredAbility extends TriggeredAbilityImpl { return new HuntersInsightTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.DAMAGED_PLANESWALKER) - && event.getSourceId().equals(this.sourceId) && ((DamagedEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedEvent) event).isCombatDamage()) { this.getEffects().clear(); this.addEffect(new DrawCardSourceControllerEffect(event.getAmount())); return true; diff --git a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java index 14f33e50ca2..5318f83ad4c 100644 --- a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java +++ b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java @@ -28,16 +28,17 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.continuous.PlayAdditionalLandsAllEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -82,13 +83,15 @@ class RitesOfFlourishingAbility extends TriggeredAbilityImpl { return new RitesOfFlourishingAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DRAW_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java index dac1f2a8dab..9ec321e2752 100644 --- a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java +++ b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java @@ -28,15 +28,15 @@ package mage.sets.magic2012; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -80,16 +80,19 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE) - && permanent.getControllerId().equals(this.controllerId)) { - Effect effect = this.getEffects().get(0); - effect.setValue("damageSource", event.getTargetId()); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(this.controllerId)) { + Effect effect = this.getEffects().get(0); + effect.setValue("damageSource", event.getTargetId()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java b/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java index 9468b0554c3..84ee5ea38f9 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java +++ b/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java @@ -29,19 +29,20 @@ package mage.sets.magic2012; import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.EquipAbility; 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.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -84,16 +85,16 @@ class WorldslayerTriggeredAbility extends TriggeredAbilityImpl { return new WorldslayerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java b/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java index ad16db66da8..45113efc7c9 100644 --- a/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java +++ b/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java @@ -28,18 +28,18 @@ package mage.sets.magic2013; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import mage.abilities.effects.common.LoseLifeTargetEffect; /** * @@ -81,31 +81,34 @@ class BloodReckoningTriggeredAbility extends TriggeredAbilityImpl { return new BloodReckoningTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker != null) { - // check attacks you - boolean youOrYourPlaneswalker = false; - boolean you = event.getTargetId().equals(this.getControllerId()); - if (you) { - youOrYourPlaneswalker = true; - } else{ // check attacks your planeswalker - Permanent permanent = game.getPermanent(event.getTargetId()); - youOrYourPlaneswalker = permanent != null - && permanent.getCardType().contains(CardType.PLANESWALKER) - && permanent.getControllerId().equals(this.getControllerId()); - } - if (youOrYourPlaneswalker) { - for (Effect effect : this.getEffects()) { - UUID controller = attacker.getControllerId(); - if (controller != null) { - effect.setTargetPointer(new FixedTarget(controller)); - } + Permanent attacker = game.getPermanent(event.getSourceId()); + if (attacker != null) { + // check attacks you + boolean youOrYourPlaneswalker = false; + boolean you = event.getTargetId().equals(this.getControllerId()); + if (you) { + youOrYourPlaneswalker = true; + } else{ // check attacks your planeswalker + Permanent permanent = game.getPermanent(event.getTargetId()); + youOrYourPlaneswalker = permanent != null + && permanent.getCardType().contains(CardType.PLANESWALKER) + && permanent.getControllerId().equals(this.getControllerId()); + } + if (youOrYourPlaneswalker) { + for (Effect effect : this.getEffects()) { + UUID controller = attacker.getControllerId(); + if (controller != null) { + effect.setTargetPointer(new FixedTarget(controller)); } - return true; } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java b/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java index 83c91c3983b..f02794b92bd 100644 --- a/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java +++ b/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java @@ -28,20 +28,20 @@ package mage.sets.magic2013; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -88,18 +88,21 @@ class HamletbackGoliathTriggeredAbility extends TriggeredAbilityImpl { return new HamletbackGoliathTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (permanent.getCardType().contains(CardType.CREATURE) - && !(targetId.equals(this.getSourceId()))) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (permanent.getCardType().contains(CardType.CREATURE) + && !(targetId.equals(this.getSourceId()))) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java index 9dc0c2910a3..a6f7b79e94e 100644 --- a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java +++ b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java @@ -27,23 +27,23 @@ */ package mage.sets.magic2013; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author jeffwadsworth @@ -99,9 +99,14 @@ class NefaroxOverlordOfGrixisTriggeredAbility extends TriggeredAbilityImpl { return new NefaroxOverlordOfGrixisTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getActivePlayerId().equals(this.controllerId) ) { UUID nefarox = this.getSourceId(); if (nefarox != null) { if (game.getCombat().attacksAlone() && nefarox == game.getCombat().getAttackers().get(0)) { diff --git a/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java b/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java index 7ccca5333b5..4ff2a34e1b8 100644 --- a/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java +++ b/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java @@ -27,19 +27,23 @@ */ package mage.sets.magic2013; -import mage.constants.*; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.keyword.FirstStrikeAbility; 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.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; -import java.util.UUID; - /** * @author noxx */ @@ -87,14 +91,17 @@ class OdricMasterTacticianTriggeredAbility extends TriggeredAbilityImpl { return new OdricMasterTacticianTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS) { - resetEffect(); - if (game.getCombat().getAttackers().size() >= 4 && game.getCombat().getAttackers().contains(this.sourceId)) { - enableEffect(); - return true; - } + resetEffect(); + if (game.getCombat().getAttackers().size() >= 4 && game.getCombat().getAttackers().contains(this.sourceId)) { + enableEffect(); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java b/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java index 31bef35ef92..e822e2fdb3c 100644 --- a/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java +++ b/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java @@ -28,9 +28,6 @@ package mage.sets.magic2013; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,11 +36,14 @@ import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; 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; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -136,18 +136,21 @@ class SlumberingDragonTriggeredAbility extends TriggeredAbilityImpl { return new SlumberingDragonTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - if (event.getTargetId().equals(controllerId)) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) && permanent.getControllerId().equals(controllerId)) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); - return true; - } + if (event.getTargetId().equals(controllerId)) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); + return true; + } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) && permanent.getControllerId().equals(controllerId)) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java b/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java index 35ac93db9ba..f03ff584858 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java +++ b/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java @@ -41,6 +41,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -90,12 +91,14 @@ class ArchangelOfThuneAbility extends TriggeredAbilityImpl { return new ArchangelOfThuneAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java index b6f2de8f329..187439dba28 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java +++ b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java @@ -45,6 +45,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; @@ -92,9 +93,14 @@ class ColossalWhaleAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); UUID defenderId = game.getCombat().getDefenderId(sourceId); filter.add(new ControllerIdPredicate(defenderId)); diff --git a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java index 162acea4797..5cbd32e4098 100644 --- a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java +++ b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java @@ -28,7 +28,6 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; @@ -52,10 +51,10 @@ import mage.counters.CounterType; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -141,20 +140,23 @@ class AddCounterAbility extends TriggeredAbilityImpl { return new AddCounterAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent doorOfDestinies = game.getPermanent(getSourceId()); if (doorOfDestinies != null) { String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type"); if (subtype != null) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - FilterSpell filter = new FilterSpell(); - filter.add(new ControllerPredicate(TargetController.YOU)); - filter.add(new SubtypePredicate(subtype)); - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && filter.match(spell, controllerId, game)) { - return true; - } + FilterSpell filter = new FilterSpell(); + filter.add(new ControllerPredicate(TargetController.YOU)); + filter.add(new SubtypePredicate(subtype)); + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && filter.match(spell, controllerId, game)) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java index a2abff465b9..6ef6c1266ac 100644 --- a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java +++ b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java @@ -28,13 +28,13 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.cards.CardImpl; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.keyword.DefenderAbility; -import mage.abilities.keyword.TrampleAbility; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; @@ -43,6 +43,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -86,16 +87,19 @@ class GuardianOfTheAgesTriggerAbility extends TriggeredAbilityImpl { public GuardianOfTheAgesTriggerAbility(final GuardianOfTheAgesTriggerAbility ability){ super(ability); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } @Override public boolean checkTrigger(GameEvent event, Game game){ - if(event.getType() == GameEvent.EventType.ATTACKER_DECLARED){ - Permanent creature = game.getPermanent(event.getSourceId()); - if(creature != null && filter.match(creature, game) - && game.getOpponents(this.getControllerId()).contains(creature.getControllerId()) - && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) { - return true; - } + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && filter.match(creature, game) + && game.getOpponents(this.getControllerId()).contains(creature.getControllerId()) + && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java index 0a6947cbb50..07129d69f2f 100644 --- a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java +++ b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -95,14 +96,17 @@ class IllusionaryArmorAbility extends TriggeredAbilityImpl { return new IllusionaryArmorAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TARGETED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java b/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java index 91ecb779aa9..b537128b3f1 100644 --- a/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java +++ b/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java @@ -46,6 +46,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -112,14 +113,14 @@ class PathOfBraveryTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS - && !game.getCombat().noAttackers() - && event.getPlayerId().equals(controllerId)) { - return true; - } - return false; + return !game.getCombat().noAttackers() && event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java b/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java index bf937abb290..975240eb203 100644 --- a/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java +++ b/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java @@ -40,6 +40,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -87,15 +88,15 @@ class WindreaderSphinxTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) { - Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker != null && filter.match(attacker, game)) { - return true; - } - } - return false; + Permanent attacker = game.getPermanent(event.getSourceId()); + return attacker != null && filter.match(attacker, game); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java b/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java index 1a2fe2b3db1..2ef916758ed 100644 --- a/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java +++ b/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java @@ -43,6 +43,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -92,19 +93,18 @@ class WitchstalkerTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - // Opponent casts spell during your turn - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null - && filter.match(spell,game) - && game.getOpponents(this.getControllerId()).contains(spell.getControllerId()) - && game.getActivePlayerId().equals(this.getControllerId())) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null + && filter.match(spell,game) + && game.getOpponents(this.getControllerId()).contains(spell.getControllerId()) + && game.getActivePlayerId().equals(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2015/HotSoup.java b/Mage.Sets/src/mage/sets/magic2015/HotSoup.java index b14a940e4e7..4404b0c357a 100644 --- a/Mage.Sets/src/mage/sets/magic2015/HotSoup.java +++ b/Mage.Sets/src/mage/sets/magic2015/HotSoup.java @@ -43,6 +43,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -91,19 +92,22 @@ class HotSoupTriggeredAbility extends TriggeredAbilityImpl { public HotSoupTriggeredAbility copy() { return new HotSoupTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent equipment = game.getPermanent(this.getSourceId()); - if (equipment != null && equipment.getAttachedTo() != null) { - if (event.getTargetId() == equipment.getAttachedTo()) { - for(Effect effect : this.getEffects()) - { - effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo())); - } - return true; + Permanent equipment = game.getPermanent(this.getSourceId()); + if (equipment != null && equipment.getAttachedTo() != null) { + if (event.getTargetId() == equipment.getAttachedTo()) { + for(Effect effect : this.getEffects()) + { + effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java index f662144a930..3838c745cda 100644 --- a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java +++ b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java @@ -93,18 +93,21 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { public KurkeshOnakkeAncientTriggeredAbility copy() { return new KurkeshOnakkeAncientTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ACTIVATED_ABILITY; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ACTIVATED_ABILITY) { - Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (source.getCardType().contains(CardType.ARTIFACT)) { - StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); - if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { - Effect effect = this.getEffects().get(0); - effect.setValue("stackAbility", stackAbility.getStackAbility()); - return true; - } + Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); + if (source.getCardType().contains(CardType.ARTIFACT)) { + StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); + if (!(stackAbility.getStackAbility() instanceof ManaAbility)) { + Effect effect = this.getEffects().get(0); + effect.setValue("stackAbility", stackAbility.getStackAbility()); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java b/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java index 2ae4449ff7f..e4830e2ed8b 100644 --- a/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java +++ b/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -78,14 +79,14 @@ class MilitaryIntelligenceTriggeredAbility extends TriggeredAbilityImpl { return new MilitaryIntelligenceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS) { - if (game.getCombat().getAttackers().size() >= 2 && game.getCombat().getAttackerId().equals(getControllerId())) { - return true; - } - } - return false; + return game.getCombat().getAttackers().size() >= 2 && game.getCombat().getAttackerId().equals(getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java b/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java index 9e906d5e41b..bb12bea1b97 100644 --- a/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java +++ b/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java @@ -83,13 +83,15 @@ class BlocksCreatureWithFlyingTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId()) - && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId())) { - return true; - } - return false; + return event.getSourceId().equals(this.getSourceId()) + && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java b/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java index fd7afe9f5c3..3becd6b81db 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java +++ b/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java @@ -101,16 +101,19 @@ class ObNixilisUnshackledTriggeredAbility extends TriggeredAbilityImpl { public ObNixilisUnshackledTriggeredAbility copy() { return new ObNixilisUnshackledTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LIBRARY_SEARCHED; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.LIBRARY_SEARCHED) { - Player controller = game.getPlayer(this.getControllerId()); - if (controller != null && game.isOpponent(controller, event.getTargetId())) { - this.addTarget(new TargetPlayer()); - getTargets().get(0).add(event.getPlayerId(), game); - return true; - } + Player controller = game.getPlayer(this.getControllerId()); + if (controller != null && game.isOpponent(controller, event.getTargetId())) { + this.addTarget(new TargetPlayer()); + getTargets().get(0).add(event.getPlayerId(), game); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java b/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java index 7729d2e67fd..a255b90bb54 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java +++ b/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; /** @@ -77,10 +78,15 @@ class ProfaneMementoTriggeredAbility extends TriggeredAbilityImpl { public ProfaneMementoTriggeredAbility copy() { return new ProfaneMementoTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getCardType().contains(CardType.CREATURE) && game.getOpponents(controllerId).contains(card.getOwnerId())) { return true; diff --git a/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java b/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java index 2b8f9282c24..78d0392cecd 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java +++ b/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java @@ -50,6 +50,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -114,9 +115,14 @@ class SiegeDragonAttacksTriggeredAbility extends TriggeredAbilityImpl { return new SiegeDragonAttacksTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return GameEvent.EventType.ATTACKER_DECLARED.equals(event.getType()) && event.getSourceId().equals(this.getSourceId()); + return event.getSourceId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java b/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java index 887c5263a62..1fb7aae3b05 100644 --- a/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java +++ b/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java @@ -46,6 +46,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.TargetPlayer; /** @@ -102,10 +103,15 @@ class WallOfLimbsTriggeredAbility extends TriggeredAbilityImpl { public WallOfLimbsTriggeredAbility copy() { return new WallOfLimbsTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId); + return event.getPlayerId().equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2015/WasteNot.java b/Mage.Sets/src/mage/sets/magic2015/WasteNot.java index a04546e38b4..4fba77c7a41 100644 --- a/Mage.Sets/src/mage/sets/magic2015/WasteNot.java +++ b/Mage.Sets/src/mage/sets/magic2015/WasteNot.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.ZombieToken; /** @@ -87,10 +88,15 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl { public WasteNotCreatureTriggeredAbility copy() { return new WasteNotCreatureTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); if (discarded != null && discarded.getCardType().contains(CardType.CREATURE)) { return true; @@ -119,10 +125,15 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl { public WasteNotLandTriggeredAbility copy() { return new WasteNotLandTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); if (discarded != null && discarded.getCardType().contains(CardType.LAND)) { return true; @@ -151,10 +162,15 @@ class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl { public WasteNotOtherTriggeredAbility copy() { return new WasteNotOtherTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); if (discarded != null && !discarded.getCardType().contains(CardType.LAND) && !discarded.getCardType().contains(CardType.CREATURE)) { return true; diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java b/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java index f8db6c978b8..0a4049322a7 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java @@ -92,10 +92,14 @@ class CausticWaspsTriggeredAbility extends TriggeredAbilityImpl { return new CausticWaspsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { Player player = game.getPlayer(event.getTargetId()); if (player != null) { FilterPermanent filter = new FilterPermanent("an artifact controlled by " + player.getLogName()); diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java b/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java index 4cd2a9a7d15..f36b5381410 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java @@ -28,17 +28,17 @@ package mage.sets.mercadianmasques; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -82,18 +82,21 @@ class LarcenyTriggeredAbility extends TriggeredAbilityImpl { return new LarcenyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { - for(Effect effect : this.getEffects()) - { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + if (((DamagedPlayerEvent) event).isCombatDamage()) { + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && creature.getControllerId().equals(controllerId)) { + for(Effect effect : this.getEffects()) + { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java b/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java index 8cc87540cf4..da8e111ea6c 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java @@ -37,6 +37,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -78,19 +79,24 @@ class NoblePurposeTriggeredAbility extends TriggeredAbilityImpl { public NoblePurposeTriggeredAbility copy() { return new NoblePurposeTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedEvent) { - DamagedEvent damageEvent = (DamagedEvent) event; - if (damageEvent.isCombatDamage()) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) - && permanent.getControllerId().equals(this.getControllerId())) { - this.getEffects().clear(); - this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); - return true; - } + DamagedEvent damageEvent = (DamagedEvent) event; + if (damageEvent.isCombatDamage()) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(this.getControllerId())) { + this.getEffects().clear(); + this.getEffects().add(new GainLifeEffect(damageEvent.getAmount())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java b/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java index a068a919de1..b1845f275c5 100644 --- a/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java +++ b/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java @@ -28,19 +28,19 @@ package mage.sets.mercadianmasques; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; 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.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -88,10 +88,14 @@ class PiousWarriorTriggeredAbility extends TriggeredAbilityImpl { return new PiousWarriorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId) - && ((DamagedCreatureEvent)event).isCombatDamage() ) { + if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage() ) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java index 1127a3244b4..502ac964fb9 100644 --- a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java +++ b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java @@ -48,6 +48,7 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -177,11 +178,14 @@ class AmberPrisonUntapTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getType().equals(GameEvent.EventType.UNTAP) && event.getTargetId().equals(this.getSourceId()); - + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UNTAP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getTargetId().equals(this.getSourceId()); } - } class AmberPrisonReleaseOnUntapEffect extends OneShotEffect { diff --git a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java index 6bed4e6f21d..66e96becae5 100644 --- a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java +++ b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java @@ -28,21 +28,22 @@ package mage.sets.mirage; import java.util.UUID; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.abilities.effects.OneShotEffect; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; +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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import mage.cards.CardImpl; /** * @@ -87,24 +88,26 @@ class RockBasiliskTriggeredAbility extends TriggeredAbilityImpl { return new RockBasiliskTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent rockBasilisk = game.getPermanent(sourceId); - if (blocker != null && blocker != rockBasilisk - && !blocker.getSubtype().contains("Wall") - && blocked == rockBasilisk) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == rockBasilisk - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } - return false; + Permanent blocker = game.getPermanent(event.getSourceId()); + Permanent blocked = game.getPermanent(event.getTargetId()); + Permanent rockBasilisk = game.getPermanent(sourceId); + if (blocker != null && blocker != rockBasilisk + && !blocker.getSubtype().contains("Wall") + && blocked == rockBasilisk) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); + return true; + } + if (blocker != null && blocker == rockBasilisk + && !blocked.getSubtype().contains("Wall")) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java index 4761b1ac579..896454e6952 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java +++ b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java @@ -44,6 +44,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -95,6 +96,14 @@ class BansheesBladeAbility extends TriggeredAbilityImpl { return new BansheesBladeAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLANESWALKER + || event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event instanceof DamagedEvent && ((DamagedEvent) event).isCombatDamage() && !usedInPhase) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java b/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java index 862ed867526..f8f27d33be2 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java @@ -28,17 +28,17 @@ package mage.sets.mirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterArtifactPermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -81,19 +81,22 @@ class GlimmervoidTriggeredAbility extends TriggeredAbilityImpl { return new GlimmervoidTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { - FilterArtifactPermanent filter = new FilterArtifactPermanent(); - if (!game.getBattlefield().contains(filter, controllerId, 1, game)) { - return true; - } + FilterArtifactPermanent filter = new FilterArtifactPermanent(); + if (!game.getBattlefield().contains(filter, controllerId, 1, game)) { + return true; } return false; } @Override public String getRule() { - return "At the beginning of the end step, if you control no Artifacts, sacrifice {this}."; + return "At the beginning of the end step, if you control no artifacts, sacrifice {this}."; } } diff --git a/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java b/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java index 2725cdf1853..7b237c99fef 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java +++ b/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -81,14 +82,17 @@ class BecomesUntappedPermanentTriggeredAbility extends TriggeredAbilityImpl{ return new BecomesUntappedPermanentTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UNTAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UNTAPPED) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java b/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java index 3f3361791f5..669833fd276 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java +++ b/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java @@ -40,6 +40,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.TargetPermanent; /** @@ -86,18 +87,21 @@ class RustmouthOgreTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { - FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact that player controls"); - filter.add(new ControllerIdPredicate(event.getPlayerId())); - filter.setMessage("artifact controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } - this.getTargets().clear(); - this.addTarget(new TargetPermanent(filter)); - return true; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact that player controls"); + filter.add(new ControllerIdPredicate(event.getPlayerId())); + filter.setMessage("artifact controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + + this.getTargets().clear(); + this.addTarget(new TargetPermanent(filter)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java b/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java index 13387f70c25..cf7921dbde9 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java @@ -93,18 +93,20 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_CREATURE) { - Permanent equipment = game.getPermanent(this.getSourceId()); - if (equipment != null - && equipment.getAttachedTo() != null - && event.getSourceId().equals(equipment.getAttachedTo())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; - } + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent equipment = game.getPermanent(this.getSourceId()); + if (equipment != null + && equipment.getAttachedTo() != null + && event.getSourceId().equals(equipment.getAttachedTo())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java index 3b658942d11..738f32b57bf 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java @@ -29,17 +29,17 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -83,12 +83,14 @@ class ConsecratedSphinxTriggeredAbility extends TriggeredAbilityImpl { return new ConsecratedSphinxTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - return true; - } - return false; + return game.getOpponents(this.getControllerId()).contains(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java index 9d5026c995e..5b9188d9291 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java @@ -29,20 +29,20 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInYourGraveyard; @@ -102,9 +102,14 @@ class GlissaTheTraitorTriggeredAbility extends TriggeredAbilityImpl { return new GlissaTheTraitorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { return true; diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java index 3a2df2e2079..d2146f6213b 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java @@ -27,12 +27,7 @@ */ package mage.sets.mirrodinbesieged; -import mage.target.common.TargetCardInExile; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -40,12 +35,17 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterNonlandCard; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.players.Player; +import mage.target.common.TargetCardInExile; import mage.target.targetpointer.FixedTarget; /** @@ -122,9 +122,14 @@ class KnowledgePoolAbility extends TriggeredAbilityImpl { return new KnowledgePoolAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.HAND) { + if (event.getZone() == Zone.HAND) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java index b84b9b7c1ee..1cb4d5ae238 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java @@ -28,13 +28,13 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -76,17 +76,20 @@ class MagneticMineTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD - && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) - && zEvent.getTarget().getId() != this.getSourceId()) { - this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game); - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) + && zEvent.getTarget().getId() != this.getSourceId()) { + this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java index 69c80992b9a..3600167dada 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java @@ -29,9 +29,6 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -39,10 +36,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.continuous.BoostOpponentsEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -89,9 +89,14 @@ class MassacreWurmTriggeredAbility extends TriggeredAbilityImpl { return new MassacreWurmTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java index 206e931f52b..7e0ecbd7775 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.game.permanent.token.EmptyToken; @@ -89,9 +90,14 @@ class MirrorworksAbility extends TriggeredAbilityImpl { return new MirrorworksAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && !event.getTargetId().equals(this.getSourceId())) { + if (!event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getControllerId().equals(getControllerId()) diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java index 27eae919aae..6751f451c29 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.ZombieToken; /** @@ -82,12 +83,14 @@ class NestedGhoulTriggeredAbility extends TriggeredAbilityImpl { return new NestedGhoulTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { - return true; - } - return false; + return event.getTargetId().equals(this.sourceId); } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java index 0f644d47dfb..bfd4bd93ddf 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java @@ -29,17 +29,17 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -86,9 +86,14 @@ class SangromancerFirstTriggeredAbility extends TriggeredAbilityImpl { return new SangromancerFirstTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) { return true; @@ -117,12 +122,14 @@ class SangromancerSecondTriggeredAbility extends TriggeredAbilityImpl { return new SangromancerSecondTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { - return true; - } - return false; + return game.getOpponents(this.getControllerId()).contains(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java index 9dfa604a43a..b484423a45b 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java @@ -28,19 +28,19 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -85,13 +85,20 @@ class SepticRatsTriggeredAbility extends TriggeredAbilityImpl { return new SepticRatsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + if (event.getSourceId().equals(this.getSourceId()) ) { Player target = game.getPlayer(event.getTargetId()); - if (target != null) - if (target.getCounters().getCount(CounterType.POISON) > 0) + if (target != null) { + if (target.getCounters().getCount(CounterType.POISON) > 0) { return true; + } + } } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java index 238dbe813a4..fe1da156925 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java @@ -29,30 +29,30 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.continuous.BoostEquippedEffect; -import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.effects.common.UntapAllLandsControllerEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.constants.AttachmentType; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -106,17 +106,20 @@ class SwordOfFeastAndFamineAbility extends TriggeredAbilityImpl { return new SwordOfFeastAndFamineAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java index 4de16ffabe8..c53527f619a 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java @@ -42,6 +42,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.Token; /** @@ -99,9 +100,14 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl { return new ThopterAssemblyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { if (game.getBattlefield().count(filter, this.getSourceId(), this.getControllerId(), game) == 0) { return true; } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java index a653caa7835..c214b50e504 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java @@ -28,16 +28,16 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; 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.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -116,9 +116,14 @@ class VirulentWoundDelayedTriggeredAbility extends DelayedTriggeredAbility { this.target = ability.target; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) { + if (event.getTargetId().equals(target)) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { return true; diff --git a/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java b/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java index ac211f2a112..cd4379e7e8e 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java +++ b/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java @@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -101,16 +102,16 @@ class AuntiesSnitchTriggeredAbility extends TriggeredAbilityImpl { return new AuntiesSnitchTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && filter.match(p, getSourceId(), getControllerId(), game)) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && filter.match(p, getSourceId(), getControllerId(), game); } @Override diff --git a/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java b/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java index c20d6f7aade..24b3b74b88c 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java +++ b/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreaturePermanent; /** @@ -89,14 +90,14 @@ class DreamspoilerWitchesTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST - && event.getPlayerId().equals(this.controllerId) - && game.getOpponents(this.controllerId).contains(game.getActivePlayerId())) { - return true; + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } - } - return false; + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals(this.controllerId) + && game.getOpponents(this.controllerId).contains(game.getActivePlayerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java b/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java index cc72de228cd..44d11fc8d92 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java +++ b/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java @@ -92,10 +92,14 @@ class TrygonPredatorTriggeredAbility extends TriggeredAbilityImpl { return new TrygonPredatorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { Player player = game.getPlayer(event.getTargetId()); if (player != null) { FilterPermanent filter = new FilterPermanent("an artifact or enchantment controlled by " + player.getLogName()); diff --git a/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java b/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java index ed4882fe4ce..eba1fdfac0c 100644 --- a/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java +++ b/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java @@ -28,8 +28,6 @@ package mage.sets.morningtide; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -37,11 +35,18 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -99,20 +104,23 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl { return new GreatbowDoyenTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent creature = game.getPermanent(event.getSourceId()); - Permanent damagedCreature = game.getPermanent(event.getTargetId()); - if (creature != null && damagedCreature != null - && creature.getCardType().contains(CardType.CREATURE) - && creature.hasSubtype("Archer") - && creature.getControllerId().equals(controllerId)) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId()); - this.getEffects().get(0).setValue("source", event.getSourceId()); - return true; - } + Permanent creature = game.getPermanent(event.getSourceId()); + Permanent damagedCreature = game.getPermanent(event.getTargetId()); + if (creature != null && damagedCreature != null + && creature.getCardType().contains(CardType.CREATURE) + && creature.hasSubtype("Archer") + && creature.getControllerId().equals(controllerId)) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId()); + this.getEffects().get(0).setValue("source", event.getSourceId()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java index 69d1fd40a34..377e70bf95d 100644 --- a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java +++ b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java @@ -148,9 +148,14 @@ class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl { return new OonasBlackguardTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (((DamagedPlayerEvent) event).isCombatDamage()) { Permanent creature = game.getPermanent(event.getSourceId()); if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters().getCount(CounterType.P1P1) > 0) { for(Effect effect : this.getEffects()) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java b/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java index 10810e3a16e..ba41a9d2fcc 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java @@ -28,19 +28,20 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -86,10 +87,15 @@ class ArmWithAEtherTriggeredAbility extends TriggeredAbilityImpl { return new ArmWithAEtherTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Player opponent = game.getPlayer(event.getPlayerId()); - if (opponent != null && event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) { + if (opponent != null && event.getSourceId().equals(this.sourceId)) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); filter.add(new ControllerIdPredicate(opponent.getId())); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java index f1608622608..6bee1ff994d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java @@ -28,16 +28,16 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; @@ -93,9 +93,14 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl { return new BlindZealotTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { Player player = game.getPlayer(this.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java index e7fdb969e10..08e62f19988 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java @@ -28,33 +28,30 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.Mana; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.effects.common.ManaEffect; import mage.abilities.mana.TriggeredManaAbility; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; +import mage.constants.CardType; import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.SubLayer; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; -import mage.util.CardUtil; /** * @@ -135,9 +132,14 @@ class CagedSunTriggeredAbility extends TriggeredManaAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.MANA_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.MANA_ADDED && event.getPlayerId().equals(controllerId)) { + if (event.getPlayerId().equals(controllerId)) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { ObjectColor color = (ObjectColor) game.getState().getValue(this.sourceId + "_color"); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java index c68d2b0bd97..cacff52229b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java @@ -28,9 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -41,11 +38,15 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.filter.FilterSpell; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -124,9 +125,14 @@ class ChancellorOfTheAnnexDelayedTriggeredAbility extends DelayedTriggeredAbilit this.playerId = ability.playerId; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) { + if (event.getPlayerId().equals(playerId)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java index 41747b07803..f91dc4953dd 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java @@ -28,9 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -39,8 +36,12 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -85,12 +86,14 @@ class ChancellorOfTheDrossDelayedTriggeredAbility extends DelayedTriggeredAbilit super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return true; - } - return false; + return true; } @Override public ChancellorOfTheDrossDelayedTriggeredAbility copy() { @@ -115,8 +118,9 @@ class ChancellorOfTheDrossEffect extends OneShotEffect { for (UUID opponentId : game.getOpponents(source.getControllerId())) { loseLife += game.getPlayer(opponentId).loseLife(3, game); } - if (loseLife > 0) + if (loseLife > 0) { game.getPlayer(source.getControllerId()).gainLife(loseLife, game); + } return true; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java index dcd832f67ad..581d2670154 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java @@ -28,9 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; import mage.MageInt; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.ChancellorAbility; @@ -40,10 +37,14 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.Token; /** @@ -95,12 +96,14 @@ class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbilit super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - return true; - } - return false; + return true; } @Override public ChancellorOfTheForgeDelayedTriggeredAbility copy() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java index 0f7592fde23..1a1c43a3e2d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java @@ -28,10 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -41,11 +37,16 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect; 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.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCardInOpponentsGraveyard; @@ -103,10 +104,15 @@ class ChancellorOfTheSpiresDelayedTriggeredAbility extends DelayedTriggeredAbili ChancellorOfTheSpiresDelayedTriggeredAbility(ChancellorOfTheSpiresDelayedTriggeredAbility ability) { super(ability); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE; + return true; } @Override public ChancellorOfTheSpiresDelayedTriggeredAbility copy() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java index b8634fc3996..810a3c9db94 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java @@ -28,18 +28,19 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.Mana; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.ChancellorAbility; import mage.abilities.effects.common.BasicManaEffect; -import mage.abilities.keyword.VigilanceAbility; import mage.abilities.keyword.ReachAbility; +import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -85,12 +86,14 @@ class ChancellorOfTheTangleDelayedTriggeredAbility extends DelayedTriggeredAbili super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PRECOMBAT_MAIN_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE && game.getActivePlayerId().equals(controllerId)) { - return true; - } - return false; + return game.getActivePlayerId().equals(controllerId); } @Override public ChancellorOfTheTangleDelayedTriggeredAbility copy() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java b/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java index a4d08f27ef6..8e590125377 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java @@ -28,9 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -40,10 +37,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.Card; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetLandPermanent; import mage.target.targetpointer.FixedTarget; @@ -118,9 +118,14 @@ class InvaderParasiteTriggeredAbility extends TriggeredAbilityImpl { return new InvaderParasiteTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { Permanent p = game.getPermanent(event.getTargetId()); Permanent sourcePermanent = game.getPermanent(getSourceId()); if (p != null && sourcePermanent != null) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java index 09348348fc0..38deecc35fe 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java @@ -177,12 +177,14 @@ class KarnLiberatedDelayedTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BEGINNING_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.BEGINNING_PHASE_PRE) { - return true; - } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java index 6adb55f68ea..b4aad1e5299 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java @@ -28,23 +28,23 @@ package mage.sets.newphyrexia; import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; -import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.cards.CardImpl; import mage.filter.FilterPermanent; -import mage.filter.common.FilterArtifactOrEnchantmentPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.targetpointer.FixedTarget; @@ -107,13 +107,17 @@ class NumbingDoseTriggeredAbility extends TriggeredAbilityImpl { return new NumbingDoseTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent equipment = game.getPermanent(this.getSourceId()); if (equipment != null) { Permanent permanent = game.getPermanent(equipment.getAttachedTo()); - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE - && permanent != null && event.getPlayerId().equals(permanent.getControllerId())) { + if (permanent != null && event.getPlayerId().equals(permanent.getControllerId())) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); return true; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java index 1ad441cca6d..5811c99d20a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java @@ -28,19 +28,19 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -86,9 +86,14 @@ class PhyrexianObliteratorTriggeredAbility extends TriggeredAbilityImpl { return new PhyrexianObliteratorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(this.sourceId)) { UUID controller = game.getControllerId(event.getSourceId()); if (controller != null) { Player player = game.getPlayer(controller); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java b/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java index cbe7316723a..45073f0eb6d 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java @@ -28,10 +28,6 @@ package mage.sets.newphyrexia; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; @@ -39,9 +35,14 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +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; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.TargetCard; @@ -84,9 +85,14 @@ class PsychicSurgeryTriggeredAbility extends TriggeredAbilityImpl { return new PsychicSurgeryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LIBRARY_SHUFFLED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LIBRARY_SHUFFLED && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { this.getEffects().get(0).setValue("PsychicSurgeryOpponent", event.getPlayerId()); return true; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java index 4cb2367ce79..cd3c011410f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java @@ -28,19 +28,18 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.PhyrexianManaCost; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.DamageTargetEffect; -import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.common.TargetCreatureOrPlayer; @@ -82,9 +81,14 @@ class RageExtractorTriggeredAbility extends TriggeredAbilityImpl { return new RageExtractorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { Spell spell = (Spell) game.getStack().getStackObject(event.getTargetId()); if (spell != null) { for (ManaCost cost : spell.getCard().getManaCost()) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java index d4fb7ce5d23..c8da60dba23 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java @@ -28,19 +28,19 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -85,9 +85,14 @@ class ReaperOfSheoldredTriggeredAbility extends TriggeredAbilityImpl { return new ReaperOfSheoldredTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.getSourceId())) { + if (event.getTargetId().equals(this.getSourceId())) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java index 68c43806518..73456cb31bd 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java @@ -29,9 +29,6 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; @@ -40,6 +37,8 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; @@ -47,6 +46,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -100,9 +100,14 @@ class SuturePriestSecondTriggeredAbility extends TriggeredAbilityImpl { return new SuturePriestSecondTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent)event; Card card = zEvent.getTarget(); if (card != null && card.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java index b75e1b27ef9..1bfd7373e8e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java @@ -29,12 +29,6 @@ package mage.sets.newphyrexia; import java.util.UUID; - -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -49,12 +43,18 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; @@ -119,15 +119,18 @@ class SwordOfWarAndPeaceAbility extends TriggeredAbilityImpl { return new SwordOfWarAndPeaceAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - getTargets().get(0).add(event.getPlayerId(), game); - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + getTargets().get(0).add(event.getPlayerId(), game); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java index c89f8dafe3c..00d838eea5e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java @@ -43,6 +43,7 @@ import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -95,9 +96,14 @@ class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); diff --git a/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java b/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java index 8df3fd58fb5..2b7fc3a8202 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java +++ b/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java @@ -28,7 +28,6 @@ package mage.sets.ninthedition; import java.util.UUID; - import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; @@ -37,6 +36,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.StackObject; import mage.target.targetpointer.FixedTarget; @@ -76,15 +76,18 @@ class CowardiceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (GameEvent.EventType.TARGETED.equals(event.getType())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && - StackObject.class.isInstance(game.getObject(event.getSourceId()))) { - getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && + StackObject.class.isInstance(game.getObject(event.getSourceId()))) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java index 6bd0b64e1dd..68f56668e4d 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java +++ b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java @@ -28,17 +28,17 @@ package mage.sets.ninthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -82,28 +82,29 @@ class DeathgazerTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { if (event.getSourceId().equals(this.getSourceId())) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if(permanent != null && !permanent.getColor(game).isBlack()) - { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && !permanent.getColor(game).isBlack()) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } - if (event.getTargetId().equals(this.getSourceId())) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if(permanent != null && !permanent.getColor(game).isBlack()) - { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + } + if (event.getTargetId().equals(this.getSourceId())) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent != null && !permanent.getColor(game).isBlack()) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/ninthedition/GravePact.java b/Mage.Sets/src/mage/sets/ninthedition/GravePact.java index 08c949d9b2e..c501bccf124 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/GravePact.java +++ b/Mage.Sets/src/mage/sets/ninthedition/GravePact.java @@ -30,16 +30,17 @@ package mage.sets.ninthedition; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -85,10 +86,14 @@ class GravePactTriggeredAbility extends TriggeredAbilityImpl { return new GravePactTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java index 093240dfd8a..052be88b5cf 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java +++ b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java @@ -27,7 +27,7 @@ */ package mage.sets.ninthedition; -import mage.MageObject; +import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; @@ -36,11 +36,10 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.StackObject; import mage.target.common.TargetCreatureOrPlayer; -import java.util.UUID; - /** * * @author dustinconrad @@ -85,10 +84,14 @@ class GuerrillaTacticsTriggeredAbility extends TriggeredAbilityImpl { return new GuerrillaTacticsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) && - game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && + return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && StackObject.class.isInstance(game.getObject(event.getSourceId())) && getSourceId().equals(event.getTargetId()); } diff --git a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java index 15daeb33623..e506714d397 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java +++ b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java @@ -28,18 +28,18 @@ package mage.sets.ninthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -90,12 +90,14 @@ class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl { return new BeginningOfEndStepTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { - return true; - } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java b/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java index 4f11353d94a..131fcb69db8 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java +++ b/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java @@ -36,6 +36,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -79,14 +80,17 @@ class BattleStrainTriggeredAbility extends TriggeredAbilityImpl { return new BattleStrainTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - if (blocker != null) { - getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId())); - return true; - } + Permanent blocker = game.getPermanent(event.getSourceId()); + if (blocker != null) { + getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/odyssey/BombSquad.java b/Mage.Sets/src/mage/sets/odyssey/BombSquad.java index ece09b89c1a..0f370761a0c 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BombSquad.java +++ b/Mage.Sets/src/mage/sets/odyssey/BombSquad.java @@ -112,9 +112,14 @@ class BombSquadTriggeredAbility extends TriggeredAbilityImpl { return new BombSquadTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.COUNTER_ADDED) && event.getData().equals(CounterType.FUSE.getName())) { + if (event.getData().equals(CounterType.FUSE.getName())) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && filter.match(permanent, game)) { if (4 <= permanent.getCounters().getCount(CounterType.FUSE)) { diff --git a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java index 4acbfaa5dfd..5f0b340da9a 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java +++ b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java @@ -53,6 +53,7 @@ import mage.filter.predicate.other.OwnerPredicate; import mage.filter.predicate.permanent.TokenPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -84,9 +85,9 @@ public class DecayingSoil extends CardImpl { // Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand." this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new ConditionalContinuousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility(new DecayingSoilEffect(), filter)), - new CardsInControllerGraveCondition(7), - "Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand"))); + new ConditionalContinuousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility(new DecayingSoilEffect(), filter)), + new CardsInControllerGraveCondition(7), + "Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand"))); } public DecayingSoil(final DecayingSoil card) { @@ -118,16 +119,19 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl { return new DecayingSoilTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) { + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; } } return false; @@ -136,10 +140,7 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkInterveningIfClause(Game game) { Player controller = game.getPlayer(this.getControllerId()); - if(controller != null && controller.getGraveyard().contains(this.getSourceId())) { - return true; - } - return false; + return controller != null && controller.getGraveyard().contains(this.getSourceId()); } diff --git a/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java b/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java index 68d02ca94ec..7746b54f027 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java +++ b/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.SquirrelToken; import mage.game.permanent.token.Token; @@ -96,16 +97,19 @@ class DruidsCallTriggeredAbility extends TriggeredAbilityImpl { return new DruidsCallTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent enchantment = game.getPermanent(sourceId); - UUID targetId = event.getTargetId(); - if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + UUID targetId = event.getTargetId(); + if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java b/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java index cf41b23ce12..c6b83071738 100644 --- a/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java +++ b/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -83,14 +84,17 @@ class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl { return new DealtDamageLoseLifeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - if (event.getTargetId().equals(this.sourceId)) { - this.getEffects().clear(); - this.addEffect(new LoseLifeSourceControllerEffect(event.getAmount())); - return true; - } + if (event.getTargetId().equals(this.sourceId)) { + this.getEffects().clear(); + this.addEffect(new LoseLifeSourceControllerEffect(event.getAmount())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java b/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java index 700b591ffa7..5b3978c5bb1 100644 --- a/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java +++ b/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java @@ -82,10 +82,15 @@ class KarmicJusticeTriggeredAbility extends TriggeredAbilityImpl { public KarmicJusticeTriggeredAbility copy() { return new KarmicJusticeTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DESTROYED_PERMANENT; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DESTROYED_PERMANENT && event.getPlayerId().equals(controllerId) + if (event.getPlayerId().equals(controllerId) && game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) { MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (!mageObject.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java index 3d5b5cfc7c6..2e372d71a3a 100644 --- a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java +++ b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -79,18 +80,21 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.LAND) - && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND) + && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java b/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java index 4369d8ec24c..2d74fc979d8 100644 --- a/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java +++ b/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java @@ -93,19 +93,20 @@ class SavageFirecatTriggeredAbility extends TriggeredAbilityImpl { return new SavageFirecatTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TAPPED_FOR_MANA && - game.getCard(event.getSourceId()).getCardType().contains(CardType.LAND) && - event.getPlayerId().equals(this.controllerId)){ - return true; - } - return false; -} + return game.getCard(event.getSourceId()).getCardType().contains(CardType.LAND) && + event.getPlayerId().equals(this.controllerId); + } @Override public String getRule() { return "Whenever you tap a land for mana, remove a +1/+1 counter from {this}"; -} + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/odyssey/SparkMage.java b/Mage.Sets/src/mage/sets/odyssey/SparkMage.java index 9b4db2dd7ec..817b3446221 100644 --- a/Mage.Sets/src/mage/sets/odyssey/SparkMage.java +++ b/Mage.Sets/src/mage/sets/odyssey/SparkMage.java @@ -40,6 +40,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -74,41 +75,44 @@ public class SparkMage extends CardImpl { class SparkMageTriggeredAbility extends TriggeredAbilityImpl { - public SparkMageTriggeredAbility(){ + public SparkMageTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); this.addTarget(new TargetCreaturePermanent()); } - + public SparkMageTriggeredAbility(final SparkMageTriggeredAbility ability) { super(ability); } - -@Override + + @Override public SparkMageTriggeredAbility copy() { return new SparkMageTriggeredAbility(this); } -@Override + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())){ - Player opponent = game.getPlayer(event.getPlayerId()); - if (opponent != null) { - FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); - filter.add(new ControllerIdPredicate(opponent.getId())); - this.getTargets().clear(); - this.getTargets().add(new TargetCreaturePermanent(filter)); - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { + Player opponent = game.getPlayer(event.getPlayerId()); + if (opponent != null) { + FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls"); + filter.add(new ControllerIdPredicate(opponent.getId())); + this.getTargets().clear(); + this.getTargets().add(new TargetCreaturePermanent(filter)); + return true; } } return false; } -@Override + @Override public String getRule() { return "Whenever {this} deals combat damage to a player, you may have {this} deal 1 damage to target creature that player controls."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java b/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java index f13eb6d123f..d18b15eebb7 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java +++ b/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java @@ -41,6 +41,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; @@ -88,18 +89,21 @@ class SpiritualizeTriggeredAbility extends DelayedTriggeredAbility { return new SpiritualizeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) { - Permanent target = game.getPermanent(this.getFirstTarget()); - if (target != null && event.getSourceId().equals(target.getId())) { - for (Effect effect : this.getEffects()) { - effect.setValue("damage", event.getAmount()); - } - return true; + Permanent target = game.getPermanent(this.getFirstTarget()); + if (target != null && event.getSourceId().equals(target.getId())) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/odyssey/Standstill.java b/Mage.Sets/src/mage/sets/odyssey/Standstill.java index 9cc4fa20b2a..58472b1bceb 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Standstill.java +++ b/Mage.Sets/src/mage/sets/odyssey/Standstill.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -77,13 +78,15 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/onslaught/FalseCure.java b/Mage.Sets/src/mage/sets/onslaught/FalseCure.java index 5b5f4cf1221..baa02d6fbf2 100644 --- a/Mage.Sets/src/mage/sets/onslaught/FalseCure.java +++ b/Mage.Sets/src/mage/sets/onslaught/FalseCure.java @@ -80,17 +80,19 @@ class FalseCureTriggeredAbility extends DelayedTriggeredAbility { public FalseCureTriggeredAbility copy() { return new FalseCureTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.GAINED_LIFE) { - this.getEffects().clear(); - Effect effect = new LoseLifeTargetEffect(2 * event.getAmount()); - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - this.addEffect(effect); - return true; - } - return false; + this.getEffects().clear(); + Effect effect = new LoseLifeTargetEffect(2 * event.getAmount()); + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + this.addEffect(effect); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java b/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java index b19067af0ba..63b9a0f1474 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java +++ b/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java @@ -105,9 +105,14 @@ class BenalishCommanderTriggeredAbility extends TriggeredAbilityImpl { return new BenalishCommanderTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java b/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java index 49abf2bda3e..bfa18d8ca8a 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java +++ b/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java @@ -47,7 +47,6 @@ import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.game.events.GameEvent; @@ -106,9 +105,14 @@ class DetritivoreTriggeredAbility extends TriggeredAbilityImpl { return new DetritivoreTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java index 9ed7ce665b1..7317d947f4c 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java +++ b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java @@ -100,9 +100,14 @@ class FungalBehemothTriggeredAbility extends TriggeredAbilityImpl { return new FungalBehemothTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java b/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java index ebb54e10c31..7330a1cdcbc 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java +++ b/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java @@ -105,9 +105,14 @@ class RoilingHorrorTriggeredAbility extends TriggeredAbilityImpl { return new RoilingHorrorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_REMOVED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); + return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java b/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java index d97462eb7e4..77459d9cf1c 100644 --- a/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java +++ b/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java @@ -28,13 +28,6 @@ package mage.sets.planechase2012; import java.util.UUID; - -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -46,9 +39,16 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.SaprolingToken; import mage.target.TargetPermanent; @@ -104,15 +104,18 @@ class PollenbrightWingsAbility extends TriggeredAbilityImpl { return new PollenbrightWingsAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - game.getState().setValue(new StringBuilder("Damage_").append(getSourceId().toString()).toString(), new Integer(damageEvent.getAmount())); - return true; - } + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + game.getState().setValue(new StringBuilder("Damage_").append(getSourceId().toString()).toString(), new Integer(damageEvent.getAmount())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java b/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java index b52321f3e03..d9f60ea27fc 100644 --- a/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java +++ b/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -83,18 +84,20 @@ class PhyrexianTyrannyTriggeredAbility extends TriggeredAbilityImpl { public PhyrexianTyrannyTriggeredAbility copy() { return new PhyrexianTyrannyTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD) { - for (Effect effect : this.getEffects()) { - if (effect instanceof PhyrexianTyrannyEffect) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } + for (Effect effect : this.getEffects()) { + if (effect instanceof PhyrexianTyrannyEffect) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } - return true; } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java b/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java index 1815f45eda4..20480a867c8 100644 --- a/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java +++ b/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java @@ -27,22 +27,22 @@ */ package mage.sets.ravnica; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * @author nantuko */ @@ -86,9 +86,14 @@ class BelltowerSphinxEffect extends TriggeredAbilityImpl { return new BelltowerSphinxEffect(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(this.sourceId)) { UUID controller = game.getControllerId(event.getSourceId()); if (controller != null) { Player player = game.getPlayer(controller); diff --git a/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java b/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java index fd5d9b39157..26741f9e704 100644 --- a/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java +++ b/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java @@ -28,29 +28,30 @@ package mage.sets.ravnica; import java.util.UUID; -import mage.cards.CardImpl; -import mage.constants.Rarity; -import mage.constants.CardType; -import mage.target.TargetPermanent; -import mage.target.common.TargetControlledCreaturePermanent; -import mage.abilities.effects.common.AttachEffect; -import mage.constants.Outcome; import mage.abilities.Ability; -import mage.abilities.keyword.EnchantAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TurnPhase; import mage.constants.Zone; -import mage.game.events.GameEvent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.CanBeEnchantedByPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; -import mage.abilities.effects.OneShotEffect; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; +import mage.game.turn.TurnMod; import mage.players.Player; import mage.target.Target; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.turn.TurnMod; -import mage.constants.TurnPhase; -import mage.filter.predicate.permanent.CanBeEnchantedByPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; /** * @author duncant */ @@ -96,21 +97,24 @@ class BreathOfFuryAbility extends TriggeredAbilityImpl { return new BreathOfFuryAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent enchantment = game.getPermanent(getSourceId()); - if (damageEvent.isCombatDamage() && - enchantment != null && - enchantment.getAttachedTo().equals(event.getSourceId())) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - for (Effect effect : getEffects()) { - effect.setValue("TriggeringCreatureId", creature.getId()); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent enchantment = game.getPermanent(getSourceId()); + if (damageEvent.isCombatDamage() && + enchantment != null && + enchantment.getAttachedTo().equals(event.getSourceId())) { + Permanent creature = game.getPermanent(enchantment.getAttachedTo()); + if (creature != null) { + for (Effect effect : getEffects()) { + effect.setValue("TriggeringCreatureId", creature.getId()); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java b/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java index a3790504e3e..8b31778fb04 100644 --- a/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java +++ b/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java @@ -43,6 +43,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; @@ -95,17 +96,20 @@ class TwilightDroverTriggeredAbility extends TriggeredAbilityImpl { public TwilightDroverTriggeredAbility copy() { return new TwilightDroverTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanentOrLKIBattlefield(targetId); - if (permanent != null) { - return permanent.getCardType().contains(CardType.CREATURE) && permanent instanceof PermanentToken; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD) { + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanentOrLKIBattlefield(targetId); + if (permanent != null) { + return permanent.getCardType().contains(CardType.CREATURE) && permanent instanceof PermanentToken; } } return false; diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java index b6aa841b69b..0540913d9b7 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java @@ -29,9 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -39,9 +36,12 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -96,9 +96,14 @@ class AshZealotTriggeredAbility extends TriggeredAbilityImpl { return new AshZealotTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) { + if (event.getZone() == Zone.GRAVEYARD) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java b/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java index a70782eca81..040d0822919 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java @@ -28,12 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -41,9 +35,15 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.RemoveCounterSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.Counter; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -96,12 +96,14 @@ class AzorsElocutorsTriggeredAbility extends TriggeredAbilityImpl { return new AzorsElocutorsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.controllerId)) { - return true; - } - return false; + return event.getTargetId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java b/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java index fb6f584b6cf..e09ca773fc1 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java @@ -29,9 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -39,10 +36,13 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -89,20 +89,23 @@ class ChronicFloodingAbility extends TriggeredAbilityImpl { ChronicFloodingAbility(final ChronicFloodingAbility ability) { super(ability); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(source.getAttachedTo()); - if (attached != null) { - - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; + Permanent source = game.getPermanent(this.sourceId); + if (source != null && source.getAttachedTo().equals(event.getTargetId())) { + Permanent attached = game.getPermanent(source.getAttachedTo()); + if (attached != null) { + + for (Effect e : getEffects()) { + e.setTargetPointer(new FixedTarget(attached.getControllerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java b/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java index 340ece52494..aec0e7eb0fe 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java @@ -28,19 +28,19 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -85,11 +85,15 @@ public class CrosstownCourier extends CardImpl { return new CrosstownCourierTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { - for (Effect effect:getEffects()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { + for (Effect effect : getEffects()) { if (effect instanceof PutLibraryIntoGraveTargetEffect) { effect.setTargetPointer(new FixedTarget(event.getTargetId())); ((PutLibraryIntoGraveTargetEffect) effect).setAmount(new StaticValue(event.getAmount())); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java b/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java index 32601942dde..86ef17515c0 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java @@ -29,16 +29,16 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -83,10 +83,14 @@ class DeathsPresenceTriggeredAbility extends TriggeredAbilityImpl { return new DeathsPresenceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java index c83780397b9..d28418b9095 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java @@ -29,11 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.TriggeredAbilityImpl; @@ -44,12 +39,17 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -97,10 +97,14 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl { return new GraveBetrayalTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && !permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java index ece1c64a992..c0638aed100 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java @@ -31,19 +31,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.PhaseStep; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -53,14 +44,19 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterNonlandCard; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; -import mage.game.turn.Step; import mage.players.Player; import mage.target.TargetCard; import mage.target.common.TargetCardInExile; @@ -118,15 +114,18 @@ class JaceArchitectOfThoughtDelayedTriggeredAbility extends DelayedTriggeredAbil super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java index 74623e0cfbe..570c89917f2 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java @@ -29,11 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -42,8 +37,13 @@ import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -93,13 +93,16 @@ class LobberCrewTriggeredAbility extends TriggeredAbilityImpl { return new LobberCrewTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { - return true; - } + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java b/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java index 3cdce461326..9982076c195 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java @@ -28,9 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -38,11 +35,14 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -93,18 +93,21 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl { return new NecropolisRegentTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { - this.getEffects().clear(); - Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount())); - effect.setTargetPointer(new FixedTarget(creature.getId())); - this.addEffect(effect); - return true; - } + if (((DamagedPlayerEvent) event).isCombatDamage()) { + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && creature.getControllerId().equals(controllerId)) { + this.getEffects().clear(); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount())); + effect.setTargetPointer(new FixedTarget(creature.getId())); + this.addEffect(effect); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java index 1bbf63022c7..a001e95d098 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java @@ -29,15 +29,15 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.common.TargetCreatureOrPlayer; @@ -81,15 +81,15 @@ class PyroconvergenceTriggeredAbility extends TriggeredAbilityImpl { return new PyroconvergenceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java b/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java index 3032bf26c30..1d0e8b0be59 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java @@ -28,22 +28,22 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.game.turn.TurnMod; @@ -125,10 +125,14 @@ class SearchTheCityTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST || event.getType() == EventType.LAND_PLAYED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.LAND_PLAYED) - && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { String cardName = ""; if (event.getType() == GameEvent.EventType.SPELL_CAST) { Spell spell = game.getStack().getSpell(event.getTargetId()); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java b/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java index fc91274ff33..71d8f323641 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java @@ -29,17 +29,17 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -93,9 +93,14 @@ class ShriekingAfflictionTriggeredAbility extends TriggeredAbilityImpl { return new ShriekingAfflictionTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Player player = game.getPlayer(event.getPlayerId()); if (player != null && player.getHand().size() < 2) { this.getEffects().clear(); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java b/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java index 48f58783b3d..68a9d768ce0 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java @@ -29,14 +29,13 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; @@ -44,6 +43,7 @@ import mage.filter.predicate.mageobject.ToughnessPredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreaturePermanent; /** @@ -87,9 +87,14 @@ class SkymarkRocAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls with toughness 2 or less"); UUID defenderId = game.getCombat().getDefendingPlayerId(sourceId, game); filter.add(new ControllerIdPredicate(defenderId)); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java index 4a89055ee60..18db391510f 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java @@ -29,7 +29,6 @@ package mage.sets.returntoravnica; import java.util.UUID; -import static javax.xml.bind.JAXBIntrospector.getValue; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -46,6 +45,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -93,19 +93,22 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.CREATURE) - && permanent.getControllerId().equals(this.controllerId) - && event.getTargetId() != this.getSourceId()) { - Effect effect = this.getEffects().get(0); - // life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) - effect.setValue("lifeSource", event.getTargetId()); - effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game)); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(this.controllerId) + && event.getTargetId() != this.getSourceId()) { + Effect effect = this.getEffects().get(0); + // life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution) + effect.setValue("lifeSource", event.getTargetId()); + effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java index 7b599f6b00e..cc804adcfad 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java @@ -29,11 +29,6 @@ package mage.sets.returntoravnica; import java.util.List; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -42,7 +37,11 @@ import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.PhaseStep; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -107,6 +106,12 @@ class VolatileRigTriggeredAbility extends TriggeredAbilityImpl { return new VolatileRigTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COMBAT_DAMAGE_STEP_POST + || event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { /* diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java index 8ba32e31cf1..e04c58658c0 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java @@ -28,11 +28,6 @@ package mage.sets.returntoravnica; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.*; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -46,13 +41,20 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseGameTargetPlayerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedPlaneswalkerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; -import mage.game.turn.Step; import mage.target.common.TargetNonlandPermanent; import mage.target.targetpointer.FixedTarget; @@ -178,9 +180,13 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER && ((DamagedPlaneswalkerEvent) event).isCombatDamage() && event.getTargetId() == sourceId) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (((DamagedPlaneswalkerEvent) event).isCombatDamage() && event.getTargetId() == sourceId) { Permanent sourceOfDamage = game.getPermanent(event.getSourceId()); if (sourceOfDamage != null && sourceOfDamage.getCardType().contains(CardType.CREATURE)) { Effect effect = this.getEffects().get(0); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java index 636e9e8de86..f7fb2a5a09a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java @@ -28,24 +28,24 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.Outcome; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GainLifeEffect; 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.counters.CounterType; +import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -94,12 +94,17 @@ class AngelheartVialTriggeredAbility extends TriggeredAbilityImpl { return new AngelheartVialTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) { - this.getEffects().get(0).setValue("damageAmount", event.getAmount()); - return true; - } + if (event.getTargetId().equals(this.getControllerId())) { + this.getEffects().get(0).setValue("damageAmount", event.getAmount()); + return true; + } return false; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java index e8dbc4fd6d1..cc5dbffc11c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java @@ -27,22 +27,23 @@ */ package mage.sets.riseoftheeldrazi; +import java.util.Set; import java.util.UUID; -import mage.constants.Zone; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.cards.CardImpl; -import mage.abilities.TriggeredAbilityImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.abilities.effects.OneShotEffect; -import mage.constants.Outcome; import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; -import java.util.Set; /** * @@ -83,12 +84,14 @@ public class BanefulOmen extends CardImpl { return new BanefulOmenTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java index 854f7419668..98dbcb72f86 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java @@ -28,10 +28,6 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -41,8 +37,13 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -93,18 +94,21 @@ class ContaminatedGroundAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent source = game.getPermanent(this.sourceId); - if (source != null && source.getAttachedTo().equals(event.getTargetId())) { - Permanent attached = game.getPermanent(source.getAttachedTo()); - if (attached != null) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } - for (Effect e : getEffects()) { - e.setTargetPointer(new FixedTarget(attached.getControllerId())); - } - return true; + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent source = game.getPermanent(this.sourceId); + if (source != null && source.getAttachedTo().equals(event.getTargetId())) { + Permanent attached = game.getPermanent(source.getAttachedTo()); + if (attached != null) { + + for (Effect e : getEffects()) { + e.setTargetPointer(new FixedTarget(attached.getControllerId())); } + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java index e91deb95bb9..bd4d6e4b53f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java @@ -27,8 +27,7 @@ */ package mage.sets.riseoftheeldrazi; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -37,17 +36,18 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.choices.ChoiceColor; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * @author jeffwadsworth */ @@ -123,18 +123,21 @@ class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends Trigger return new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent curseOfWizardry = game.getPermanent(getSourceId()); if (curseOfWizardry != null) { ObjectColor chosenColor = (ObjectColor) game.getState().getValue(curseOfWizardry.getId() + "_color"); if (chosenColor != null) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).shares(chosenColor)) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getColor(game).shares(chosenColor)) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } } } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java index c8141e042f8..11b0df213d7 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java @@ -28,11 +28,6 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -44,11 +39,16 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.game.turn.TurnMod; import mage.players.Player; @@ -106,15 +106,15 @@ class EmrakulTheAeonsTornOnCastAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = (Spell) game.getObject(event.getTargetId()); - if (this.getSourceId().equals(spell.getSourceId())) { - return true; - } - } - return false; + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java index 26920211183..9d26571ba2a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java @@ -29,17 +29,23 @@ package mage.sets.riseoftheeldrazi; import java.util.Iterator; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.abilities.keyword.FlyingAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.Effect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; /** @@ -52,7 +58,6 @@ public class GravityWell extends CardImpl { super(ownerId, 185, "Gravity Well", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}"); this.expansionSetCode = "ROE"; - // Whenever a creature with flying attacks, it loses flying until end of turn. this.addAbility(new GravityWellTriggeredAbility()); } @@ -70,82 +75,86 @@ public class GravityWell extends CardImpl { class GravityWellTriggeredAbility extends TriggeredAbilityImpl { public GravityWellTriggeredAbility() { - super(Zone.BATTLEFIELD, new GravityWellEffect()); + super(Zone.BATTLEFIELD, new GravityWellEffect()); } public GravityWellTriggeredAbility(final GravityWellTriggeredAbility ability) { - super(ability); + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) { - Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getSourceId())); - } - return true; + Permanent attacker = game.getPermanent(event.getSourceId()); + if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getSourceId())); } + return true; } return false; } @Override public String getRule() { - return "Whenever a creature with flying attacks, " + super.getRule(); + return "Whenever a creature with flying attacks, " + super.getRule(); } @Override public GravityWellTriggeredAbility copy() { - return new GravityWellTriggeredAbility(this); + return new GravityWellTriggeredAbility(this); } } class GravityWellEffect extends ContinuousEffectImpl { public GravityWellEffect() { - super(Duration.EndOfTurn, Outcome.LoseAbility); - staticText = "it loses flying until end of turn"; + super(Duration.EndOfTurn, Outcome.LoseAbility); + staticText = "it loses flying until end of turn"; } public GravityWellEffect(final GravityWellEffect effect) { - super(effect); + super(effect); } @Override public GravityWellEffect copy() { - return new GravityWellEffect(this); + return new GravityWellEffect(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 permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { switch (layer) { case AbilityAddingRemovingEffects_6: if (sublayer == SubLayer.NA) { - for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { + for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) { Ability entry = i.next(); - if (entry.getId().equals(FlyingAbility.getInstance().getId())) - i.remove(); - } + if (entry.getId().equals(FlyingAbility.getInstance().getId())) { + i.remove(); + } + } } break; } return true; } - return false; + return false; } @Override public boolean apply(Game game, Ability source) { - return false; + return false; } @Override public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; + return layer == Layer.AbilityAddingRemovingEffects_6; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java index 0deac7c55b3..9271b8d212a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java @@ -28,9 +28,7 @@ package mage.sets.riseoftheeldrazi; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; @@ -41,13 +39,15 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.LevelUpAbility; import mage.abilities.keyword.LevelerCardBuilder; import mage.cards.LevelerCard; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.turn.TurnMod; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com, noxx @@ -108,12 +108,14 @@ class LighthouseChronologistAbility extends TriggeredAbilityImpl { return new LighthouseChronologistAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && !game.getActivePlayerId().equals(this.controllerId)) { - return true; - } - return false; + return !game.getActivePlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java index d32ca3ab7c5..e51fb876413 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java @@ -29,17 +29,17 @@ package mage.sets.riseoftheeldrazi; import java.util.List; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -82,12 +82,14 @@ class LightmineFieldTriggeredAbility extends TriggeredAbilityImpl { return new LightmineFieldTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && !game.getCombat().getAttackers().isEmpty()) { - return true; - } - return false; + return !game.getCombat().getAttackers().isEmpty(); } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java index f4a47a2c246..7ed2d119c1d 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java @@ -27,22 +27,21 @@ */ package mage.sets.riseoftheeldrazi; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import java.util.UUID; - /** * * @author North @@ -81,6 +80,11 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == EventType.SACRIFICED_PERMANENT) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java index c609cfaca16..27d3eca54aa 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java @@ -28,25 +28,26 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.Outcome; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; -import mage.cards.CardImpl; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.common.SimpleActivatedAbility; -import mage.constants.Zone; -import mage.constants.Duration; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.target.targetpointer.FixedTarget; import mage.Mana; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; -import mage.players.Player; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +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.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; /** * @@ -80,39 +81,42 @@ public class NirkanaRevenant extends CardImpl { } } - class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl { +class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl { public NirkanaRevenantTriggeredAbility() { - super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); + super(Zone.BATTLEFIELD, new NirkanaRevenantEffect()); } public NirkanaRevenantTriggeredAbility(final NirkanaRevenantTriggeredAbility ability) { - super(ability); + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } - } - return false; + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) { + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + return false; } @Override public NirkanaRevenantTriggeredAbility copy() { - return new NirkanaRevenantTriggeredAbility(this); + return new NirkanaRevenantTriggeredAbility(this); } @Override public String getRule() { - return "Whenever you tap a Swamp for mana, add B to your mana pool (in addition to the mana the land produces)."; + return "Whenever you tap a Swamp for mana, add {B} to your mana pool."; } } @@ -138,8 +142,6 @@ class NirkanaRevenantEffect extends OneShotEffect { @Override public NirkanaRevenantEffect copy() { - return new NirkanaRevenantEffect(this); + return new NirkanaRevenantEffect(this); } } - - diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java index 33e4def384f..cb8fabc54a3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java @@ -28,14 +28,14 @@ package mage.sets.riseoftheeldrazi; 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.TriggeredAbilityImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -87,9 +87,13 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl { return new PawnOfUlamogTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { UUID targetId = event.getTargetId(); MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD); if (card != null && card instanceof Permanent && !(card instanceof PermanentToken)) { @@ -104,7 +108,6 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl { return true; } } - } return false; } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java index 14afa729600..34d9bd0719c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java @@ -28,15 +28,15 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -80,9 +80,14 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl { return new RaidBombardmentTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getActivePlayerId().equals(this.controllerId) ) { Permanent attacker = game.getPermanent(event.getSourceId()); if (attacker != null) { if (attacker.getPower().getValue() <= 2) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java index 30d39552110..cf2796dfc5a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java @@ -28,14 +28,14 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -86,10 +86,14 @@ class RapaciousOneTriggeredAbility extends TriggeredAbilityImpl { return new RapaciousOneTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { this.getEffects().clear(); this.addEffect(new CreateTokenEffect(new EldraziSpawnToken(), event.getAmount())); return true; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java index 2f3f445d5f6..2f8202380d3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java @@ -28,19 +28,20 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; 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.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.util.functions.EmptyApplyToPermanent; @@ -89,9 +90,14 @@ class RenegadeDoppelgangerTriggeredAbility extends TriggeredAbilityImpl { return new RenegadeDoppelgangerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && !event.getTargetId().equals(this.getSourceId())) { + if (!event.getTargetId().equals(this.getSourceId())) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) { for (Effect effect : this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java index 0d3da8ef6b8..cbf82ffea26 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java @@ -96,15 +96,15 @@ class UlamogTheInfiniteGyreDestroyOnCastAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.SPELL_CAST ) { - Spell spell = (Spell)game.getObject(event.getTargetId()); - if ( this.getSourceId().equals(spell.getSourceId())) { - return true; - } - } - return false; + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java index 9c7ba35b6b1..307633b212a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java @@ -29,15 +29,15 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.WatcherScope; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.WatcherScope; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -88,9 +88,14 @@ class VengevineAbility extends TriggeredAbilityImpl { return new VengevineAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) { + if (event.getPlayerId().equals(controllerId)) { Watcher watcher = game.getState().getWatchers().get("CreatureCast", controllerId); if (watcher != null && watcher.conditionMet()) { return true; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java index 4e1640d7dc7..a2f39bf1f69 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java @@ -27,25 +27,25 @@ */ package mage.sets.riseoftheeldrazi; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.Set; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ReboundAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TurnPhase; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.watchers.Watcher; import mage.watchers.common.AttackedThisTurnWatcher; -import java.util.Set; -import java.util.UUID; - /** * @author magenoxx_at_gmail.com */ @@ -124,6 +124,11 @@ class UntapDelayedTriggeredAbility extends DelayedTriggeredAbility { return new UntapDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java index 0d469c9204b..10d84c5d417 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java @@ -28,21 +28,16 @@ package mage.sets.saviorsofkamigawa; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; -import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -85,10 +80,15 @@ class EbonyOwlNetsukeTriggeredAbility extends TriggeredAbilityImpl { public EbonyOwlNetsukeTriggeredAbility copy() { return new EbonyOwlNetsukeTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Player player = game.getPlayer(event.getPlayerId()); if (player != null) { for (Effect effect: getEffects() ) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java index a5bccc17851..51e2714c222 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.Token; import mage.target.targetpointer.FixedTarget; import mage.watchers.common.CastSpellLastTurnWatcher; @@ -96,15 +97,15 @@ class ErayoSoratamiAscendantTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); - if (watcher != null && watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() == 4) { - return true; - } - } - return false; + CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); + return watcher != null && watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() == 4; } @Override @@ -141,18 +142,21 @@ class ErayosEssenceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { - CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); - if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 1) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; - } - } + if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) { + CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher"); + if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 1) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + } + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java index fc8d11bbb3a..bb7d72fb0ae 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java @@ -50,6 +50,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -109,18 +110,20 @@ class KiyomaroFirstToStandDealsDamageTriggeredAbility extends TriggeredAbilityIm return new KiyomaroFirstToStandDealsDamageTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) - || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) { - if (event.getSourceId().equals(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setValue("damage", event.getAmount()); - } - return true; + if (event.getSourceId().equals(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java index 02c7ded7a0f..7a1ccdf9675 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java @@ -43,6 +43,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.StackObject; import mage.target.targetpointer.FixedTarget; @@ -84,10 +85,14 @@ class PureIntentionsAllTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) && - game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && + if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && StackObject.class.isInstance(game.getObject(event.getSourceId()))) { Card card = game.getCard(event.getTargetId()); if (card != null && card.getOwnerId().equals(getControllerId())) { @@ -128,15 +133,16 @@ class PureIntentionsTriggeredAbility extends TriggeredAbilityImpl { return new PureIntentionsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) && - game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && + return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) && StackObject.class.isInstance(game.getObject(event.getSourceId())) && - event.getTargetId().equals(getSourceId())) { - return true; - } - return false; + event.getTargetId().equals(getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java index 703dc889763..ffc6aa8980b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java @@ -29,15 +29,15 @@ package mage.sets.scarsofmirrodin; import java.util.List; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; @@ -87,12 +87,14 @@ class CopperhornScoutTriggeredAbility extends TriggeredAbilityImpl { return new CopperhornScoutTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { - return true; - } - return false; + return event.getSourceId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java index c68c61942b4..16abfb1ebac 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java @@ -28,15 +28,15 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -80,9 +80,14 @@ class DissipationFieldAbility extends TriggeredAbilityImpl { return new DissipationFieldAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.controllerId)) { + if (event.getTargetId().equals(this.controllerId)) { Permanent permanent = game.getPermanent(event.getSourceId()); if (permanent != null) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java index 99aed7807b2..523bbbc51c7 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java @@ -28,10 +28,6 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -39,6 +35,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -83,13 +83,14 @@ class BlocksCreatureWithFlyingTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId()) - && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId())) { - return true; - } - return false; + return event.getSourceId().equals(this.getSourceId()) && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId()); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java index 85b12616967..8fbe362f197 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java @@ -28,16 +28,17 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreatureOrPlayer; /** @@ -80,12 +81,14 @@ class FurnaceCelebrationAbility extends TriggeredAbilityImpl { return new FurnaceCelebrationAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SACRIFICED_PERMANENT; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java index 2a64e091632..0f12cba5cd3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java @@ -29,14 +29,15 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -77,15 +78,15 @@ class GolemsHeartAbility extends TriggeredAbilityImpl { return new GolemsHeartAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.CAST_SPELL; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getCardType().contains(CardType.ARTIFACT)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getCardType().contains(CardType.ARTIFACT); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java index 61fe030a29d..d3c3290bba2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java @@ -28,18 +28,19 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.keyword.EquipAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -80,15 +81,18 @@ class EquippedBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.CREATURE_BLOCKED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED) { - Permanent equipment = game.getPermanent(sourceId); - if (equipment != null && equipment.getAttachedTo() != null) { - Permanent equipped = game.getPermanent(equipment.getAttachedTo()); - if (equipped.getId().equals(event.getTargetId())) { - return true; - } + Permanent equipment = game.getPermanent(sourceId); + if (equipment != null && equipment.getAttachedTo() != null) { + Permanent equipped = game.getPermanent(equipment.getAttachedTo()); + if (equipped.getId().equals(event.getTargetId())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java index 02128386942..c9c727992b0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java @@ -28,6 +28,7 @@ package mage.sets.scarsofmirrodin; +import java.util.UUID; import mage.MageInt; import mage.Mana; import mage.abilities.Ability; @@ -45,7 +46,14 @@ import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -57,8 +65,6 @@ import mage.game.permanent.token.Token; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetLandPermanent; -import java.util.UUID; - /** * * @author Loki, North @@ -121,7 +127,7 @@ class KothOfTheHammerToken extends Token { class KothOfTheHammerEmblem extends Emblem { // "Mountains you control have '{T}: This land deals 1 damage to target creature or player.'" public KothOfTheHammerEmblem() { - this.setName("EMBLEM: Kothe of the Hammer"); + this.setName("EMBLEM: Koth of the Hammer"); this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new KothOfTheHammerThirdEffect())); } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java index 13089d5f07d..40c1c6d4096 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java @@ -30,14 +30,6 @@ package mage.sets.scarsofmirrodin; import java.util.Iterator; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.SubLayer; -import mage.constants.Zone; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; @@ -46,11 +38,19 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.Target; @@ -100,16 +100,16 @@ class LiegeOfTheTangleTriggeredAbility extends TriggeredAbilityImpl { return new LiegeOfTheTangleTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getId().equals(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && p.getId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java index 2dea0d04459..1da3f6b9b53 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java @@ -28,11 +28,6 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -41,6 +36,11 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -90,9 +90,14 @@ class LivewireLashAbility extends TriggeredAbilityImpl { return new LivewireLashAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(sourceId)) { + if (event.getTargetId().equals(sourceId)) { if (game.getObject(event.getSourceId()) instanceof Spell) { return true; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java index 53df62a3c52..b194cda67d5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java @@ -27,8 +27,7 @@ */ package mage.sets.scarsofmirrodin; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.TriggeredAbilityImpl; @@ -41,20 +40,21 @@ import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.Card; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.game.permanent.token.EmptyToken; +import mage.players.Player; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; -import java.util.UUID; -import mage.players.Player; - /** * @author nantuko */ @@ -98,31 +98,33 @@ class MimicVatTriggeredAbility extends TriggeredAbilityImpl { return new MimicVatTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - - // make sure card is on battlefield - UUID sourceCardId = getSourceId(); - if (game.getPermanent(sourceCardId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceCardId, Zone.BATTLEFIELD) == null) { - return false; - } + // make sure card is on battlefield + UUID sourceCardId = getSourceId(); + if (game.getPermanent(sourceCardId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceCardId, Zone.BATTLEFIELD) == null) { + return false; } + } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); - if (permanent != null && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - !(permanent instanceof PermanentToken) && - permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + !(permanent instanceof PermanentToken) && + permanent.getCardType().contains(CardType.CREATURE)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java index c858186ec10..1f62917e78d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java @@ -28,16 +28,15 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -81,17 +80,17 @@ class MolderBeastTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getFromZone() == Zone.BATTLEFIELD - && zEvent.getToZone() == Zone.GRAVEYARD - && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) { - return true; - } - } - return false; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.getFromZone() == Zone.BATTLEFIELD + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java index 05767199d28..c364a6028ae 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java @@ -46,6 +46,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreatureOrPlayer; @@ -99,9 +100,14 @@ class MoltenTailMasticoreAbility extends TriggeredAbilityImpl { return new MoltenTailMasticoreAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId); + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java index b4b6ef5f52f..060d2c19887 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java @@ -27,7 +27,7 @@ */ package mage.sets.scarsofmirrodin; -import mage.constants.*; +import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -43,16 +43,21 @@ import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.IntimidateAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.game.permanent.PermanentToken; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author nantuko @@ -101,32 +106,34 @@ class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl { return new NimDeathmantleTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - - // make sure card is on battlefield - UUID sourceId = getSourceId(); - if (game.getPermanent(sourceId) == null) { - // or it is being removed - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { - return false; - } + // make sure card is on battlefield + UUID sourceId = getSourceId(); + if (game.getPermanent(sourceId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { + return false; } + } - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - Permanent permanent = zEvent.getTarget(); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); - if (permanent != null && - permanent.getControllerId().equals(this.controllerId) && - zEvent.getToZone() == Zone.GRAVEYARD && - zEvent.getFromZone() == Zone.BATTLEFIELD && - !(permanent instanceof PermanentToken) && - permanent.getCardType().contains(CardType.CREATURE)) { + if (permanent != null + && permanent.getControllerId().equals(this.controllerId) + && zEvent.getToZone() == Zone.GRAVEYARD + && zEvent.getFromZone() == Zone.BATTLEFIELD + && !(permanent instanceof PermanentToken) + && permanent.getCardType().contains(CardType.CREATURE)) { - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - return true; - } + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java index 82e3be572b5..13f7a9967b5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java @@ -28,11 +28,6 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -40,12 +35,18 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -141,12 +142,14 @@ class OgreGeargrabberDelayedTriggeredAbility extends DelayedTriggeredAbility { this.equipmentId = ability.equipmentId; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_CONTROL; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId)) { - return true; - } - return false; + return event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId); } @Override public OgreGeargrabberDelayedTriggeredAbility copy() { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java index 0332d1c5eea..56486ccc836 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java @@ -27,26 +27,26 @@ */ package mage.sets.scarsofmirrodin; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.game.stack.Spell; -import mage.target.Target; - -import java.util.UUID; -import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect; import mage.filter.FilterInPlay; import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.game.permanent.token.GolemToken; +import mage.game.stack.Spell; +import mage.target.Target; import mage.util.TargetAddress; /** @@ -94,15 +94,15 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { return new PrecursorGolemCopyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (checkSpell(spell, game)) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return checkSpell(spell, game); } private boolean checkSpell(Spell spell, Game game) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java index 5c063b2fcfe..4c96874e071 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java @@ -29,17 +29,16 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.counter.AddCountersControllerEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -93,14 +92,17 @@ class RelicPutrescenceAbility extends TriggeredAbilityImpl { return new RelicPutrescenceAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TAPPED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java index c1a1fcbc87d..e29f9088ea9 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java @@ -28,12 +28,9 @@ package mage.sets.scarsofmirrodin; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.ObjectColor; +import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -45,19 +42,22 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfToken; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; -import mage.abilities.Ability; - /** * * @author Loki @@ -117,17 +117,20 @@ class SwordOfBodyAndMindAbility extends TriggeredAbilityImpl { return new SwordOfBodyAndMindAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java index cb13e9a6900..0b2216e27f9 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java @@ -31,24 +31,23 @@ package mage.sets.scarsofmirrodin; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; - -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.WatcherScope; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; -import java.util.UUID; -import mage.constants.WatcherScope; - /** * @author Loki */ @@ -130,19 +129,21 @@ class TunnelIgnusTriggeredAbility extends TriggeredAbilityImpl { return new TunnelIgnusTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { - TunnelIgnusWatcher watcher = (TunnelIgnusWatcher) game.getState().getWatchers().get("LandPlayedCount", this.controllerId); - if (watcher != null && watcher.counts.get(permanent.getControllerId()) > 1) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); - } - return true; + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.LAND) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) { + TunnelIgnusWatcher watcher = (TunnelIgnusWatcher) game.getState().getWatchers().get("LandPlayedCount", this.controllerId); + if (watcher != null && watcher.counts.get(permanent.getControllerId()) > 1) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(permanent.getControllerId())); } - return false; + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java index f9103782c4c..2182a3dd8a6 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java @@ -30,11 +30,6 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; import mage.MageObject; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.TriggeredAbilityImpl; @@ -48,8 +43,12 @@ import mage.abilities.effects.common.ReturnFromExileEffect; import mage.abilities.effects.common.combat.CantBeBlockedAllEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.FilterSpell; @@ -58,6 +57,7 @@ import mage.filter.predicate.other.OwnerPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -189,9 +189,14 @@ class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl { this.rememberSource = ability.rememberSource; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && filter.match(spell, game)) { if (rememberSource) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java index 5b3de9f46b2..31a8376731a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java @@ -29,18 +29,18 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -83,10 +83,14 @@ class VigilForTheLostTriggeredAbility extends TriggeredAbilityImpl { return new VigilForTheLostTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && - ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD && + if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) { Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (p.getControllerId().equals(this.getControllerId()) && p.getCardType().contains(CardType.CREATURE)) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java index 8df89f9a4b9..2ba1d92343f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java @@ -29,16 +29,16 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.players.Player; @@ -81,9 +81,14 @@ class ViridianRevelTriggeredAbility extends TriggeredAbilityImpl { return new ViridianRevelTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent)event).isDiesEvent()) { Card card = game.getCard(event.getTargetId()); Player controller = game.getPlayer(getControllerId()); if (controller != null && card != null && card.getCardType().contains(CardType.ARTIFACT) diff --git a/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java b/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java index 8eefa287fe1..0ecc20afea8 100644 --- a/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java +++ b/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java @@ -28,7 +28,6 @@ package mage.sets.scourge; import java.util.UUID; - import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; @@ -38,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -83,16 +83,19 @@ class PyrostaticPillarTriggeredAbility extends TriggeredAbilityImpl { return new PyrostaticPillarTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.SPELL_CAST){ - Spell spell = game.getStack().getSpell(event.getTargetId()); - if(spell != null && spell.getConvertedManaCost() <= 3){ - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getConvertedManaCost() <= 3){ + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java b/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java index c411bb82f41..efa1e86873c 100644 --- a/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java +++ b/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -91,9 +92,14 @@ class XantidSwarmTriggeredAbility extends TriggeredAbilityImpl { return new XantidSwarmTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); return true; diff --git a/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java b/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java index ffd7cc6f5d0..ea9bcd7ade4 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java +++ b/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java @@ -38,6 +38,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -78,19 +79,22 @@ class AEtherFlashTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (filter.match(permanent, getSourceId(), getControllerId(), game)) { - if (getTargets().size() == 0) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(targetId)); - } + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (filter.match(permanent, getSourceId(), getControllerId(), game)) { + if (getTargets().size() == 0) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(targetId)); } - return true; } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java index f3c2fa96bf6..14f568597d3 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java +++ b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java @@ -38,6 +38,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.turn.TurnMod; import mage.players.Player; @@ -117,14 +118,14 @@ class FinalFortuneLoseDelayedTriggeredAbility extends DelayedTriggeredAbility { return new FinalFortuneLoseDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { - if (connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId())) { - return true; - } - } - return false; + return connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId()); } public void setConnectedTurnMod(UUID connectedTurnMod) { diff --git a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java index d2bd4b22835..b55edf8374b 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java +++ b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.TurnPhase; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.watchers.Watcher; @@ -160,6 +161,12 @@ class RelentlessAssaultDelayedAddMainPhaseAbility extends DelayedTriggeredAbilit return new RelentlessAssaultDelayedAddMainPhaseAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PHASE_CHANGED + || event.getType() == EventType.COMBAT_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) { diff --git a/Mage.Sets/src/mage/sets/seventhedition/Rowen.java b/Mage.Sets/src/mage/sets/seventhedition/Rowen.java index 0fb92631fdb..92ffd483ee6 100644 --- a/Mage.Sets/src/mage/sets/seventhedition/Rowen.java +++ b/Mage.Sets/src/mage/sets/seventhedition/Rowen.java @@ -39,6 +39,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -84,9 +85,14 @@ class RowenAbility extends TriggeredAbilityImpl { return new RowenAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId().equals(this.getControllerId())) { + if (event.getPlayerId().equals(this.getControllerId())) { if (game.getActivePlayerId().equals(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) { Card card = game.getCard(event.getTargetId()); Player controller = game.getPlayer(this.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java b/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java index 5ba1bd8ef54..072db5ea809 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java @@ -107,9 +107,14 @@ class AshenmoorLiegeTriggeredAbility extends TriggeredAbilityImpl { return new AshenmoorLiegeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java index 1f2c4b99845..e64a220bb48 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java @@ -44,6 +44,7 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -94,12 +95,14 @@ class DemigodOfRevengeTriggeredAbility extends TriggeredAbilityImpl { return new DemigodOfRevengeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.SPELL_CAST) && event.getSourceId().equals(this.getSourceId())) { - return true; - } - return false; + return event.getSourceId().equals(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java index 0357616ac7f..43423eb386c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java @@ -37,6 +37,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.ElfToken; @@ -81,10 +82,14 @@ class FlourishingDefensesTriggeredAbility extends TriggeredAbilityImpl { return new FlourishingDefensesTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTER_ADDED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.COUNTER_ADDED - && event.getData().equals(CounterType.M1M1.getName())) { + if (event.getData().equals(CounterType.M1M1.getName())) { Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); if (permanent.getCardType().contains(CardType.CREATURE)) { return true; diff --git a/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java b/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java index 81864e22c2d..a94d495c56d 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java @@ -45,6 +45,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -124,9 +125,14 @@ class HollowbornBarghestTriggeredAbility extends TriggeredAbilityImpl { return new HollowbornBarghestTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Player opponent = game.getPlayer(event.getPlayerId()); if (opponent != null && opponent.getHand().size() == 0) { opponent.loseLife(2, game); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java b/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java index 2f1ec921331..d1f35cab7e8 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java @@ -38,6 +38,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -81,19 +82,22 @@ class RakingCanopyTriggeredAbility extends TriggeredAbilityImpl { return new RakingCanopyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - Permanent attacker = game.getPermanent(event.getSourceId()); - if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) { - return false; - } - if (event.getTargetId().equals(this.getControllerId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(attacker.getId())); - } - return true; + Permanent attacker = game.getPermanent(event.getSourceId()); + if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) { + return false; + } + if (event.getTargetId().equals(this.getControllerId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(attacker.getId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java b/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java index 0900ed73daa..d4167644912 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java @@ -28,9 +28,6 @@ package mage.sets.shadowmoor; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.BeginningOfDrawTriggeredAbility; @@ -38,10 +35,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DrawCardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -83,9 +83,14 @@ class SpitefulVisionsTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DREW_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId() != null) { + if (event.getPlayerId() != null) { for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java b/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java index 7528a7e2917..fc2dcde3187 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java @@ -45,6 +45,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -127,10 +128,14 @@ class TowerAboveTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED - && event.getSourceId().equals(this.getSourceId())) { + if (event.getSourceId().equals(this.getSourceId())) { this.getTargets().clear(); TargetCreaturePermanent target = new TargetCreaturePermanent(); this.addTarget(target); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java b/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java index fb9757e95e2..ee4e35dfd6d 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java @@ -28,13 +28,13 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.ExaltedAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -82,9 +82,14 @@ class AngelicBenedictionTriggeredAbility extends TriggeredAbilityImpl { return new AngelicBenedictionTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId)) { + if (game.getActivePlayerId().equals(this.controllerId)) { if (game.getCombat().attacksAlone()) { return true; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java index ac3646c87cf..ac0a0ca696c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java @@ -96,9 +96,14 @@ class BattlegraceAngelAbility extends TriggeredAbilityImpl { return new BattlegraceAngelAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getActivePlayerId().equals(this.controllerId) ) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java index 93c64d92bb1..a025c8c109b 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java @@ -28,15 +28,15 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -88,9 +88,14 @@ class CradleOfVitalityGainLifeTriggeredAbility extends TriggeredAbilityImpl { return new CradleOfVitalityGainLifeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) { + if (event.getPlayerId().equals(this.controllerId)) { this.getEffects().get(0).setValue("amount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java b/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java index 9029908afa2..6f11a6e1fa3 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java @@ -28,19 +28,20 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -95,6 +96,11 @@ class DrumHunterTriggeredAbility extends TriggeredAbilityImpl { return new DrumHunterTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java b/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java index 71f96db6773..c1fa5e7a721 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java @@ -28,19 +28,20 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.TargetPlayer; /** @@ -97,12 +98,14 @@ class ExuberantFirestokerTriggeredAbility extends TriggeredAbilityImpl { return new ExuberantFirestokerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java b/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java index d7615f200e1..56944a32e1c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java @@ -28,18 +28,18 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.InfoEffect; 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; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -85,17 +85,20 @@ class ManaplasmAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(controllerId)) { - this.getEffects().remove(0); - int x = spell.getConvertedManaCost(); - this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn)); - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getControllerId().equals(controllerId)) { + this.getEffects().remove(0); + int x = spell.getConvertedManaCost(); + this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn)); + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java b/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java index 14f2cd93a5a..5bb12e51f6b 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java @@ -28,15 +28,15 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -78,14 +78,17 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java index e340be7c793..d409f300f14 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java @@ -28,23 +28,23 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -88,19 +88,22 @@ class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (filter.match(permanent, getSourceId(), getControllerId(), game)) { - if (getTargets().size() == 0) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(targetId)); - } + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (filter.match(permanent, getSourceId(), getControllerId(), game)) { + if (getTargets().size() == 0) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(targetId)); } - return true; } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java b/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java index 581a1106ec0..80f01f08aa5 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java @@ -28,10 +28,6 @@ package mage.sets.shardsofalara; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -40,9 +36,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -91,19 +91,22 @@ class PrinceOfThrallsTriggeredAbility extends TriggeredAbilityImpl { return new PrinceOfThrallsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { - ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - if (zEvent.getToZone() == Zone.GRAVEYARD) { - if (zEvent.getFromZone() == Zone.BATTLEFIELD) { - Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (game.getOpponents(this.getControllerId()).contains(permanent.getControllerId())) { - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getToZone() == Zone.GRAVEYARD) { + if (zEvent.getFromZone() == Zone.BATTLEFIELD) { + Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (game.getOpponents(this.getControllerId()).contains(permanent.getControllerId())) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } } } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java b/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java index c9f169b29f6..971e1eee26e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java @@ -28,11 +28,6 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -43,9 +38,15 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -94,17 +95,20 @@ class QuietusSpikeTriggeredAbility extends TriggeredAbilityImpl { return new QuietusSpikeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java index 9fd2d5a7039..feb186fc1f5 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java @@ -95,9 +95,14 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl { return new RafiqOfTheManyAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_ATTACKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) { + if (game.getActivePlayerId().equals(this.controllerId) ) { if (game.getCombat().attacksAlone()) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0))); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java index aa1d7aa00d2..f9000f459ea 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java @@ -28,11 +28,6 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -44,6 +39,11 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.RegenerateSourceEffect; 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.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -123,15 +123,18 @@ class SkeletonizeDelayedTriggeredAbility extends DelayedTriggeredAbility { return new SkeletonizeDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.ZONE_CHANGE)) { - ZoneChangeEvent zce = (ZoneChangeEvent) event; - if (zce.isDiesEvent()) { - DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", this.getSourceId()); - if (watcher != null) { - return watcher.wasDamaged(zce.getTarget(), game); - } + ZoneChangeEvent zce = (ZoneChangeEvent) event; + if (zce.isDiesEvent()) { + DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", this.getSourceId()); + if (watcher != null) { + return watcher.wasDamaged(zce.getTarget(), game); } } return false; diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java b/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java index 096f447de3c..48981e3b3e1 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java @@ -28,19 +28,20 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -95,12 +96,14 @@ class SunseedNurturerTriggeredAbility extends TriggeredAbilityImpl { return new SunseedNurturerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java b/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java index 1183e47a5f0..b210f4313cf 100644 --- a/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java +++ b/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java @@ -36,6 +36,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -77,13 +78,15 @@ class HornOfGreedAbility extends TriggeredAbilityImpl { return new HornOfGreedAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LAND_PLAYED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LAND_PLAYED) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java b/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java index 0e9c8f527c2..2d4aec7bcc8 100644 --- a/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java +++ b/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -94,18 +95,21 @@ class OvergrowthTriggeredAbility extends TriggeredManaAbility { return new OvergrowthTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ - if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { - Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); - if (enchanted != null) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchanted.getControllerId())); - return true; - } + if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { + Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); + if (enchanted != null) { + getEffects().get(0).setTargetPointer(new FixedTarget(enchanted.getControllerId())); + return true; } - } + } return false; } diff --git a/Mage.Sets/src/mage/sets/stronghold/SacredGround.java b/Mage.Sets/src/mage/sets/stronghold/SacredGround.java index d10fc0980db..6b14762daee 100644 --- a/Mage.Sets/src/mage/sets/stronghold/SacredGround.java +++ b/Mage.Sets/src/mage/sets/stronghold/SacredGround.java @@ -28,8 +28,6 @@ package mage.sets.stronghold; import java.util.UUID; - -import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect; import mage.cards.CardImpl; @@ -38,9 +36,9 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -import mage.game.stack.StackObject; import mage.target.targetpointer.FixedTarget; /** @@ -83,10 +81,14 @@ class SacredGroundTriggeredAbility extends TriggeredAbilityImpl { return new SacredGroundTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) && - game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) { + if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) { ZoneChangeEvent zce = (ZoneChangeEvent) event; if (Zone.BATTLEFIELD.equals(zce.getFromZone()) && Zone.GRAVEYARD.equals(zce.getToZone())) { Permanent targetPermanent = zce.getTarget(); diff --git a/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java b/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java index 0c4f7ab0647..fe9b995e0d0 100644 --- a/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java +++ b/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java @@ -41,6 +41,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; /** @@ -88,10 +89,14 @@ class WallOfEssenceTriggeredAbility extends TriggeredAbilityImpl { return new WallOfEssenceTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId) - && ((DamagedCreatureEvent)event).isCombatDamage() ) { + if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage() ) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java b/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java index eedb00ce94d..31c7159c47f 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java @@ -36,7 +36,6 @@ import mage.abilities.common.SkipUntapOptionalAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.cards.CardImpl; @@ -48,6 +47,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInGraveyard; import mage.target.targetpointer.FixedTarget; @@ -130,6 +130,12 @@ class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LOST_CONTROL + || event.getType() == EventType.UNTAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { diff --git a/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java b/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java index 1cbf2dcdd8e..95ff8787b10 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java @@ -37,6 +37,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; import mage.target.targetpointer.FixedTarget; @@ -81,16 +82,19 @@ class SpellshockTriggeredAbility extends TriggeredAbilityImpl { return new SpellshockTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.SPELL_CAST){ - Spell spell = game.getStack().getSpell(event.getTargetId()); - if(spell != null){ - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } - return true; + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null){ + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java b/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java index 903774db9c5..84c284b0f12 100644 --- a/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java +++ b/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java @@ -41,6 +41,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -91,10 +92,14 @@ class WallOfSoulsTriggeredAbility extends TriggeredAbilityImpl { return new WallOfSoulsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId) - && ((DamagedCreatureEvent)event).isCombatDamage() ) { + if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage()) { this.getEffects().get(0).setValue("damage", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java index 2d01c26e37f..c518a21d95d 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java @@ -29,12 +29,12 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -78,15 +78,15 @@ class AngelsFeatherAbility extends TriggeredAbilityImpl { return new AngelsFeatherAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isWhite()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isWhite(); } @Override diff --git a/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java b/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java index 81e51ec0539..147a190ad41 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java +++ b/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java @@ -29,12 +29,12 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -78,15 +78,15 @@ class KrakensEyeAbility extends TriggeredAbilityImpl { return new KrakensEyeAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isBlue()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isBlue(); } @Override diff --git a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java index 171234edc7c..0f7b676328e 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java +++ b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java @@ -29,15 +29,15 @@ package mage.sets.tenthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetOpponent; /** @@ -65,6 +65,7 @@ public class Megrim extends CardImpl { } class MergimTriggeredAbility extends TriggeredAbilityImpl { + MergimTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(2)); this.addTarget(new TargetOpponent()); @@ -79,9 +80,14 @@ class MergimTriggeredAbility extends TriggeredAbilityImpl { return new MergimTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { + if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { this.getTargets().get(0).add(event.getPlayerId(), game); return true; } diff --git a/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java b/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java index 31b2ff02519..b60b2957449 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java +++ b/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java @@ -29,12 +29,12 @@ package mage.sets.tenthedition; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -78,15 +78,15 @@ class WurmsToothAbility extends TriggeredAbilityImpl { return new WurmsToothAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isGreen()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isGreen(); } @Override diff --git a/Mage.Sets/src/mage/sets/thedark/Venom.java b/Mage.Sets/src/mage/sets/thedark/Venom.java index 385cbe0be98..42eb58e7165 100644 --- a/Mage.Sets/src/mage/sets/thedark/Venom.java +++ b/Mage.Sets/src/mage/sets/thedark/Venom.java @@ -28,10 +28,6 @@ package mage.sets.thedark; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; @@ -40,8 +36,13 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -57,7 +58,6 @@ public class Venom extends CardImpl { this.expansionSetCode = "DRK"; this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -94,28 +94,31 @@ class VenomTriggeredAbility extends TriggeredAbilityImpl { return new VenomTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent blocker = game.getPermanent(event.getSourceId()); - Permanent blocked = game.getPermanent(event.getTargetId()); - Permanent enchantment = game.getPermanent(this.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo()); - if (enchantedCreature != null) { - if (blocker != null && blocker != enchantedCreature - && !blocker.getSubtype().contains("Wall") - && blocked == enchantedCreature) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); - return true; - } - if (blocker != null && blocker == enchantedCreature - && !blocked.getSubtype().contains("Wall")) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); - return true; - } - } - } + Permanent blocker = game.getPermanent(event.getSourceId()); + Permanent blocked = game.getPermanent(event.getTargetId()); + Permanent enchantment = game.getPermanent(this.getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo()); + if (enchantedCreature != null) { + if (blocker != null && blocker != enchantedCreature + && !blocker.getSubtype().contains("Wall") + && blocked == enchantedCreature) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId())); + return true; + } + if (blocker != null && blocker == enchantedCreature + && !blocked.getSubtype().contains("Wall")) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId())); + return true; + } + } } return false; } diff --git a/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java b/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java index ceed96023e6..71e9cff04bb 100644 --- a/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java +++ b/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java @@ -30,7 +30,6 @@ package mage.sets.theros; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; @@ -44,6 +43,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -91,14 +91,17 @@ class BidentOfThassaTriggeredAbility extends TriggeredAbilityImpl { return new BidentOfThassaTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { - if (((DamagedPlayerEvent) event).isCombatDamage()) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.getControllerId().equals(controllerId)) { - return true; - } + if (((DamagedPlayerEvent) event).isCombatDamage()) { + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && creature.getControllerId().equals(controllerId)) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java b/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java index 519b16ce3d6..0490ccd43a1 100644 --- a/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java +++ b/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java @@ -86,12 +86,14 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl { return new ScryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SCRY; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(EventType.SCRY) && event.getPlayerId().equals(this.getControllerId())) { - return true; - } - return false; + return event.getPlayerId().equals(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java index 013fa387eed..6878692be27 100644 --- a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java +++ b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java @@ -27,6 +27,7 @@ */ package mage.sets.theros; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.Mode; @@ -37,11 +38,16 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileSpellEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; @@ -49,8 +55,6 @@ import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * Once you announce you’re casting Rescue from the Underworld, no player may attempt to @@ -187,9 +191,14 @@ class RescueFromTheUnderworldDelayedTriggeredAbility extends DelayedTriggeredAbi super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId); + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java b/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java index 6b92d1cc051..f3a2973349f 100644 --- a/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java +++ b/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java @@ -40,7 +40,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.DamagedPlayerEvent; +import mage.game.events.DamagedEvent; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -92,9 +92,14 @@ class ThassasEmissaryTriggeredAbility extends TriggeredAbilityImpl { return new ThassasEmissaryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (((DamagedEvent) event).isCombatDamage()) { if (event.getSourceId().equals(this.sourceId)) { return true; } diff --git a/Mage.Sets/src/mage/sets/theros/TimeToFeed.java b/Mage.Sets/src/mage/sets/theros/TimeToFeed.java index 8af58c918db..4fdc3304cb5 100644 --- a/Mage.Sets/src/mage/sets/theros/TimeToFeed.java +++ b/Mage.Sets/src/mage/sets/theros/TimeToFeed.java @@ -47,6 +47,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.Target; @@ -149,9 +150,14 @@ class TimeToFeedDiesTriggeredAbility extends DelayedTriggeredAbility { return new TimeToFeedDiesTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { if (event.getTargetId().equals(watchedCreatureId)) { Permanent creature = (Permanent) game.getLastKnownInformation(watchedCreatureId, Zone.BATTLEFIELD); if (creature.getZoneChangeCounter(game) == this.zoneChangeCounter) { diff --git a/Mage.Sets/src/mage/sets/theros/TritonTactics.java b/Mage.Sets/src/mage/sets/theros/TritonTactics.java index 4abfcddef92..f58b2966609 100644 --- a/Mage.Sets/src/mage/sets/theros/TritonTactics.java +++ b/Mage.Sets/src/mage/sets/theros/TritonTactics.java @@ -49,6 +49,7 @@ import mage.constants.WatcherScope; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.target.targetpointer.FixedTarget; @@ -145,9 +146,14 @@ class TritonTacticsTriggeredAbility extends DelayedTriggeredAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_COMBAT_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java index 3bccc6bf0f8..3afdd8d5ce6 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java +++ b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -88,18 +89,20 @@ class DealsDamageAllTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE - || event.getType() == GameEvent.EventType.DAMAGED_PLAYER - || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null && creature.hasSubtype("Sliver")) { - for (Effect effect : this.getEffects()) { - effect.setValue("damage", event.getAmount()); - } - return true; - } + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE + || event.getType() == EventType.DAMAGED_PLAYER + || event.getType() == EventType.DAMAGED_PLANESWALKER; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null && creature.hasSubtype("Sliver")) { + for (Effect effect : this.getEffects()) { + effect.setValue("damage", event.getAmount()); + } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java index c59d4e01187..e9f1a93b72f 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java +++ b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java @@ -52,6 +52,7 @@ import mage.constants.Zone; import mage.game.ExileZone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetOpponent; @@ -194,9 +195,14 @@ class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility { return new GrinningTotemDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getActivePlayerId().equals(this.getControllerId()); + return game.getActivePlayerId().equals(this.getControllerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java index 282bb67dd00..a95ba8ee2da 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java +++ b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java @@ -28,17 +28,17 @@ package mage.sets.timeshifted; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.SwampwalkAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -87,20 +87,19 @@ class SolkanarTheSwampKingAbility extends TriggeredAbilityImpl { return new SolkanarTheSwampKingAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isBlack()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isBlack(); } @Override public String getRule() { return "Whenever a player casts a black spell, you gain 1 life."; } - } diff --git a/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java index 9cbcd3812c5..1d87783773b 100644 --- a/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java +++ b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java @@ -53,6 +53,7 @@ import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ManaEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -145,41 +146,44 @@ class TapForManaAllTriggeredAbility extends TriggeredManaAbility { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { - Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); - if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { - ManaEvent mEvent = (ManaEvent) event; - ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color"); - if (color != null) { - Mana mana = mEvent.getMana(); - boolean colorFits = false; - if (color.isBlack() && mana.getBlack() > 0) { - colorFits = true; - } else if (color.isBlue() && mana.getBlue() > 0) { - colorFits = true; - } else if (color.isGreen() && mana.getGreen() > 0) { - colorFits = true; - } else if (color.isWhite() && mana.getWhite() > 0) { - colorFits = true; - } else if (color.isRed() && mana.getRed() > 0) { - colorFits = true; - } - if (colorFits) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } - for (Effect effect : getEffects()) { - effect.setValue("mana", mEvent.getMana()); - } - switch (setTargetPointer) { - case PERMANENT: - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); - break; - case PLAYER: - getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); - break; - } - return true; + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) { + ManaEvent mEvent = (ManaEvent) event; + ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color"); + if (color != null) { + Mana mana = mEvent.getMana(); + boolean colorFits = false; + if (color.isBlack() && mana.getBlack() > 0) { + colorFits = true; + } else if (color.isBlue() && mana.getBlue() > 0) { + colorFits = true; + } else if (color.isGreen() && mana.getGreen() > 0) { + colorFits = true; + } else if (color.isWhite() && mana.getWhite() > 0) { + colorFits = true; + } else if (color.isRed() && mana.getRed() > 0) { + colorFits = true; + } + if (colorFits) { + + for (Effect effect : getEffects()) { + effect.setValue("mana", mEvent.getMana()); } + switch (setTargetPointer) { + case PERMANENT: + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + break; + case PLAYER: + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); + break; + } + return true; } } } diff --git a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java index fc878f375c9..b94593b84ca 100644 --- a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java +++ b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java @@ -41,6 +41,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -85,14 +86,15 @@ class NorinTheWaryTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST + || event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - switch(event.getType()) { - case SPELL_CAST: - case ATTACKER_DECLARED: - return true; - } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java index 7893c69d3ce..40c612225b4 100644 --- a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java +++ b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java @@ -40,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.turn.TurnMod; import mage.game.turn.UpkeepStep; @@ -96,18 +97,21 @@ class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl { public ParadoxHazeTriggeredAbility copy() { return new ParadoxHazeTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - Permanent permanent = game.getPermanent(this.sourceId); - if (permanent != null) { - Player player = game.getPlayer(permanent.getAttachedTo()); - if (player != null && game.getActivePlayerId().equals(player.getId()) && lastTriggerTurnNumber != game.getTurnNum()) { - lastTriggerTurnNumber = game.getTurnNum(); - this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); - return true; - } + Permanent permanent = game.getPermanent(this.sourceId); + if (permanent != null) { + Player player = game.getPlayer(permanent.getAttachedTo()); + if (player != null && game.getActivePlayerId().equals(player.getId()) && lastTriggerTurnNumber != game.getTurnNum()) { + lastTriggerTurnNumber = game.getTurnNum(); + this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java b/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java index f1f87c4dca7..ef34134f210 100644 --- a/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java +++ b/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java @@ -44,6 +44,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -130,11 +131,16 @@ class SaffiEriksdotterDelayedTriggeredAbility extends DelayedTriggeredAbility { return new SaffiEriksdotterDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { + if (((ZoneChangeEvent) event).isDiesEvent()) { if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) { - if(this.getControllerId().equals(event.getPlayerId())){ + if (this.getControllerId().equals(event.getPlayerId())){ return true; } } diff --git a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java index aef854c4204..e1495a01e1c 100644 --- a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java +++ b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java @@ -28,10 +28,6 @@ package mage.sets.timespiral; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -42,8 +38,13 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageSelfEffect; import mage.abilities.keyword.IndestructibleAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPlayer; @@ -132,9 +133,14 @@ class StuffyDollTriggeredAbility extends TriggeredAbilityImpl { return new StuffyDollTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(this.sourceId)) { this.getEffects().get(0).setValue("damageAmount", event.getAmount()); return true; } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java b/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java index cd409b970ad..98b093c7212 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java @@ -28,15 +28,16 @@ package mage.sets.urzasdestiny; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -79,10 +80,14 @@ class AetherStingTriggeredAbility extends TriggeredAbilityImpl { return new AetherStingTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST - && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Card card = game.getCard(event.getSourceId()); if (card != null && card.getCardType().contains(CardType.CREATURE)) { this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java index 4e1dc26126c..ad9be7781fd 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java @@ -29,19 +29,20 @@ package mage.sets.urzasdestiny; import java.util.UUID; import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.common.SacrificeEffect; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; import mage.constants.Zone; -import mage.game.events.GameEvent; import mage.filter.FilterPermanent; import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; /** * * @author fireshoes @@ -85,10 +86,15 @@ class PhyrexianNegatorTriggeredAbility extends TriggeredAbilityImpl { public PhyrexianNegatorTriggeredAbility copy() { return new PhyrexianNegatorTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(this.sourceId)) { UUID controller = game.getControllerId(event.getTargetId()); if (controller != null) { Player player = game.getPlayer(controller); diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java b/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java index d94ad90e34e..1edf03ea2da 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java @@ -87,20 +87,23 @@ class RayneAcademyChancellorTriggeredAbility extends TriggeredAbilityImpl { public RayneAcademyChancellorTriggeredAbility copy() { return new RayneAcademyChancellorTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.TARGETED) { - Player controller = game.getPlayer(this.getControllerId()); - Player targetter = game.getPlayer(event.getPlayerId()); - if (controller != null && targetter != null && !controller.getId().equals(targetter.getId())) { - if (event.getTargetId().equals(controller.getId())) { - return true; - } - Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); - if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) { - return true; - } + Player controller = game.getPlayer(this.getControllerId()); + Player targetter = game.getPlayer(event.getPlayerId()); + if (controller != null && targetter != null && !controller.getId().equals(targetter.getId())) { + if (event.getTargetId().equals(controller.getId())) { + return true; + } + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId()); + if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java index 6d284d86f59..7096f318a4d 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java @@ -29,10 +29,6 @@ package mage.sets.urzaslegacy; import java.util.Iterator; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -44,6 +40,9 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; @@ -97,7 +96,7 @@ class MemoryJarEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Cards cards = new CardsImpl(); - //Exil hand + //Exile hand for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { Player player = game.getPlayer(playerId); if (player != null) @@ -197,12 +196,14 @@ class MemoryJarDelayedTriggeredAbility extends DelayedTriggeredAbility { return new MemoryJarDelayedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.END_TURN_STEP_PRE) { - return true; - } - return false; + return true; } diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java b/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java index c65884d1698..d1ecb036de3 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java @@ -28,16 +28,16 @@ package mage.sets.urzaslegacy; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -51,7 +51,6 @@ public class NoMercy extends CardImpl { super(ownerId, 56, "No Mercy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.expansionSetCode = "ULG"; - // Whenever a creature deals damage to you, destroy it. this.addAbility(new NoMercyTriggeredAbility()); } @@ -64,31 +63,33 @@ public class NoMercy extends CardImpl { public NoMercy copy() { return new NoMercy(this); } - + public class NoMercyTriggeredAbility extends TriggeredAbilityImpl { - public NoMercyTriggeredAbility() - { + + public NoMercyTriggeredAbility() { super(Zone.BATTLEFIELD, new DestroyTargetEffect()); } - + public NoMercyTriggeredAbility(final NoMercyTriggeredAbility ability) { super(ability); } - + @Override public NoMercyTriggeredAbility copy() { - return new NoMercyTriggeredAbility(this); + return new NoMercyTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getPlayerId().equals(this.getControllerId())) { - + if (event.getPlayerId().equals(this.getControllerId())) { Permanent permanent = game.getPermanent(event.getSourceId()); - if(permanent != null && permanent.getCardType().contains(CardType.CREATURE)) - { - for(Effect effect : this.getEffects()) - { + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) { + for (Effect effect : this.getEffects()) { effect.setTargetPointer(new FixedTarget(event.getSourceId())); } return true; @@ -96,10 +97,11 @@ public class NoMercy extends CardImpl { } return false; } + @Override public String getRule() { return "Whenever a creature deals damage to you, destroy it"; } - + } } diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java index b0e4770c0c6..4b79443702e 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java @@ -28,18 +28,18 @@ package mage.sets.urzaslegacy; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.common.FilterLandPermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -87,17 +87,19 @@ class RivalryTriggeredAbility extends TriggeredAbilityImpl { return new RivalryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) { - if (getTargets().size() == 0) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); - } + if (getTargets().size() == 0) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } - return true; } - return false; + return true; } @Override diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java b/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java index cc19a3ba8ea..874b130fcc6 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java @@ -28,17 +28,18 @@ package mage.sets.urzaslegacy; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; 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; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; @@ -89,33 +90,27 @@ class ScrapheapTriggeredAbility extends TriggeredAbilityImpl { super(Zone.BATTLEFIELD, new GainLifeEffect(1)); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; - - if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.getOwnerId().equals(this.getControllerId())) { - if (filter.match(permanent, sourceId, controllerId, game)) { return true; } - } } - } return false; } - - @Override public String getRule() { return "Whenever an artifact or enchantment is put into your graveyard from the battlefield, you gain 1 life."; } - - - } diff --git a/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java index 84c1d1371e4..cdf0bf19e0e 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java @@ -28,14 +28,15 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -80,9 +81,14 @@ class BereavementTriggeredAbility extends TriggeredAbilityImpl { return new BereavementTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent)event).isDiesEvent()) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getColor(game).isGreen()) { this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId())); diff --git a/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java b/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java index 8d9e96a1433..7b6794af6d4 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java @@ -45,6 +45,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -77,12 +78,10 @@ public class CarpetOfFlowers extends CardImpl { class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl { - public CarpetOfFlowersTriggeredAbility() { super(Zone.BATTLEFIELD, new CarpetOfFlowersEffect(), true); this.addChoice(new ChoiceColor()); this.addTarget(new TargetOpponent()); - } public CarpetOfFlowersTriggeredAbility(final CarpetOfFlowersTriggeredAbility ability) { @@ -94,11 +93,15 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl { return new CarpetOfFlowersTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PRECOMBAT_MAIN_PHASE_PRE + || event.getType() == EventType.POSTCOMBAT_MAIN_PHASE_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - return (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE - || event.getType() == GameEvent.EventType.POSTCOMBAT_MAIN_PHASE_PRE) - && event.getPlayerId().equals(this.controllerId); + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java b/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java index 7ed0e911167..b4fa8743697 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java @@ -47,6 +47,7 @@ import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; @@ -131,9 +132,14 @@ class DiabolicServitudeCreatureDiesTriggeredAbility extends TriggeredAbilityImpl return new DiabolicServitudeCreatureDiesTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) { + if (((ZoneChangeEvent)event).isDiesEvent()) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; Object object = game.getState().getValue(getSourceId().toString() + "returnedCreature"); if ((object instanceof MageObjectReference) && ((MageObjectReference)object).refersTo(zEvent.getTarget(), game)) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java index d04f5289298..f77cfd2fb80 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java +++ b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java @@ -28,10 +28,8 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.Mana; import mage.abilities.Ability; import mage.abilities.effects.common.AddManaAnyColorAttachedControllerEffect; -import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.abilities.mana.TriggeredManaAbility; @@ -42,6 +40,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -90,9 +89,13 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED_FOR_MANA; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){ Permanent enchantment = game.getPermanent(this.getSourceId()); if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) { Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); @@ -101,7 +104,6 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility { return true; } } - } return false; } diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java index 2c40cec9c20..f4f44011f6f 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java @@ -28,20 +28,21 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterPermanentCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -88,13 +89,15 @@ class GoblinLackeyTriggeredAbility extends TriggeredAbilityImpl { return new GoblinLackeyTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) { - return true; - } - return false; + return event.getSourceId().equals(this.sourceId) + && game.getOpponents(this.getControllerId()).contains(event.getTargetId()); } @Override diff --git a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java index f5fcb1bdd76..3f944b98a29 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java @@ -28,9 +28,6 @@ package mage.sets.urzassaga; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; @@ -40,12 +37,15 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -108,15 +108,18 @@ class SpreadingAlgaeTriggeredAbility extends TriggeredAbilityImpl { return new SpreadingAlgaeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent enchant = game.getPermanent(sourceId); - if (enchant != null && enchant.getAttachedTo() != null) { - if (event.getTargetId().equals(enchant.getAttachedTo())) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); - return true; - } + Permanent enchant = game.getPermanent(sourceId); + if (enchant != null && enchant.getAttachedTo() != null) { + if (event.getTargetId().equals(enchant.getAttachedTo())) { + getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java b/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java index 095bc4a333c..73d17f664ca 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java @@ -28,17 +28,17 @@ package mage.sets.urzassaga; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -83,15 +83,15 @@ class ThranQuarryTriggeredAbility extends TriggeredAbilityImpl { return new ThranQuarryTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) { - FilterCreaturePermanent filter = new FilterCreaturePermanent(); - if (!game.getBattlefield().contains(filter, controllerId, 1, game)) { - return true; - } - } - return false; + FilterCreaturePermanent filter = new FilterCreaturePermanent(); + return !game.getBattlefield().contains(filter, controllerId, 1, game); } @Override diff --git a/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java b/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java index 98192bb6e63..59620af5cea 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java @@ -30,12 +30,12 @@ package mage.sets.urzassaga; import java.util.UUID; import mage.MageInt; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -87,15 +87,15 @@ class TitaniasChosenAbility extends TriggeredAbilityImpl { return new TitaniasChosenAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isGreen()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isGreen(); } @Override diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java index 8c08e541eed..ad1d7340d19 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java @@ -50,6 +50,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -107,10 +108,14 @@ class MarchesaTheBlackRoseTriggeredAbility extends TriggeredAbilityImpl { return new MarchesaTheBlackRoseTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ZONE_CHANGE - && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD + if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD && ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) { Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent != null && diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java index c58c72fd7bd..77362f43213 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java @@ -36,7 +36,6 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.keyword.DethroneAbility; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -70,7 +69,7 @@ public class ScourgeOfTheThrone extends CardImpl { // Dethrone (Whenever this creature attacks the player with the most life or tied for most life, put a +1/+1 counter on it.) this.addAbility(new DethroneAbility()); // Whenever Scourge of the Throne attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, untap all attacking creatures. After this phase, there is an additional combat phase. - Ability ability = new ScourgeOfTheThroneAttacksTriggeredAbility(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(),"untap all creatures you control"), false); + Ability ability = new ScourgeOfTheThroneAttacksTriggeredAbility(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control"), false); ability.addEffect(new AdditionalCombatPhaseEffect()); this.addAbility(ability); } @@ -108,7 +107,7 @@ class ScourgeOfTheThroneAttacksTriggeredAbility extends TriggeredAbilityImpl { Player controller = game.getPlayer(getControllerId()); if (attackedPlayer != null && controller != null) { int mostLife = Integer.MIN_VALUE; - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : controller.getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { if (player.getLife() > mostLife) { @@ -122,53 +121,58 @@ class ScourgeOfTheThroneAttacksTriggeredAbility extends TriggeredAbilityImpl { return false; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { - Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game)); - if (amountAttacks == null || amountAttacks.intValue() < 1) { - if (amountAttacks == null) { - amountAttacks = new Integer(1); - } else { - ++amountAttacks; - } - game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game), amountAttacks); - return true; - } - } - return false; + if (event.getSourceId().equals(this.getSourceId())) { + Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game)); + if (amountAttacks == null || amountAttacks.intValue() < 1) { + if (amountAttacks == null) { + amountAttacks = new Integer(1); + } else { + ++amountAttacks; + } + game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game), amountAttacks); + return true; + } + } + return false; } @Override public String getRule() { - return "Whenever {this} attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, " + super.getRule(); + return "Whenever {this} attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, " + super.getRule(); } @Override public ScourgeOfTheThroneAttacksTriggeredAbility copy() { - return new ScourgeOfTheThroneAttacksTriggeredAbility(this); + return new ScourgeOfTheThroneAttacksTriggeredAbility(this); } } class AdditionalCombatPhaseEffect extends OneShotEffect { public AdditionalCombatPhaseEffect() { - super(Outcome.Benefit); - staticText = "After this phase, there is an additional combat phase"; + super(Outcome.Benefit); + staticText = "After this phase, there is an additional combat phase"; } public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) { - super(effect); + super(effect); } @Override public AdditionalCombatPhaseEffect copy() { - return new AdditionalCombatPhaseEffect(this); + return new AdditionalCombatPhaseEffect(this); } @Override public boolean apply(Game game, Ability source) { - game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); - return true; + game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false)); + return true; } } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java b/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java index 5ef23730e24..b6b24c31bb4 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java @@ -42,6 +42,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -95,17 +96,20 @@ class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl { public SpinalGraftTriggeredAbility copy() { return new SpinalGraftTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TARGETED) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - UUID enchanted = enchantment.getAttachedTo(); - if (event.getTargetId().equals(enchanted)) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchanted)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + UUID enchanted = enchantment.getAttachedTo(); + if (event.getTargetId().equals(enchanted)) { + getEffects().get(0).setTargetPointer(new FixedTarget(enchanted)); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/visions/Necromancy.java b/Mage.Sets/src/mage/sets/visions/Necromancy.java index 3c4b60e43d5..0525df83ffc 100644 --- a/Mage.Sets/src/mage/sets/visions/Necromancy.java +++ b/Mage.Sets/src/mage/sets/visions/Necromancy.java @@ -59,6 +59,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.PermanentIdPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -151,16 +152,19 @@ class CastAtInstantTimeTriggeredAbility extends TriggeredAbilityImpl { return new CastAtInstantTimeTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { // The sacrifice occurs only if you cast it using its own ability. If you cast it using some other // effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed. // CHECK - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getSourceId().equals(getSourceId())) { - return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1); - } + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getSourceId().equals(getSourceId())) { + return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1); } return false; } diff --git a/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java b/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java index 9e2dee19ebd..055cd377682 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java +++ b/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java @@ -46,6 +46,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.combat.CombatGroup; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.TargetPermanent; @@ -101,20 +102,23 @@ class GoblinVandalTriggeredAbility extends TriggeredAbilityImpl { return new GoblinVandalTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DECLARED_BLOCKERS; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) { - Permanent sourcePermanent = game.getPermanent(getSourceId()); - if (sourcePermanent.isAttacking()) { - for (CombatGroup combatGroup: game.getCombat().getGroups()) { - if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { - UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game); - FilterPermanent filter = new FilterArtifactPermanent(); - filter.add(new ControllerIdPredicate(defendingPlayerId)); - Target target = new TargetPermanent(filter); - this.addTarget(target); - return true; - } + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent.isAttacking()) { + for (CombatGroup combatGroup: game.getCombat().getGroups()) { + if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) { + UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game); + FilterPermanent filter = new FilterArtifactPermanent(); + filter.add(new ControllerIdPredicate(defendingPlayerId)); + Target target = new TargetPermanent(filter); + this.addTarget(target); + return true; } } } diff --git a/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java b/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java index 3a35b6b1e19..8ac3bdf798e 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java +++ b/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java @@ -28,15 +28,16 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -76,16 +77,19 @@ class AmuletOfVigorTriggeredAbility extends TriggeredAbilityImpl { return new AmuletOfVigorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent p = game.getPermanent(event.getTargetId()); - if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + Permanent p = game.getPermanent(event.getTargetId()); + if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java b/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java index fb6b00709c6..b7130eab48b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java +++ b/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java @@ -28,9 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -38,10 +35,13 @@ import mage.abilities.effects.Effect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -88,20 +88,23 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl { return new ArchonOfRedemptionTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - UUID targetId = event.getTargetId(); - Permanent permanent = game.getPermanent(targetId); - if (permanent.getControllerId().equals(this.controllerId) - && permanent.getCardType().contains(CardType.CREATURE) - && (targetId.equals(this.getSourceId()) - || (permanent.getAbilities().contains(FlyingAbility.getInstance()) && !targetId.equals(this.getSourceId())))) { - for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - } - return true; + UUID targetId = event.getTargetId(); + Permanent permanent = game.getPermanent(targetId); + if (permanent.getControllerId().equals(this.controllerId) + && permanent.getCardType().contains(CardType.CREATURE) + && (targetId.equals(this.getSourceId()) + || (permanent.getAbilities().contains(FlyingAbility.getInstance()) && !targetId.equals(this.getSourceId())))) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java index 039cd486a62..bb646a302af 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java +++ b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java @@ -28,21 +28,21 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.targetpointer.FixedTarget; @@ -101,15 +101,18 @@ class EnchantedBecomesTappedTriggeredAbility extends TriggeredAbilityImpl { return new EnchantedBecomesTappedTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TAPPED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.TAPPED) { - Permanent enchant = game.getPermanent(sourceId); - if (enchant != null && enchant.getAttachedTo() != null) { - if (event.getTargetId().equals(enchant.getAttachedTo())) { - getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); - return true; - } + Permanent enchant = game.getPermanent(sourceId); + if (enchant != null && enchant.getAttachedTo() != null) { + if (event.getTargetId().equals(enchant.getAttachedTo())) { + getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo())); + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java index 12d98026bf5..3679a0f0c9b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java +++ b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java @@ -29,11 +29,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -41,12 +36,17 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.continuous.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -96,20 +96,23 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - FilterPermanent filter = new FilterPermanent("Equipment that player controls"); - filter.add(new SubtypePredicate("Equipment")); - filter.add(new ControllerIdPredicate(event.getPlayerId())); - filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } - this.getTargets().clear(); - this.addTarget(new TargetPermanent(filter)); - return true; - } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { + FilterPermanent filter = new FilterPermanent("Equipment that player controls"); + filter.add(new SubtypePredicate("Equipment")); + filter.add(new ControllerIdPredicate(event.getPlayerId())); + filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getLogName()); + + this.getTargets().clear(); + this.addTarget(new TargetPermanent(filter)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java index 4a762bce956..77c41706614 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java +++ b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java @@ -27,15 +27,16 @@ */ package mage.sets.worldwake; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -43,8 +44,6 @@ import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.TargetPlayer; -import java.util.UUID; - /** * * @author maurer.it_at_gmail.com @@ -91,14 +90,16 @@ class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE ) { + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { // ayrat: make sure Kalastria Highborn is on battlefield - UUID sourceId = getSourceId(); - if (game.getPermanent(sourceId) == null) { + if (game.getPermanent(this.getSourceId()) == null) { // or it is being removed - if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { + if (game.getLastKnownInformation(this.getSourceId(), Zone.BATTLEFIELD) == null) { return false; } } @@ -106,16 +107,11 @@ class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent)event; Permanent permanent = zEvent.getTarget(); - if (permanent != null && + return permanent != null && zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD && (permanent.getControllerId().equals(this.getControllerId()) && - permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId()))) - { - return true; - } - } - return false; + permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId())); } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java b/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java index 851dfe2e561..347d2cc3cda 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java +++ b/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java @@ -28,9 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -38,10 +35,13 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.players.Player; @@ -92,17 +92,19 @@ class KazuulTyrantOfTheCliffsTriggeredAbility extends TriggeredAbilityImpl { return new KazuulTyrantOfTheCliffsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) { - Permanent attacker = game.getPermanent(event.getSourceId()); - Player defender = game.getPlayer(event.getTargetId()); - Player you = game.getPlayer(controllerId); - if (attacker.getControllerId() != you.getId() - && defender == you) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(attacker.getControllerId())); - return true; - } + Permanent attacker = game.getPermanent(event.getSourceId()); + Player defender = game.getPlayer(event.getTargetId()); + Player you = game.getPlayer(controllerId); + if (attacker.getControllerId() != you.getId() && defender == you) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(attacker.getControllerId())); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java index 9e46e536a43..3b4e0eabd7f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java +++ b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java @@ -29,19 +29,20 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.stack.Spell; /** @@ -96,15 +97,15 @@ class KorFirewalkerAbility extends TriggeredAbilityImpl { return new KorFirewalkerAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isRed()) { - return true; - } - } - return false; + Spell spell = game.getStack().getSpell(event.getTargetId()); + return spell != null && spell.getColor(game).isRed(); } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java b/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java index af06de30b30..673cb6f0617 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java +++ b/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java @@ -28,18 +28,18 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; /** @@ -84,14 +84,17 @@ class PerimeterCaptainTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.BLOCKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) { - Permanent creature = game.getPermanent(event.getSourceId()); - if (creature != null) { - if (creature.getControllerId().equals(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) { - return true; - } + Permanent creature = game.getPermanent(event.getSourceId()); + if (creature != null) { + if (creature.getControllerId().equals(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java b/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java index bb0c4500441..6d45d2c7d5e 100644 --- a/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java +++ b/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java @@ -28,15 +28,14 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -88,12 +87,14 @@ class QuestForTheNihilStoneTriggeredAbility extends TriggeredAbilityImpl { return new QuestForTheNihilStoneTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DISCARDED_CARD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) { - return true; - } - return false; + return game.getOpponents(controllerId).contains(event.getPlayerId()); } @Override @@ -117,6 +118,11 @@ class QuestForTheNihilStoneTriggeredAbility2 extends TriggeredAbilityImpl { return new QuestForTheNihilStoneTriggeredAbility2(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent quest = game.getPermanent(super.getSourceId()); @@ -124,7 +130,7 @@ class QuestForTheNihilStoneTriggeredAbility2 extends TriggeredAbilityImpl { Permanent questLKI = (Permanent) game.getLastKnownInformation(super.getSourceId(), Zone.BATTLEFIELD); quest = questLKI; } - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(controllerId).contains(event.getPlayerId())) { Player opponent = game.getPlayer(event.getPlayerId()); if (opponent != null && opponent.getHand().size() == 0 diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java index 9699ac73805..0a35620815e 100644 --- a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java +++ b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java @@ -28,8 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; @@ -38,12 +36,18 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -131,12 +135,14 @@ class QuestForUlasTempleTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.END_TURN_STEP_PRE)) { - Permanent quest = game.getPermanent(super.getSourceId()); - return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3; - } - return false; + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + + @Override +public boolean checkTrigger(GameEvent event, Game game) { + Permanent quest = game.getPermanent(super.getSourceId()); + return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3; } @Override diff --git a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java index 00283f78fe0..3a4894f321b 100644 --- a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java +++ b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java @@ -28,21 +28,21 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.constants.Zone; -import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.players.Player; @@ -98,21 +98,23 @@ class RumblingAftershocksTriggeredAbility extends TriggeredAbilityImpl { } @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getControllerId().equals(controllerId)) { - int damageAmount = 0; - for (Ability ability: (Abilities) spell.getAbilities()) { - if (ability instanceof KickerAbility) { - damageAmount += ((KickerAbility) ability).getKickedCounter(game); - } - } - if (damageAmount > 0) { - this.getEffects().get(0).setValue("damageAmount", new Integer(damageAmount)); - return true; - } + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = game.getStack().getSpell(event.getTargetId()); + if (spell != null && spell.getControllerId().equals(controllerId)) { + int damageAmount = 0; + for (Ability ability: spell.getAbilities()) { + if (ability instanceof KickerAbility) { + damageAmount += ((KickerAbility) ability).getKickedCounter(game); + } + } + if (damageAmount > 0) { + this.getEffects().get(0).setValue("damageAmount", damageAmount); + return true; } } return false; @@ -144,15 +146,15 @@ class RumblingAftershocksDealDamageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Integer damageAmount = (Integer) this.getValue("damageAmount"); - if (player != null && damageAmount.intValue() > 0) { + if (player != null && damageAmount > 0) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (targetPlayer != null) { - targetPlayer.damage(damageAmount.intValue(), source.getSourceId(), game, false, true); + targetPlayer.damage(damageAmount, source.getSourceId(), game, false, true); return true; } Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { - permanent.damage(damageAmount.intValue(), source.getSourceId(), game, false, true); + permanent.damage(damageAmount, source.getSourceId(), game, false, true); return true; } } diff --git a/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java b/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java index 2a4d6737def..ff4e630dbe9 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java +++ b/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java @@ -28,20 +28,20 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; @@ -96,10 +96,14 @@ class SlaveringNullsTriggeredAbility extends TriggeredAbilityImpl { return new SlaveringNullsTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && ((DamagedPlayerEvent) event).isCombatDamage()) { + if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) { if (game.getBattlefield().countAll(filter, controllerId, game) > 0) { Permanent slaveringNulls = game.getPermanent(event.getSourceId()); Player player = game.getPlayer(event.getTargetId()); diff --git a/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java b/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java index f3e07b654b3..792062bd19f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java +++ b/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java @@ -28,11 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -40,12 +35,17 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.LifelinkAbility; 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.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; @@ -101,18 +101,21 @@ class TalusPaladinTriggeredAbility extends TriggeredAbilityImpl { public TalusPaladinTriggeredAbility copy() { return new TalusPaladinTriggeredAbility(this); } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent ally = game.getPermanent(event.getTargetId()); - if (ally != null) { - if (ally.hasSubtype("Ally") - && ally.getControllerId().equals(this.getControllerId())) { - if (event.getTargetId().equals(this.getSourceId()) - || event.getTargetId().equals(ally.getId())) { - return true; - } + Permanent ally = game.getPermanent(event.getTargetId()); + if (ally != null) { + if (ally.hasSubtype("Ally") + && ally.getControllerId().equals(this.getControllerId())) { + if (event.getTargetId().equals(this.getSourceId()) + || event.getTargetId().equals(ally.getId())) { + return true; } } } diff --git a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java index f2a9cbaa96c..1d58f3eca48 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java +++ b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java @@ -28,17 +28,16 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; @@ -52,7 +51,7 @@ import mage.game.permanent.Permanent; */ public class BladeOfTheBloodchief extends CardImpl { - public BladeOfTheBloodchief ( UUID ownerId ) { + public BladeOfTheBloodchief(UUID ownerId) { super(ownerId, 196, "Blade of the Bloodchief", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); this.expansionSetCode = "ZEN"; this.getSubtype().add("Equipment"); @@ -76,25 +75,28 @@ class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl { private static final String text = "Whenever a creature dies, put a +1/+1 counter on equipped " + "creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead."; - BladeOfTheBloodChiefTriggeredAbility ( ) { + BladeOfTheBloodChiefTriggeredAbility() { super(Zone.BATTLEFIELD, new BladeOfTheBloodchiefEffect()); } - BladeOfTheBloodChiefTriggeredAbility ( final BladeOfTheBloodChiefTriggeredAbility ability ) { + BladeOfTheBloodChiefTriggeredAbility(final BladeOfTheBloodChiefTriggeredAbility ability) { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if ( event.getType() == EventType.ZONE_CHANGE ) { - ZoneChangeEvent zEvent = (ZoneChangeEvent)event; - if ( zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD ) { - Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); - if (p != null && p.getCardType().contains(CardType.CREATURE)) { - Permanent enchantment = game.getPermanent(getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - return true; - } + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { + Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); + if (p != null && p.getCardType().contains(CardType.CREATURE)) { + Permanent enchantment = game.getPermanent(getSourceId()); + if (enchantment != null && enchantment.getAttachedTo() != null) { + return true; } } } @@ -114,11 +116,11 @@ class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl { class BladeOfTheBloodchiefEffect extends OneShotEffect { - BladeOfTheBloodchiefEffect ( ) { + BladeOfTheBloodchiefEffect() { super(Outcome.BoostCreature); } - BladeOfTheBloodchiefEffect ( final BladeOfTheBloodchiefEffect ability ) { + BladeOfTheBloodchiefEffect(final BladeOfTheBloodchiefEffect ability) { super(ability); } @@ -128,10 +130,9 @@ class BladeOfTheBloodchiefEffect extends OneShotEffect { if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent creature = game.getPermanent(enchantment.getAttachedTo()); if (creature != null) { - if ( creature.hasSubtype("Vampire") ) { + if (creature.hasSubtype("Vampire")) { creature.addCounters(CounterType.P1P1.createInstance(2), game); - } - else { + } else { creature.addCounters(CounterType.P1P1.createInstance(), game); } } diff --git a/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java b/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java index f017bba3d9b..ec453fe9372 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java +++ b/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java @@ -28,18 +28,19 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.targetpointer.FixedTarget; /** @@ -72,6 +73,7 @@ public class BloodSeeker extends CardImpl { } class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl { + BloodSeekerTriggeredAbility() { super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), true); } @@ -85,14 +87,19 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl { return new BloodSeekerTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { + if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) { EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event; Card card = zEvent.getTarget(); if (card != null && card.getCardType().contains(CardType.CREATURE)) { for (Effect effect : this.getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getPlayerId())); + effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; } @@ -104,4 +111,4 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl { public String getRule() { return "Whenever a creature enters the battlefield under an opponent's control, you may have that player lose 1 life."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java index 5dfe4bbde0d..a4fc1945330 100644 --- a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java +++ b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java @@ -29,8 +29,6 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -40,9 +38,15 @@ import mage.abilities.effects.common.UntapAllLandsControllerEffect; 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.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetPermanent; @@ -96,16 +100,16 @@ class CelestialMantleAbility extends TriggeredAbilityImpl { return new CelestialMantleAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event instanceof DamagedPlayerEvent) { - DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; - Permanent p = game.getPermanent(event.getSourceId()); - if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { - return true; - } - } - return false; + DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; + Permanent p = game.getPermanent(event.getSourceId()); + return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId()); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java b/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java index 8a72b543e52..85e33e70ec8 100644 --- a/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java +++ b/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java @@ -28,16 +28,17 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -82,12 +83,14 @@ class CosisTricksterTriggeredAbility extends TriggeredAbilityImpl { return new CosisTricksterTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.LIBRARY_SHUFFLED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.LIBRARY_SHUFFLED && game.getOpponents(controllerId).contains(event.getPlayerId())) { - return true; - } - return false; + return game.getOpponents(controllerId).contains(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/Electropotence.java b/Mage.Sets/src/mage/sets/zendikar/Electropotence.java index 3444242e8d5..dd00e4e9215 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Electropotence.java +++ b/Mage.Sets/src/mage/sets/zendikar/Electropotence.java @@ -28,18 +28,19 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreatureOrPlayer; @@ -81,15 +82,18 @@ class ElectropotenceTriggeredAbility extends TriggeredAbilityImpl { super(ability); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) - && permanent.getControllerId().equals(this.controllerId)) { - this.getEffects().get(0).setValue("damageSource", event.getTargetId()); - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) + && permanent.getControllerId().equals(this.controllerId)) { + this.getEffects().get(0).setValue("damageSource", event.getTargetId()); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java index 24025221f21..96294e0af59 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java +++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java @@ -27,23 +27,23 @@ */ package mage.sets.zendikar; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.UUID; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - /** * * @author North @@ -95,12 +95,14 @@ class EmeriaTheSkyRuinTriggeredAbility extends TriggeredAbilityImpl { return new EmeriaTheSkyRuinTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java index ffe3e4e5b5a..8f07a34ec05 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java +++ b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java @@ -29,10 +29,6 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -44,6 +40,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -101,9 +101,14 @@ class GoblinGuideTriggeredAbility extends TriggeredAbilityImpl { this.text = ability.text; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) { + if (event.getSourceId().equals(this.getSourceId()) ) { UUID defenderId = game.getCombat().getDefendingPlayerId(getSourceId(), game); if (defenderId != null) { for (Effect effect :this.getEffects()) { diff --git a/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java b/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java index 1e94eea0de7..2721b3b5b36 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java +++ b/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java @@ -30,10 +30,6 @@ package mage.sets.zendikar; import java.util.HashMap; import java.util.Map; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -42,7 +38,10 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.WatcherScope; +import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -111,16 +110,16 @@ class LullmageMentorTriggeredAbility extends TriggeredAbilityImpl { return new LullmageMentorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.COUNTERED; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.COUNTERED) { - CastedSpellsWithSpellTarget watcher = (CastedSpellsWithSpellTarget) game.getState().getWatchers().get("CastedSpellsWithSpellTarget"); - UUID controllerIdCounter = watcher.getControllerSpell(event.getSourceId(), event.getTargetId()); - if (controllerIdCounter != null && controllerIdCounter.equals(controllerId)) { - return true; - } - } - return false; + CastedSpellsWithSpellTarget watcher = (CastedSpellsWithSpellTarget) game.getState().getWatchers().get("CastedSpellsWithSpellTarget"); + UUID controllerIdCounter = watcher.getControllerSpell(event.getSourceId(), event.getTargetId()); + return controllerIdCounter != null && controllerIdCounter.equals(controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java b/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java index 953489a3b37..5464750d433 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java @@ -28,10 +28,6 @@ package mage.sets.zendikar; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; @@ -42,9 +38,13 @@ import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.AngelToken; import mage.watchers.common.PlayerLostLifeWatcher; @@ -53,17 +53,16 @@ import mage.watchers.common.PlayerLostLifeWatcher; * @author jeffwadsworth */ public class LuminarchAscension extends CardImpl { - + private String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on Luminarch Ascension. (Damage causes loss of life.)"; - + public LuminarchAscension(UUID ownerId) { super(ownerId, 25, "Luminarch Ascension", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "ZEN"; - // At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on Luminarch Ascension. this.addAbility(new ConditionalTriggeredAbility(new LuminarchAscensionTriggeredAbility(), YouLostNoLifeThisTurnCondition.getInstance(), rule, true)); - + // {1}{W}: Put a 4/4 white Angel creature token with flying onto the battlefield. Activate this ability only if Luminarch Ascension has four or more quest counters on it. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), new ManaCostsImpl("{1}{W}")); ability.addCost(new SourceHasCountersCost(4, CounterType.QUEST)); @@ -82,29 +81,30 @@ public class LuminarchAscension extends CardImpl { class LuminarchAscensionTriggeredAbility extends TriggeredAbilityImpl { - public LuminarchAscensionTriggeredAbility() { - super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true); - } - - public LuminarchAscensionTriggeredAbility(LuminarchAscensionTriggeredAbility ability) { - super(ability); - } - - @Override - public LuminarchAscensionTriggeredAbility copy() { - return new LuminarchAscensionTriggeredAbility(this); - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE - && game.getOpponents(controllerId).contains(event.getPlayerId())) { - return true; - } - return false; - } + public LuminarchAscensionTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true); } + public LuminarchAscensionTriggeredAbility(LuminarchAscensionTriggeredAbility ability) { + super(ability); + } + + @Override + public LuminarchAscensionTriggeredAbility copy() { + return new LuminarchAscensionTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.END_TURN_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return game.getOpponents(controllerId).contains(event.getPlayerId()); + } +} + class SourceHasCountersCost extends CostImpl { private final int counters; @@ -156,4 +156,3 @@ class YouLostNoLifeThisTurnCondition implements Condition { return false; } } - diff --git a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java index c041d792628..9a6b87ebc59 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java +++ b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java @@ -28,18 +28,19 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.EnchantAbility; 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.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -92,15 +93,18 @@ class MireBlightTriggeredAbility extends TriggeredAbilityImpl { return new MireBlightTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - Permanent enchantment = game.getPermanent(sourceId); - UUID targetId = event.getTargetId(); - if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); - return true; - } + Permanent enchantment = game.getPermanent(sourceId); + UUID targetId = event.getTargetId(); + if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) { + this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId)); + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java b/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java index f26ed4dfbe8..d2289b99f48 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java +++ b/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java @@ -28,17 +28,18 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.target.common.TargetCreatureOrPlayer; /** @@ -84,12 +85,14 @@ class PunishingFireTriggeredAbility extends TriggeredAbilityImpl { return new PunishingFireTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.GAINED_LIFE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.GAINED_LIFE && game.getOpponents(this.controllerId).contains(event.getPlayerId())) { - return true; - } - return false; + return game.getOpponents(this.controllerId).contains(event.getPlayerId()); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java b/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java index 1045a048dcb..3ac853b0e97 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java @@ -44,6 +44,7 @@ import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; /** * @@ -89,10 +90,14 @@ class QuestForPureFlameTriggeredAbility extends TriggeredAbilityImpl { return new QuestForPureFlameTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) - && game.getOpponents(getControllerId()).contains(event.getTargetId())) { + if (game.getOpponents(getControllerId()).contains(event.getTargetId())) { return getControllerId().equals(game.getControllerId(event.getSourceId())); } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java index 28cf04f0e75..ad819ef5df1 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java @@ -42,6 +42,7 @@ import mage.counters.CounterType; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -92,17 +93,20 @@ class QuestForTheGembladesTriggeredAbility extends TriggeredAbilityImpl { return new QuestForTheGembladesTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_CREATURE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - if (((DamagedCreatureEvent) event).isCombatDamage()) { - Permanent permanent = game.getPermanent(event.getSourceId()); - if (permanent == null) { - permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); - } - if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) { - return true; - } + if (((DamagedCreatureEvent) event).isCombatDamage()) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) { + return true; } } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java index 7488dfa2e17..70ca2dd1154 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java +++ b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java @@ -29,13 +29,13 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.game.Game; @@ -86,12 +86,14 @@ class ScuteMobAbility extends TriggeredAbilityImpl { return new ScuteMobAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { - return true; - } - return false; + return event.getPlayerId().equals(this.controllerId); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java index 62172cb3070..a689e538717 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.zendikar; import java.util.UUID; @@ -85,7 +84,7 @@ public class ValakutTheMoltenPinnacle extends CardImpl { class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { - ValakutTheMoltenPinnacleTriggeredAbility () { + ValakutTheMoltenPinnacleTriggeredAbility() { super(Zone.BATTLEFIELD, new DamageTargetEffect(3), true); this.addTarget(new TargetCreatureOrPlayer()); } @@ -99,18 +98,22 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl { return game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, getSourceId(), getControllerId(), game) > 5; } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ENTERS_THE_BATTLEFIELD; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) { - if(permanent.hasSubtype("Mountain")){ - return true; - } + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) { + if (permanent.hasSubtype("Mountain")) { + return true; } } return false; } + @Override public ValakutTheMoltenPinnacleTriggeredAbility copy() { return new ValakutTheMoltenPinnacleTriggeredAbility(this); diff --git a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java index ef559cc7065..8179345ad2d 100644 --- a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java +++ b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java @@ -28,10 +28,6 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; @@ -39,10 +35,15 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -90,13 +91,15 @@ class WarrenInstigatorTriggeredAbility extends TriggeredAbilityImpl { return new WarrenInstigatorTriggeredAbility(this); } + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGED_PLAYER; + } + @Override public boolean checkTrigger(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) - && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) { - return true; - } - return false; + return event.getSourceId().equals(this.sourceId) + && game.getOpponents(this.getControllerId()).contains(event.getTargetId()); } @Override diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java index d38ae09362e..c07195414b8 100644 --- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java +++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java @@ -79,10 +79,10 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge } // TODO: Implement for all TriggeredAbilities so this default method can be removed - @Override + /*@Override public boolean checkEventType(GameEvent event, Game game) { return true; - } + }*/ @Override public boolean resolve(Game game) { From 4565bce43d1e8bbbceb66fb9aec5187485bc46ed Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 08:32:00 +0200 Subject: [PATCH 116/148] Added a test. --- .../mage/sets/timespiral/HarmonicSliver.java | 4 +- .../cards/copy/PhyrexianMetamorphTest.java | 86 +++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java b/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java index bfee4df16fd..31806f9f5a6 100644 --- a/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java +++ b/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java @@ -33,7 +33,7 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.TriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.DestroyTargetEffect; @@ -64,7 +64,7 @@ public class HarmonicSliver extends CardImpl { this.toughness = new MageInt(1); // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." - Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); TargetPermanent target = new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()); ability.addTarget(target); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect( diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java index 56819d12149..460ac83b825 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java @@ -120,5 +120,91 @@ public class PhyrexianMetamorphTest extends CardTestPlayerBase { } + /** + * I had a Harmonic Sliver, my opponent played Phyrexian Metamorph copying + * it. The resulting copy only had one instance of the artifact-enchantment + * destroying ability, where it should have had two of them and triggered + * twice (the Metamorph might have nothing to do with this) + */ + @Test + public void testHarmonicSliver() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 4); + + // 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. + addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP} + + addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 1); + addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1); + // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." + addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph"); + setChoice(playerA, "Harmonic Sliver"); + addTarget(playerA, "Alloy Myr"); + addTarget(playerA, "Kitesail"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Harmonic Sliver", 1); + + assertGraveyardCount(playerB, "Alloy Myr", 1); + assertGraveyardCount(playerB, "Kitesail", 1); + + } + /** + * If a Harmonic Sliver enters the battlefield + * the controller has to destroy one artifacts or enchantments + */ + @Test + public void testHarmonicSliverNative1() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + + // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." + addCard(Zone.HAND, playerA, "Harmonic Sliver"); + + addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 2); // 2/2 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Harmonic Sliver", 1); + + assertGraveyardCount(playerB, "Alloy Myr", 1); + + } + + /** + * If a Harmonic Sliver enters the battlefield and there is already one on the battlefield + * the controller has to destroy two artifacts or enchantments + */ + @Test + public void testHarmonicSliverNative2() { + addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + + addCard(Zone.HAND, playerA, "Harmonic Sliver"); + + addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 1); + addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1); + // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment." + addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver"); + addTarget(playerA, "Alloy Myr"); + addTarget(playerA, "Kitesail"); + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPermanentCount(playerA, "Harmonic Sliver", 1); + + assertGraveyardCount(playerB, "Alloy Myr", 1); + assertGraveyardCount(playerB, "Kitesail", 1); + + } } From d2cb6e206db9a76d7099cb11438bb6260bc9bea0 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 19 Jun 2015 09:41:43 +0300 Subject: [PATCH 117/148] Make perl scripts executable on Unix --- Utils/extract_in_wiki_format.pl | 0 Utils/gen-existing-cards-by-set.pl | 0 Utils/gen-list-implemented-cards-for-set.pl | 0 Utils/gen-list-unimplemented-cards-for-set.pl | 0 Utils/gen-simple-cards-by-set.pl | 0 Utils/pick-convertor.pl | 0 Utils/update-list-implemented-cards.pl | 0 Utils/version-bump.pl | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 Utils/extract_in_wiki_format.pl mode change 100644 => 100755 Utils/gen-existing-cards-by-set.pl mode change 100644 => 100755 Utils/gen-list-implemented-cards-for-set.pl mode change 100644 => 100755 Utils/gen-list-unimplemented-cards-for-set.pl mode change 100644 => 100755 Utils/gen-simple-cards-by-set.pl mode change 100644 => 100755 Utils/pick-convertor.pl mode change 100644 => 100755 Utils/update-list-implemented-cards.pl mode change 100644 => 100755 Utils/version-bump.pl diff --git a/Utils/extract_in_wiki_format.pl b/Utils/extract_in_wiki_format.pl old mode 100644 new mode 100755 diff --git a/Utils/gen-existing-cards-by-set.pl b/Utils/gen-existing-cards-by-set.pl old mode 100644 new mode 100755 diff --git a/Utils/gen-list-implemented-cards-for-set.pl b/Utils/gen-list-implemented-cards-for-set.pl old mode 100644 new mode 100755 diff --git a/Utils/gen-list-unimplemented-cards-for-set.pl b/Utils/gen-list-unimplemented-cards-for-set.pl old mode 100644 new mode 100755 diff --git a/Utils/gen-simple-cards-by-set.pl b/Utils/gen-simple-cards-by-set.pl old mode 100644 new mode 100755 diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl old mode 100644 new mode 100755 diff --git a/Utils/update-list-implemented-cards.pl b/Utils/update-list-implemented-cards.pl old mode 100644 new mode 100755 diff --git a/Utils/version-bump.pl b/Utils/version-bump.pl old mode 100644 new mode 100755 From 3206cb75e7dee07d39cbbb599b537d13d1c4d11f Mon Sep 17 00:00:00 2001 From: Jason Wall Date: Fri, 19 Jun 2015 00:48:30 -0600 Subject: [PATCH 118/148] get last known info so creatures get reanimated when equipped creature dies in combat --- Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java index f90d0a851a4..6000151549e 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java @@ -113,11 +113,10 @@ class ScytheOfTheWretchedTriggeredAbility extends TriggeredAbilityImpl { ZoneChangeEvent zoneChange = (ZoneChangeEvent) event; if (zoneChange.isDiesEvent() && zoneChange.getTarget().getCardType().contains(CardType.CREATURE)) { Permanent equippedCreature = getEquippedCreature(game); - if (equippedCreature == null) { - return false; - } for (MageObjectReference mor : zoneChange.getTarget().getDealtDamageByThisTurn()) { - if (mor.refersTo(equippedCreature, game)) { + Permanent permanent = (Permanent) game.getLastKnownInformation(mor.getSourceId(), Zone.BATTLEFIELD); + if((equippedCreature != null && mor.refersTo(equippedCreature, game)) + || (permanent != null && permanent.getAttachments().contains(getSourceId()))) { setTarget(new FixedTarget(event.getTargetId())); return true; } From 14a8632f0f9c315c4d5d8e455dbaa8a1fc01ac26 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 20:41:30 +0200 Subject: [PATCH 119/148] Fixed that abilities of copied permanents (e.g. Phyrexian Metamorph copying Harmonic Sliver) that gain abilities to other permanents were in some situations not correctly applied to that other permanents. --- .../mage/sets/newphyrexia/PhyrexianMetamorph.java | 5 ----- .../abilities/effects/EntersBattlefieldEffect.java | 13 +++---------- .../common/continuous/GainAbilityAllEffect.java | 1 + .../continuous/GainAbilityAttachedEffect.java | 1 + .../common/continuous/GainAbilityPairedEffect.java | 3 ++- .../common/continuous/GainAbilitySourceEffect.java | 1 + .../common/continuous/GainAbilityTargetEffect.java | 1 + 7 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index 6948b40a292..681c7882c45 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -30,7 +30,6 @@ package mage.sets.newphyrexia; import java.util.UUID; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.MageInt; @@ -38,7 +37,6 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.EntersBattlefieldEffect; -import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; @@ -46,9 +44,6 @@ import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; -import mage.target.TargetPermanent; import mage.util.functions.ApplyToPermanent; /** diff --git a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java index a30192d886e..92dbfa7aa0d 100644 --- a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java +++ b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java @@ -95,21 +95,14 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) { - if (event.getTargetId().equals(source.getSourceId())) { - if (condition == null || condition.apply(game, source)) { - return true; - } + if (event.getTargetId().equals(source.getSourceId())) { + if (condition == null || condition.apply(game, source)) { + return true; } } return false; } - @Override - public boolean apply(Game game, Ability source) { - return false; - } - @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { if (optional) { diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java index 6ed437d0891..77b9483002c 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java @@ -80,6 +80,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl { public GainAbilityAllEffect(final GainAbilityAllEffect effect) { super(effect); this.ability = effect.ability.copy(); + ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents this.filter = effect.filter.copy(); this.excludeSource = effect.excludeSource; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java index cdbc829cbbe..6a0509da83d 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java @@ -80,6 +80,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl { public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) { super(effect); this.ability = effect.ability.copy(); + ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents this.attachmentType = effect.attachmentType; this.fixedTarget = effect.fixedTarget; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java index 7f7b4c49e78..686b7f0a525 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java @@ -54,6 +54,7 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl { public GainAbilityPairedEffect(final GainAbilityPairedEffect effect) { super(effect); this.ability = effect.ability.copy(); + ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents } @Override @@ -68,7 +69,7 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl { Permanent paired = game.getPermanent(permanent.getPairedCard()); if (paired != null) { permanent.addAbility(ability, game); - paired.addAbility(ability, source.getSourceId(), game); + paired.addAbility(ability, source.getSourceId(), game, false); return true; } } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java index cd691be7fe4..81fc17c970c 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java @@ -80,6 +80,7 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl implements Sou public GainAbilitySourceEffect(final GainAbilitySourceEffect effect) { super(effect); this.ability = effect.ability.copy(); + ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents this.onCard = effect.onCard; } diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java index d8635ef0f26..404c0476d7f 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java @@ -77,6 +77,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl { public GainAbilityTargetEffect(final GainAbilityTargetEffect effect) { super(effect); this.ability = effect.ability.copy(); + ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents this.onCard = effect.onCard; this.durationPhaseStep = effect.durationPhaseStep; this.durationPlayerId = effect.durationPlayerId; From db5526a1c6f20fd636c992b2420c20251c8f6201 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 19 Jun 2015 23:56:45 +0200 Subject: [PATCH 120/148] * Kicker - Fixed that kicker did not work correctly if the kicker card did change zone again before kicker dependant ability resolved. --- .../sets/worldwake/BloodhuskRitualist.java | 7 +- .../sets/worldwake/RumblingAftershocks.java | 2 +- .../sets/worldwake/StrengthOfTheTajuru.java | 2 - .../cards/abilities/keywords/KickerTest.java | 89 +++++++++++++++++++ .../condition/common/KickedCondition.java | 2 +- .../condition/common/KickedCostCondition.java | 10 +-- .../ConditionalTriggeredAbility.java | 18 ++++ .../dynamicvalue/common/MultikickerCount.java | 2 +- .../mage/abilities/keyword/KickerAbility.java | 68 +++++++------- 9 files changed, 145 insertions(+), 55 deletions(-) diff --git a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java index d9ae21d721e..0a776c393d7 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java +++ b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java @@ -34,8 +34,6 @@ import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.condition.common.KickedCondition; -import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.dynamicvalue.common.MultikickerCount; import mage.abilities.effects.common.discard.DiscardTargetEffect; import mage.abilities.keyword.MultikickerAbility; @@ -61,10 +59,7 @@ public class BloodhuskRitualist extends CardImpl { this.addAbility(new MultikickerAbility("{B}")); // When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked. - Ability ability = new ConditionalTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(new MultikickerCount())), - KickedCondition.getInstance(), - ""); + Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(new MultikickerCount())); ability.addTarget(new TargetOpponent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java index 3a4894f321b..a8fcaefca2c 100644 --- a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java +++ b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java @@ -109,7 +109,7 @@ class RumblingAftershocksTriggeredAbility extends TriggeredAbilityImpl { int damageAmount = 0; for (Ability ability: spell.getAbilities()) { if (ability instanceof KickerAbility) { - damageAmount += ((KickerAbility) ability).getKickedCounter(game); + damageAmount += ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility()); } } if (damageAmount > 0) { diff --git a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java index 6645440db61..6767e5affff 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java +++ b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java @@ -54,8 +54,6 @@ public class StrengthOfTheTajuru extends CardImpl { super(ownerId, 113, "Strength of the Tajuru", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}"); this.expansionSetCode = "WWK"; - - // Multikicker (You may pay an additional {1} any number of times as you cast this spell.) this.addAbility(new MultikickerAbility("{1}")); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java index 8744f4f5a28..162211c664d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java @@ -31,6 +31,7 @@ package org.mage.test.cards.abilities.keywords; import mage.constants.PhaseStep; import mage.constants.Zone; import mage.counters.CounterType; +import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -203,4 +204,92 @@ public class KickerTest extends CardTestPlayerBase { assertLife(playerB, 20); } + + /** + * Bloodhusk Ritualist's discard trigger does nothing if the Ritualist leaves the battlefield before the trigger resolves. + */ + @Test + public void testBloodhuskRitualist() { + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt"); + addCard(Zone.HAND, playerB, "Fireball", 2); + + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); + addCard(Zone.HAND, playerA, "Bloodhusk Ritualist", 1); // 2/2 {2}{B} + + // Multikicker (You may pay an additional {B} any number of times as you cast this spell.) + // When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked. + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodhusk Ritualist"); + setChoice(playerA, "Yes"); // 2 x Multikicker + setChoice(playerA, "Yes"); + setChoice(playerA, "No"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bloodhusk Ritualist"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + Assert.assertEquals("All mana has to be used","[]", playerA.getManaAvailable(currentGame).toString()); + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerA, "Bloodhusk Ritualist", 1); + assertGraveyardCount(playerB, "Fireball", 2); + + assertHandCount(playerB, 0); + } + + /** + * Test and/or kicker costs + */ + @Test + public void testSunscapeBattlemage1() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + + // Kicker {1}{G} and/or {2}{U} + // When {this} enters the battlefield, if it was kicked with its {1}{G} kicker, destroy target creature with flying. + // When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, draw two cards. + addCard(Zone.HAND, playerA, "Sunscape Battlemage", 1); // 2/2 {2}{W} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sunscape Battlemage"); + setChoice(playerA, "No"); // no {1}{G} + setChoice(playerA, "Yes"); // but {2}{U} + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Sunscape Battlemage", 1); + assertHandCount(playerA, 2); + } + + + /** + * Test and/or kicker costs + */ + @Test + public void testSunscapeBattlemage2() { + addCard(Zone.BATTLEFIELD, playerA, "Island", 3); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 3); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + + + // Kicker {1}{G} and/or {2}{U} + // When {this} enters the battlefield, if it was kicked with its {1}{G} kicker, destroy target creature with flying. + // When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, draw two cards. + addCard(Zone.HAND, playerA, "Sunscape Battlemage", 1); // 2/2 {2}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Birds of Paradise", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sunscape Battlemage"); + addTarget(playerA, "Birds of Paradise"); + setChoice(playerA, "Yes"); // no {1}{G} + setChoice(playerA, "Yes"); // but {2}{U} + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerB, "Birds of Paradise", 1); + assertPermanentCount(playerA, "Sunscape Battlemage", 1); + assertHandCount(playerA, 2); + } + + } diff --git a/Mage/src/mage/abilities/condition/common/KickedCondition.java b/Mage/src/mage/abilities/condition/common/KickedCondition.java index 88491bdb5dc..02c9cfec31b 100644 --- a/Mage/src/mage/abilities/condition/common/KickedCondition.java +++ b/Mage/src/mage/abilities/condition/common/KickedCondition.java @@ -59,7 +59,7 @@ public class KickedCondition implements Condition { if (card != null) { for (Ability ability: card.getAbilities()) { if (ability instanceof KickerAbility) { - if(((KickerAbility) ability).isKicked(game)) { + if(((KickerAbility) ability).isKicked(game, source, "")) { return true; } } diff --git a/Mage/src/mage/abilities/condition/common/KickedCostCondition.java b/Mage/src/mage/abilities/condition/common/KickedCostCondition.java index 0add305c721..2a11646d850 100644 --- a/Mage/src/mage/abilities/condition/common/KickedCostCondition.java +++ b/Mage/src/mage/abilities/condition/common/KickedCostCondition.java @@ -24,17 +24,9 @@ public class KickedCostCondition implements Condition { public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getSourceId()); if (card != null) { - KickerAbility kickerAbility = null; for (Ability ability: card.getAbilities()) { if (ability instanceof KickerAbility) { - kickerAbility = (KickerAbility) ability; - } - } - if (kickerAbility != null) { - for (OptionalAdditionalCost cost: kickerAbility.getKickerCosts()) { - if (cost.getText(true).equals(kickerCostText)) { - return cost.isActivated(); - } + return ((KickerAbility) ability).isKicked(game, source, kickerCostText); } } } diff --git a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java index 28ba0af2cd9..5a4cae21da6 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java +++ b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java @@ -1,5 +1,6 @@ package mage.abilities.decorator; +import mage.MageObject; import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.condition.Condition; @@ -74,4 +75,21 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl { return ability.getEffects(); } + @Override + public MageObject getSourceObjectIfItStillExists(Game game) { + return ability.getSourceObjectIfItStillExists(game); + } + + @Override + public MageObject getSourceObject(Game game) { + return ability.getSourceObject(game); + } + + + + @Override + public int getSourceObjectZoneChangeCounter() { + return ability.getSourceObjectZoneChangeCounter(); + } + } diff --git a/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java b/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java index 7ad2b93eebb..d52f265e435 100644 --- a/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java +++ b/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java @@ -50,7 +50,7 @@ public class MultikickerCount implements DynamicValue { if (card != null) { for (Ability ability: card.getAbilities()) { if (ability instanceof KickerAbility) { - count += ((KickerAbility) ability).getKickedCounter(game); + count += ((KickerAbility) ability).getKickedCounter(game, source); } } } diff --git a/Mage/src/mage/abilities/keyword/KickerAbility.java b/Mage/src/mage/abilities/keyword/KickerAbility.java index fef48ffa24d..6828e26a060 100644 --- a/Mage/src/mage/abilities/keyword/KickerAbility.java +++ b/Mage/src/mage/abilities/keyword/KickerAbility.java @@ -28,9 +28,11 @@ package mage.abilities.keyword; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.StaticAbility; @@ -42,7 +44,7 @@ import mage.abilities.costs.OptionalAdditionalSourceCosts; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.VariableManaCost; -import mage.cards.Card; +import mage.constants.AbilityType; import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; @@ -87,12 +89,12 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo protected static final String KICKER_REMINDER_MANA = "(You may pay an additional {cost} as you cast this spell.)"; protected static final String KICKER_REMINDER_COST = "(You may {cost} in addition to any other costs as you cast this spell.)"; + protected Map activations = new HashMap<>(); // zoneChangeCounter, activations + protected String keywordText; protected String reminderText; protected List kickerCosts = new LinkedList<>(); private int xManaValue = 0; - // needed to reset kicked status, if card changes zone after casting it - private int zoneChangeCounter = 0; public KickerAbility(String manaString) { this(KICKER_KEYWORD, KICKER_REMINDER_MANA); @@ -118,7 +120,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo this.keywordText = ability.keywordText; this.reminderText = ability.reminderText; this.xManaValue = ability.xManaValue; - this.zoneChangeCounter = ability.zoneChangeCounter; + this.activations.putAll(ability.activations); } @@ -143,35 +145,24 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo for (OptionalAdditionalCost cost: kickerCosts) { cost.reset(); } - zoneChangeCounter = 0; } public int getXManaValue() { return xManaValue; } - public int getKickedCounter(Game game) { - if (isKicked(game)) { - int counter = 0; - for (OptionalAdditionalCost cost: kickerCosts) { - counter += cost.getActivateCount(); - } - return counter; + public int getKickedCounter(Game game, Ability source) { + String key = getActivationKey(source, "", game); + if (activations.containsKey(key)) { + return activations.get(key); } return 0; } - public boolean isKicked(Game game) { - Card card = game.getCard(sourceId); - // kicked status counts only if card not changed zone since it was kicked - if (card != null && card.getZoneChangeCounter(game) <= zoneChangeCounter +1) { - for (OptionalAdditionalCost cost: kickerCosts) { - if(cost.isActivated()) { - return true; - } - } - } else { - this.resetKicker(); + public boolean isKicked(Game game, Ability source, String costText) { + String key = getActivationKey(source, costText, game); + if (activations.containsKey(key)) { + return activations.get(key) > 0; } return false; } @@ -180,19 +171,26 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo return kickerCosts; } - private void activateKicker(OptionalAdditionalCost kickerCost, Game game) { - kickerCost.activate(); - // remember zone change counter - if (zoneChangeCounter == 0) { - Card card = game.getCard(getSourceId()); - if (card != null) { - zoneChangeCounter = card.getZoneChangeCounter(game); - } else { - throw new IllegalArgumentException("Kicker source card not found"); - } + private void activateKicker(OptionalAdditionalCost kickerCost, Ability source, Game game) { + int amount = 1; + String key = getActivationKey(source, kickerCost.getText(true), game); + if (activations.containsKey(key)) { + amount += activations.get(key); } + activations.put(key, amount); } + private String getActivationKey(Ability source, String costText, Game game) { + int zcc = source.getSourceObjectZoneChangeCounter(); + if (source.getSourceObjectZoneChangeCounter() == 0) { + zcc = game.getState().getZoneChangeCounter(source.getSourceId()); + } + if (zcc > 0 && (source.getAbilityType().equals(AbilityType.TRIGGERED) || source.getAbilityType().equals(AbilityType.STATIC))) { + --zcc; + } + return String.valueOf(zcc) + ((kickerCosts.size() > 1) ? costText :""); + } + @Override public void addOptionalAdditionalCosts(Ability ability, Game game) { if (ability instanceof SpellAbility) { @@ -208,8 +206,8 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo times = Integer.toString(activatedCount + 1) + (activatedCount == 0 ? " time ":" times "); } if (kickerCost.canPay(ability, sourceId, controllerId, game) && - player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(times).append(kickerCost.getText(false)).append(" ?").toString(), game)) { - this.activateKicker(kickerCost, game); + player.chooseUse(Outcome.Benefit, "Pay " + times + kickerCost.getText(false) + " ?", game)) { + this.activateKicker(kickerCost, ability, game); for (Iterator it = ((Costs) kickerCost).iterator(); it.hasNext();) { Cost cost = (Cost) it.next(); if (cost instanceof ManaCostsImpl) { From e509a35795eca77ead6a6422d931501d3f129573 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 01:07:35 +0200 Subject: [PATCH 121/148] Fixed a bug that existing continuous effects were not applied before state based effects were checked. --- .../java/mage/player/ai/ComputerPlayer.java | 5 +- .../mage/sets/magic2011/SerraAscendant.java | 3 + .../cards/continuous/SerraAscendantTest.java | 94 +++++++++++++++++++ Mage/src/mage/game/GameImpl.java | 1 + 4 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index 1ba65e80b42..dda37ca177f 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -311,8 +311,9 @@ public class ComputerPlayer extends PlayerImpl implements Player { if (card != null) { cards.add(card); } - } - while(!target.isChosen() && !cards.isEmpty()) { + } + while((outcome.isGood() ? target.getTargets().size() < target.getMaxNumberOfTargets() : !target.isChosen()) + && !cards.isEmpty()) { Card pick = pickTarget(cards, outcome, target, null, game); if (pick != null) { target.addTarget(pick.getId(), null, game); diff --git a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java index a631cbf8395..6249ea6ee65 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java +++ b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java @@ -62,7 +62,10 @@ public class SerraAscendant extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); + // Lifelink (Damage dealt by this creature also causes you to gain that much life.) this.addAbility(LifelinkAbility.getInstance()); + + // As long as you have 30 or more life, Serra Ascendant gets +5/+5 and has flying. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SerraAscendantEffect())); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java new file mode 100644 index 00000000000..3e5cd7ae3ce --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java @@ -0,0 +1,94 @@ +/* + * 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.continuous; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class SerraAscendantTest extends CardTestPlayerBase { + + /** + * The game goes on; he plays his Serra Ascendant on turn one, passes the + * turn, you play your newly unbanned Wild Nacatl with a Stomping Ground and + * also pass the turn. On turn 2, he casts a Martyr of Sands and sacrifices + * it, revealing 3 white cards to gain 9 life and end up at 29. He goes to + * the combat phase, declares Serra as an attacker, and you happily block + * him, thinking that this is such a bad move from him. After the damage is + * dealt, the Serra is still there, bigger than ever. + */ + @Test + public void testSilence() { + addCard(Zone.HAND, playerA, "Plains", 2); + // As long as you have 30 or more life, Serra Ascendant gets +5/+5 and has flying. + addCard(Zone.HAND, playerA, "Serra Ascendant"); + // {1}, Reveal X white cards from your hand, Sacrifice Martyr of Sands: You gain three times X life. + addCard(Zone.HAND, playerA, "Martyr of Sands"); + addCard(Zone.HAND, playerA, "Silvercoat Lion",3); + + addCard(Zone.HAND, playerB, "Stomping Ground", 1); + addCard(Zone.HAND, playerB, "Wild Nacatl", 1); + + playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Serra Ascendant"); + + playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Stomping Ground"); + setChoice(playerB, "Yes"); + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Wild Nacatl"); + + playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains"); + castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Martyr of Sands"); + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1},You may reveal X white cards from your hand"); + setChoice(playerA,"X=3"); + + attack(3, playerA, "Serra Ascendant"); + block(3, playerB, "Wild Nacatl", "Serra Ascendant"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + + execute(); + + assertGraveyardCount(playerA, "Martyr of Sands", 1); + + assertLife(playerB, 18); + assertLife(playerA, 30); + + assertPermanentCount(playerB, "Wild Nacatl", 1); + + assertPermanentCount(playerA, "Serra Ascendant", 1); + assertPowerToughness(playerA, "Serra Ascendant", 6, 6); + + } + +} \ No newline at end of file diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 505bfa8c0ff..28383956d02 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -1144,6 +1144,7 @@ public abstract class GameImpl implements Game, Serializable { int bookmark = 0; clearAllBookmarks(); try { + applyEffects(); while (!isPaused() && !gameOver(null) && !this.getTurn().isEndTurnRequested()) { if (!resuming) { state.getPlayers().resetPassed(); From 54139da84643602ac535f021e35eb72dc477e986 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 22:44:52 -0400 Subject: [PATCH 122/148] Added FireTempest --- .../sets/masterseditioniv/FireTempest.java | 52 +++++++++++++++++ .../src/mage/sets/portal/FireTempest.java | 58 +++++++++++++++++++ .../mage/sets/starter1999/FireTempest.java | 52 +++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java create mode 100644 Mage.Sets/src/mage/sets/portal/FireTempest.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/FireTempest.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java new file mode 100644 index 00000000000..0b5846ce451 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class FireTempest extends mage.sets.portal.FireTempest { + + public FireTempest(UUID ownerId) { + super(ownerId); + this.cardNumber = 114; + this.expansionSetCode = "ME4"; + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/FireTempest.java b/Mage.Sets/src/mage/sets/portal/FireTempest.java new file mode 100644 index 00000000000..73a5edd2c58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/FireTempest.java @@ -0,0 +1,58 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class FireTempest extends CardImpl { + + public FireTempest(UUID ownerId) { + super(ownerId, 133, "Fire Tempest", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}"); + this.expansionSetCode = "POR"; + + // Fire Tempest deals 6 damage to each creature and each player. + this.getSpellAbility().addEffect(new DamageEverythingEffect(6)); + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/FireTempest.java b/Mage.Sets/src/mage/sets/starter1999/FireTempest.java new file mode 100644 index 00000000000..dc65152b60f --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/FireTempest.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.starter1999; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class FireTempest extends mage.sets.portal.FireTempest { + + public FireTempest(UUID ownerId) { + super(ownerId); + this.cardNumber = 97; + this.expansionSetCode = "S99"; + } + + public FireTempest(final FireTempest card) { + super(card); + } + + @Override + public FireTempest copy() { + return new FireTempest(this); + } +} From 0021a0e5bf27e1f50d7c78b27c5f0a32fa5b71d0 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 22:49:41 -0400 Subject: [PATCH 123/148] Lava Flow added --- .../mage/sets/masterseditioniv/LavaFlow.java | 54 +++++++++++++++ Mage.Sets/src/mage/sets/portal/LavaFlow.java | 69 +++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java create mode 100644 Mage.Sets/src/mage/sets/portal/LavaFlow.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java new file mode 100644 index 00000000000..28e23ad688c --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class LavaFlow extends mage.sets.portal.LavaFlow { + + public LavaFlow(UUID ownerId) { + super(ownerId); + this.cardNumber = 126; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public LavaFlow(final LavaFlow card) { + super(card); + } + + @Override + public LavaFlow copy() { + return new LavaFlow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/LavaFlow.java b/Mage.Sets/src/mage/sets/portal/LavaFlow.java new file mode 100644 index 00000000000..90da5519b19 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/LavaFlow.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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.Target; +import mage.target.TargetPermanent; + +/** + * + * @author anonymous + */ +public class LavaFlow extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("creature or land"); + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); + } + + public LavaFlow(UUID ownerId) { + super(ownerId, 143, "Lava Flow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "POR"; + + // Destroy target creature or land. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + Target target = new TargetPermanent(filter); + this.getSpellAbility().addTarget(target); + } + + public LavaFlow(final LavaFlow card) { + super(card); + } + + @Override + public LavaFlow copy() { + return new LavaFlow(this); + } +} From 4c70636fdb95b15ece3992fb6d9515f7d533fcbc Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:00:51 -0400 Subject: [PATCH 124/148] Sedge Troll added --- .../mage/sets/limitedalpha/SedgeTroll.java | 52 +++++++++++++ .../src/mage/sets/limitedbeta/SedgeTroll.java | 52 +++++++++++++ .../sets/masterseditioniv/SedgeTroll.java | 77 +++++++++++++++++++ .../mage/sets/revisededition/SedgeTroll.java | 52 +++++++++++++ .../sets/unlimitededition/SedgeTroll.java | 52 +++++++++++++ 5 files changed, 285 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java diff --git a/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java new file mode 100644 index 00000000000..d72be7da06b --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "LEA"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java new file mode 100644 index 00000000000..727f55b9a73 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 174; + this.expansionSetCode = "LEB"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java new file mode 100644 index 00000000000..bd09ae6f64b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java @@ -0,0 +1,77 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author anonymous + */ +public class SedgeTroll extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Swamp"); + + static { + filter.add(new SubtypePredicate("Swamp")); + } + + public SedgeTroll(UUID ownerId) { + super(ownerId, 135, "Sedge Troll", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Troll"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sedge Troll gets +1/+1 as long as you control a Swamp. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter, 1, 1))); + // {B}: Regenerate Sedge Troll. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java new file mode 100644 index 00000000000..08073719432 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.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.revisededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "3ED"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java new file mode 100644 index 00000000000..4469f488942 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.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 anonymous + */ +public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll { + + public SedgeTroll(UUID ownerId) { + super(ownerId); + this.cardNumber = 173; + this.expansionSetCode = "2ED"; + } + + public SedgeTroll(final SedgeTroll card) { + super(card); + } + + @Override + public SedgeTroll copy() { + return new SedgeTroll(this); + } +} From f64f2f4d7b9a8688a2407cae0ef7c1cead063aea Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:07:08 -0400 Subject: [PATCH 125/148] Alluring Scent added --- .../sets/masterseditioniv/AlluringScent.java | 54 ++++++++++++++++ .../src/mage/sets/portal/AlluringScent.java | 61 +++++++++++++++++++ .../sets/portalsecondage/AlluringScent.java | 52 ++++++++++++++++ .../mage/sets/starter1999/AlluringScent.java | 52 ++++++++++++++++ 4 files changed, 219 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/portal/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/AlluringScent.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java new file mode 100644 index 00000000000..02f566a2eaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 141; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/AlluringScent.java b/Mage.Sets/src/mage/sets/portal/AlluringScent.java new file mode 100644 index 00000000000..9011d1b8343 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/AlluringScent.java @@ -0,0 +1,61 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author anonymous + */ +public class AlluringScent extends CardImpl { + + public AlluringScent(UUID ownerId) { + super(ownerId, 61, "Alluring Scent", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{G}{G}"); + this.expansionSetCode = "POR"; + + // All creatures able to block target creature this turn do so. + this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java new file mode 100644 index 00000000000..21362c14c5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.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.portalsecondage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "PO2"; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java new file mode 100644 index 00000000000..a9596f50154 --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.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.starter1999; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AlluringScent extends mage.sets.portal.AlluringScent { + + public AlluringScent(UUID ownerId) { + super(ownerId); + this.cardNumber = 124; + this.expansionSetCode = "S99"; + } + + public AlluringScent(final AlluringScent card) { + super(card); + } + + @Override + public AlluringScent copy() { + return new AlluringScent(this); + } +} From 7adb4f9de7cd41c36c17c3421aab28f8c44aa488 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:11:27 -0400 Subject: [PATCH 126/148] Bee Sting added --- .../mage/sets/masterseditioniv/BeeSting.java | 52 ++++++++++++++++ Mage.Sets/src/mage/sets/portal/BeeSting.java | 60 +++++++++++++++++++ .../mage/sets/portalsecondage/BeeSting.java | 52 ++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java create mode 100644 Mage.Sets/src/mage/sets/portal/BeeSting.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java new file mode 100644 index 00000000000..9aa50ac612f --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class BeeSting extends mage.sets.portal.BeeSting { + + public BeeSting(UUID ownerId) { + super(ownerId); + this.cardNumber = 144; + this.expansionSetCode = "ME4"; + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/BeeSting.java b/Mage.Sets/src/mage/sets/portal/BeeSting.java new file mode 100644 index 00000000000..7fd92df02bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/BeeSting.java @@ -0,0 +1,60 @@ +/* + * 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.portal; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author anonymous + */ +public class BeeSting extends CardImpl { + + public BeeSting(UUID ownerId) { + super(ownerId, 83, "Bee Sting", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}"); + this.expansionSetCode = "POR"; + + // Bee Sting deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java new file mode 100644 index 00000000000..46420f52aa4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.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.portalsecondage; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class BeeSting extends mage.sets.portal.BeeSting { + + public BeeSting(UUID ownerId) { + super(ownerId); + this.cardNumber = 64; + this.expansionSetCode = "PO2"; + } + + public BeeSting(final BeeSting card) { + super(card); + } + + @Override + public BeeSting copy() { + return new BeeSting(this); + } +} From f5c41b8215f8c14b4a1ed743b19d13572c5c8c73 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:30:53 -0400 Subject: [PATCH 127/148] Citanul Druid added --- .../mage/sets/antiquities/CitanulDruid.java | 76 +++++++++++++++++++ .../sets/masterseditioniv/CitanulDruid.java | 54 +++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java diff --git a/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java new file mode 100644 index 00000000000..3e593593680 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.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.antiquities; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.SetTargetPointer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterArtifactSpell; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author anonymous + */ +public class CitanulDruid extends CardImpl { + private static final FilterArtifactSpell filter = new FilterArtifactSpell(); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + + public CitanulDruid(UUID ownerId) { + super(ownerId, 61, "Citanul Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Druid"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever an opponent casts an artifact spell, put a +1/+1 counter on Citanul Druid. + this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false)); + } + + public CitanulDruid(final CitanulDruid card) { + super(card); + } + + @Override + public CitanulDruid copy() { + return new CitanulDruid(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java new file mode 100644 index 00000000000..88024ad7fc7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class CitanulDruid extends mage.sets.antiquities.CitanulDruid { + + public CitanulDruid(UUID ownerId) { + super(ownerId); + this.cardNumber = 146; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public CitanulDruid(final CitanulDruid card) { + super(card); + } + + @Override + public CitanulDruid copy() { + return new CitanulDruid(this); + } +} From 77e3861a850fb216d92b349555dba5cc47481d06 Mon Sep 17 00:00:00 2001 From: Marshall Date: Wed, 17 Jun 2015 23:36:21 -0400 Subject: [PATCH 128/148] Ironhoof Ox added --- .../sets/masterseditioniv/IronhoofOx.java | 54 ++++++++++++++++ .../mage/sets/portalsecondage/IronhoofOx.java | 64 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java new file mode 100644 index 00000000000..5c40de1cc18 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class IronhoofOx extends mage.sets.portalsecondage.IronhoofOx { + + public IronhoofOx(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public IronhoofOx(final IronhoofOx card) { + super(card); + } + + @Override + public IronhoofOx copy() { + return new IronhoofOx(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java new file mode 100644 index 00000000000..78317a733e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.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.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class IronhoofOx extends CardImpl { + + public IronhoofOx(UUID ownerId) { + super(ownerId, 70, "Ironhoof Ox", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Ox"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Ironhoof Ox can't be blocked by more than one creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByMoreThanOneSourceEffect())); + } + + public IronhoofOx(final IronhoofOx card) { + super(card); + } + + @Override + public IronhoofOx copy() { + return new IronhoofOx(this); + } +} From 7dc9b808271d7dc0d43acb6dce41837ae56c733c Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:16:34 -0400 Subject: [PATCH 129/148] Onulet and Horn of Deafening implemented --- .../src/mage/sets/antiquities/Onulet.java | 54 ++++++++++++++ .../src/mage/sets/fourthedition/Onulet.java | 54 ++++++++++++++ .../mage/sets/legends/HornOfDeafening.java | 70 +++++++++++++++++++ .../src/mage/sets/mastersedition/Onulet.java | 63 +++++++++++++++++ .../masterseditioniv/HornOfDeafening.java | 54 ++++++++++++++ .../mage/sets/masterseditioniv/Onulet.java | 52 ++++++++++++++ .../src/mage/sets/revisededition/Onulet.java | 54 ++++++++++++++ 7 files changed, 401 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/legends/HornOfDeafening.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Onulet.java diff --git a/Mage.Sets/src/mage/sets/antiquities/Onulet.java b/Mage.Sets/src/mage/sets/antiquities/Onulet.java new file mode 100644 index 00000000000..d27a886f10f --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/Onulet.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.antiquities; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 24; + this.expansionSetCode = "ATQ"; + this.rarity = Rarity.UNCOMMON; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Onulet.java b/Mage.Sets/src/mage/sets/fourthedition/Onulet.java new file mode 100644 index 00000000000..f058249f256 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Onulet.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.fourthedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 358; + this.expansionSetCode = "4ED"; + this.rarity = Rarity.RARE; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java new file mode 100644 index 00000000000..4ce8837efc2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java @@ -0,0 +1,70 @@ +/* + * 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.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PreventDamageByTargetEffect; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class HornOfDeafening extends CardImpl { + + public HornOfDeafening(UUID ownerId) { + super(ownerId, 224, "Horn of Deafening", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "LEG"; + + // {2}, {tap}: Prevent all combat damage that would be dealt by target creature this turn. + 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("{2}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public HornOfDeafening(final HornOfDeafening card) { + super(card); + } + + @Override + public HornOfDeafening copy() { + return new HornOfDeafening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Onulet.java b/Mage.Sets/src/mage/sets/mastersedition/Onulet.java new file mode 100644 index 00000000000..26d81b2f413 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Onulet.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.mastersedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends CardImpl { + + public Onulet(UUID ownerId) { + super(ownerId, 161, "Onulet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); + this.expansionSetCode = "MED"; + this.subtype.add("Construct"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Onulet dies, you gain 2 life. + this.addAbility(new DiesTriggeredAbility(new GainLifeEffect(2))); + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java new file mode 100644 index 00000000000..0b311293e79 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class HornOfDeafening extends mage.sets.legends.HornOfDeafening { + + public HornOfDeafening(UUID ownerId) { + super(ownerId); + this.cardNumber = 205; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public HornOfDeafening(final HornOfDeafening card) { + super(card); + } + + @Override + public HornOfDeafening copy() { + return new HornOfDeafening(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java new file mode 100644 index 00000000000..c60fa210652 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 219; + this.expansionSetCode = "ME4"; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Onulet.java b/Mage.Sets/src/mage/sets/revisededition/Onulet.java new file mode 100644 index 00000000000..9289aa7ff50 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Onulet.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.revisededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class Onulet extends mage.sets.mastersedition.Onulet { + + public Onulet(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "3ED"; + this.rarity = Rarity.RARE; + } + + public Onulet(final Onulet card) { + super(card); + } + + @Override + public Onulet copy() { + return new Onulet(this); + } +} From 83a340c912b34e3024c80edb999f600652d946de Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:36:03 -0400 Subject: [PATCH 130/148] Serra Aviary and Staff of Zegon added --- .../mage/sets/antiquities/StaffOfZegon.java | 52 ++++++++++++++ .../src/mage/sets/homelands/SerraAviary.java | 71 +++++++++++++++++++ .../sets/masterseditioniv/SerraAviary.java | 54 ++++++++++++++ .../sets/masterseditioniv/StaffOfZegon.java | 66 +++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java create mode 100644 Mage.Sets/src/mage/sets/homelands/SerraAviary.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java diff --git a/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java new file mode 100644 index 00000000000..e1e494a7351 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.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.antiquities; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class StaffOfZegon extends mage.sets.masterseditioniv.StaffOfZegon { + + public StaffOfZegon(UUID ownerId) { + super(ownerId); + this.cardNumber = 30; + this.expansionSetCode = "ATQ"; + } + + public StaffOfZegon(final StaffOfZegon card) { + super(card); + } + + @Override + public StaffOfZegon copy() { + return new StaffOfZegon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/homelands/SerraAviary.java b/Mage.Sets/src/mage/sets/homelands/SerraAviary.java new file mode 100644 index 00000000000..56700a59dbd --- /dev/null +++ b/Mage.Sets/src/mage/sets/homelands/SerraAviary.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.homelands; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.BoostAllEffect; +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; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author anonymous + */ +public class SerraAviary extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Creatures with flying"); + + static { + filter1.add(new AbilityPredicate(FlyingAbility.class)); + } + + public SerraAviary(UUID ownerId) { + super(ownerId, 118, "Serra Aviary", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "HML"; + this.supertype.add("World"); + + // Creatures with flying get +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter1, false))); + } + + public SerraAviary(final SerraAviary card) { + super(card); + } + + @Override + public SerraAviary copy() { + return new SerraAviary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java new file mode 100644 index 00000000000..466ff99dd01 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class SerraAviary extends mage.sets.homelands.SerraAviary { + + public SerraAviary(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public SerraAviary(final SerraAviary card) { + super(card); + } + + @Override + public SerraAviary copy() { + return new SerraAviary(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java new file mode 100644 index 00000000000..98ad22ed8a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.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.masterseditioniv; + +import java.util.UUID; +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.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author anonymous + */ +public class StaffOfZegon extends CardImpl { + + public StaffOfZegon(UUID ownerId) { + super(ownerId, 229, "Staff of Zegon", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "ME4"; + + // {3}, {tap}: Target creature gets -2/-0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-2, 0, Duration.EndOfTurn), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public StaffOfZegon(final StaffOfZegon card) { + super(card); + } + + @Override + public StaffOfZegon copy() { + return new StaffOfZegon(this); + } +} From 9bc36a37a9e756337b34e53fe07c062e784562fb Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:39:49 -0400 Subject: [PATCH 131/148] Acid Rain added --- Mage.Sets/src/mage/sets/legends/AcidRain.java | 65 +++++++++++++++++++ .../mage/sets/masterseditioniv/AcidRain.java | 52 +++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legends/AcidRain.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java diff --git a/Mage.Sets/src/mage/sets/legends/AcidRain.java b/Mage.Sets/src/mage/sets/legends/AcidRain.java new file mode 100644 index 00000000000..77cbd23ba5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/AcidRain.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.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author anonymous + */ +public class AcidRain extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("Forests"); + static { + filter.add(new SubtypePredicate("Forests")); + } + + public AcidRain(UUID ownerId) { + super(ownerId, 44, "Acid Rain", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}"); + this.expansionSetCode = "LEG"; + + // Destroy all Forests. + this.getSpellAbility().addEffect(new DestroyAllEffect(filter)); + } + + public AcidRain(final AcidRain card) { + super(card); + } + + @Override + public AcidRain copy() { + return new AcidRain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java new file mode 100644 index 00000000000..3364fb827a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class AcidRain extends mage.sets.legends.AcidRain { + + public AcidRain(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "ME4"; + } + + public AcidRain(final AcidRain card) { + super(card); + } + + @Override + public AcidRain copy() { + return new AcidRain(this); + } +} From 0e7f1759744a483dccb34bddab8ce9fbe7801d8d Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:43:15 -0400 Subject: [PATCH 132/148] Cloud Dragon added --- .../sets/masterseditioniv/CloudDragon.java | 66 +++++++++++++++++++ .../src/mage/sets/portal/CloudDragon.java | 52 +++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java create mode 100644 Mage.Sets/src/mage/sets/portal/CloudDragon.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java new file mode 100644 index 00000000000..346ed2c10a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CanBlockOnlyFlyingAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class CloudDragon extends CardImpl { + + public CloudDragon(UUID ownerId) { + super(ownerId, 41, "Cloud Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Illusion"); + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Cloud Dragon can block only creatures with flying. + this.addAbility(new CanBlockOnlyFlyingAbility()); + } + + public CloudDragon(final CloudDragon card) { + super(card); + } + + @Override + public CloudDragon copy() { + return new CloudDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portal/CloudDragon.java b/Mage.Sets/src/mage/sets/portal/CloudDragon.java new file mode 100644 index 00000000000..0f296f7deae --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/CloudDragon.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.portal; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class CloudDragon extends mage.sets.masterseditioniv.CloudDragon { + + public CloudDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "POR"; + } + + public CloudDragon(final CloudDragon card) { + super(card); + } + + @Override + public CloudDragon copy() { + return new CloudDragon(this); + } +} From 2c9c2b943209ec063b3491928426d530d16d95b0 Mon Sep 17 00:00:00 2001 From: Marshall Date: Thu, 18 Jun 2015 22:48:32 -0400 Subject: [PATCH 133/148] Phantasmal Forces added --- .../sets/fifthedition/PhantasmalForces.java | 52 ++++++++++++++ .../sets/fourthedition/PhantasmalForces.java | 68 +++++++++++++++++++ .../sets/limitedalpha/PhantasmalForces.java | 52 ++++++++++++++ .../sets/limitedbeta/PhantasmalForces.java | 52 ++++++++++++++ .../masterseditioniv/PhantasmalForces.java | 54 +++++++++++++++ .../sets/revisededition/PhantasmalForces.java | 52 ++++++++++++++ .../unlimitededition/PhantasmalForces.java | 52 ++++++++++++++ 7 files changed, 382 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java new file mode 100644 index 00000000000..66a87d3c2c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "5ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java new file mode 100644 index 00000000000..eb4c8632ca2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.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.fourthedition; + +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.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends CardImpl { + + public PhantasmalForces(UUID ownerId) { + super(ownerId, 88, "Phantasmal Forces", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Illusion"); + this.power = new MageInt(4); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // At the beginning of your upkeep, sacrifice Phantasmal Forces unless you pay {U}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), TargetController.YOU, false)); + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java new file mode 100644 index 00000000000..2a21c51caf1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "LEA"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java new file mode 100644 index 00000000000..26f73deb1c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "LEB"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java new file mode 100644 index 00000000000..a0423b8bc0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.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.masterseditioniv; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 55; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java new file mode 100644 index 00000000000..2dd68aefcc1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.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.revisededition; + +import java.util.UUID; + +/** + * + * @author anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 69; + this.expansionSetCode = "3ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java new file mode 100644 index 00000000000..bfcfed29b27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.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 anonymous + */ +public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces { + + public PhantasmalForces(UUID ownerId) { + super(ownerId); + this.cardNumber = 68; + this.expansionSetCode = "2ED"; + } + + public PhantasmalForces(final PhantasmalForces card) { + super(card); + } + + @Override + public PhantasmalForces copy() { + return new PhantasmalForces(this); + } +} From 47f2ba3b3d6358c12efe795cee4625c85f4ed158 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 02:03:27 +0200 Subject: [PATCH 134/148] Added test for Scythe of the Wretched. --- .../equipped/ScytheOfTheWretchedTest.java | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java new file mode 100644 index 00000000000..06bc16cf28d --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java @@ -0,0 +1,185 @@ +/* + * 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.abilities.equipped; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.game.permanent.Permanent; +import org.junit.Assert; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ + +public class ScytheOfTheWretchedTest extends CardTestPlayerBase { + + /** + * Test that the creature taht died returns to battlefield under your control + * if the previous equiped creature does not die + */ + @Test + public void testEquipAlive() { + addCard(Zone.BATTLEFIELD, playerA, "Soulmender", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + // Equipped creature gets +2/+2. + // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature. + // Equip {4} + addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched"); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Soulmender", "Silvercoat Lion"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Soulmender", 0); + assertPermanentCount(playerB, "Soulmender", 1); + assertPowerToughness(playerB, "Soulmender", 3, 3); + + assertPowerToughness(playerB, "Silvercoat Lion", 2, 2); + + Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerB.getId()); + Assert.assertTrue("Silvercoat Lion may not have any attachments", silvercoatLion.getAttachments().isEmpty()); + } + /** + * Test that the creature that died returns to battlefield under your control + * if the previous equiped creature does die after equipment is removed + */ + @Test + public void testEquipDied() { + addCard(Zone.BATTLEFIELD, playerA, "Oreskos Swiftclaw", 1); // 3/1 + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + // Equipped creature gets +2/+2. + // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature. + // Equip {4} + addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched"); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Oreskos Swiftclaw", "Silvercoat Lion"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Oreskos Swiftclaw", 0); + assertPermanentCount(playerB, "Oreskos Swiftclaw", 1); + assertPowerToughness(playerB, "Oreskos Swiftclaw", 5, 3); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + } + + /** + * Test that the creature that died returns to battlefield under your control + * if the previous equiped creature does die already in combat + */ + @Test + public void testEquipDiedInCombat() { + addCard(Zone.BATTLEFIELD, playerA, "Serra Angel", 1); // 4/4 + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + // Equipped creature gets +2/+2. + // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature. + // Equip {4} + addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched"); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Serra Angel", "Silvercoat Lion"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertPermanentCount(playerA, "Serra Angel", 0); + assertPermanentCount(playerB, "Serra Angel", 1); + assertPowerToughness(playerB, "Serra Angel", 6, 6); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + } + + + /** + * Test that the creature that died returns to battlefield under your control + * if the previous equiped creature does die already in combat and the equipment was destroyed meanwhile + */ + @Test + public void testEquipDiedInCombat2() { + addCard(Zone.BATTLEFIELD, playerA, "Serra Angel", 1); // 4/4 + addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Disenchant", 1); + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 4); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); + // Equipped creature gets +2/+2. + // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature. + // Equip {4} + addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched"); + + activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion"); + + attack(2, playerB, "Silvercoat Lion"); + block(2, playerA, "Serra Angel", "Silvercoat Lion"); + + castSpell(2, PhaseStep.COMBAT_DAMAGE, playerA, "Disenchant", "Scythe of the Wretched", "Whenever a creature dealt damage"); + + setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertLife(playerA, 20); + assertLife(playerB, 20); + + assertGraveyardCount(playerA, "Disenchant", 1); + assertGraveyardCount(playerB, "Scythe of the Wretched", 1); + + assertPermanentCount(playerA, "Serra Angel", 0); + assertPermanentCount(playerB, "Serra Angel", 1); + assertPowerToughness(playerB, "Serra Angel", 4, 4); + + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + } +} \ No newline at end of file From 2be016a4112fd1fbf36ca0dfd9930944f676074b Mon Sep 17 00:00:00 2001 From: Marshall Date: Fri, 19 Jun 2015 20:11:09 -0400 Subject: [PATCH 135/148] Fixes for Acid Rain & Horn of Deafening --- Mage.Sets/src/mage/sets/legends/AcidRain.java | 2 +- Mage.Sets/src/mage/sets/legends/HornOfDeafening.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legends/AcidRain.java b/Mage.Sets/src/mage/sets/legends/AcidRain.java index 77cbd23ba5b..3cde320343e 100644 --- a/Mage.Sets/src/mage/sets/legends/AcidRain.java +++ b/Mage.Sets/src/mage/sets/legends/AcidRain.java @@ -43,7 +43,7 @@ public class AcidRain extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Forests"); static { - filter.add(new SubtypePredicate("Forests")); + filter.add(new SubtypePredicate("Forest")); } public AcidRain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java index 4ce8837efc2..4c89862c354 100644 --- a/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java +++ b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java @@ -40,6 +40,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; /** * @@ -56,6 +57,7 @@ public class HornOfDeafening extends CardImpl { effect.setText("Prevent all combat damage that would be dealt by target creature this turn."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}")); ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } From dc545bc13a1455265df7f0c1ecdd7627dbba0109 Mon Sep 17 00:00:00 2001 From: Marshall Date: Fri, 19 Jun 2015 20:39:24 -0400 Subject: [PATCH 136/148] Staff of Zegon fixed --- Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java index 98ad22ed8a1..fd9f8cd3f42 100644 --- a/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java +++ b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java @@ -32,12 +32,13 @@ 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.BoostSourceEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; 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; /** * @@ -50,8 +51,9 @@ public class StaffOfZegon extends CardImpl { this.expansionSetCode = "ME4"; // {3}, {tap}: Target creature gets -2/-0 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(-2, 0, Duration.EndOfTurn), new ManaCostsImpl("{3}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, 0, Duration.EndOfTurn), new ManaCostsImpl("{3}")); ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } From 223dd16d04d2b23381ae14d17312a0570d2e0644 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 11:57:00 +0200 Subject: [PATCH 137/148] * Shifting Sky - Fixed not working color set effect. --- .../src/mage/sets/planeshift/ShiftingSky.java | 75 ++++++------------- 1 file changed, 22 insertions(+), 53 deletions(-) diff --git a/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java b/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java index cf386bea42c..571b76aae4a 100644 --- a/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java +++ b/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java @@ -32,12 +32,15 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.ChooseColorEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.SubLayer; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; @@ -48,7 +51,7 @@ import mage.players.Player; /** * - * @author anonymous + * @author Luna Skyrise */ public class ShiftingSky extends CardImpl { @@ -57,11 +60,10 @@ public class ShiftingSky extends CardImpl { this.expansionSetCode = "PLS"; // As Shifting Sky enters the battlefield, choose a color. - Ability ability = new EntersBattlefieldTriggeredAbility(new ChooseColorEffect(Outcome.Benefit)); - this.addAbility(ability); - // All nonland permanents are the chosen color. - Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new ShiftingSkyEffect()); - this.addAbility(ability2); + this.addAbility(new EntersBattlefieldTriggeredAbility(new ChooseColorEffect(Outcome.Detriment))); + + // All nonland permanents are the chosen color. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShiftingSkyEffect())); } public ShiftingSky(final ShiftingSky card) { @@ -74,75 +76,42 @@ public class ShiftingSky extends CardImpl { } } -class ShiftingSkyEffect extends OneShotEffect { +class ShiftingSkyEffect extends ContinuousEffectImpl { + private static final FilterPermanent filter = new FilterPermanent("All nonland permanents"); static { - filter.add( - Predicates.not( - new CardTypePredicate(CardType.LAND) - ) - ); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } - + public ShiftingSkyEffect() { - super(Outcome.Benefit); + super(Duration.WhileOnBattlefield, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit); staticText = "All nonland permanents are the chosen color"; } - public ShiftingSkyEffect(final ShiftingSkyEffect effect) { - super(effect); - } - @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - - if (player != null && permanent != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); - if (color == null) { return false; } - - String colorString = color.toString(); - - for (UUID playerId : player.getInRange()) { - Player p = game.getPlayer(playerId); - if (p != null) { - for (Permanent chosen : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) { - setObject(chosen, colorString, game); - } - } + for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + perm.getColor(game).setColor(color); } return true; } return false; } - + @Override public ShiftingSkyEffect copy() { return new ShiftingSkyEffect(this); } - private void setObject(Permanent chosen, String colorString, Game game) { - switch (colorString) { - case "W": - chosen.getColor(game).setWhite(true); - break; - case "B": - chosen.getColor(game).setBlack(true); - break; - case "U": - chosen.getColor(game).setBlue(true); - break; - case "G": - chosen.getColor(game).setGreen(true); - break; - case "R": - chosen.getColor(game).setRed(true); - break; - } + private ShiftingSkyEffect(ShiftingSkyEffect effect) { + super(effect); } + } From 8f39a0ba1db7fd009d309ec2e64967410c8a8cc9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 11:57:52 +0200 Subject: [PATCH 138/148] * Added test, some mior changes. --- .../sets/zendikar/IonaShieldOfEmeria.java | 42 ++--------------- .../abilities/keywords/FlashbackTest.java | 46 +++++++++++++++++++ .../effects/common/ChooseColorEffect.java | 5 +- 3 files changed, 52 insertions(+), 41 deletions(-) diff --git a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java index 6bf1a7ce352..91fc8f24195 100644 --- a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java +++ b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java @@ -35,11 +35,10 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseColorEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.choices.ChoiceColor; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -47,9 +46,6 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.util.CardUtil; /** * @@ -70,7 +66,7 @@ public class IonaShieldOfEmeria extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // As Iona, Shield of Emeria enters the battlefield, choose a color. - this.addAbility(new AsEntersBattlefieldAbility(new IonaShieldOfEmeriaChooseColorEffect())); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Benefit))); // Your opponents can't cast spells of the chosen color. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IonaShieldOfEmeriaReplacementEffect())); @@ -87,39 +83,6 @@ public class IonaShieldOfEmeria extends CardImpl { } } -class IonaShieldOfEmeriaChooseColorEffect extends OneShotEffect { - - public IonaShieldOfEmeriaChooseColorEffect() { - super(Outcome.Detriment); - staticText = "choose a color"; - } - - public IonaShieldOfEmeriaChooseColorEffect(final IonaShieldOfEmeriaChooseColorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - Permanent permanent = game.getPermanent(source.getSourceId()); - if (player != null && permanent != null) { - ChoiceColor colorChoice = new ChoiceColor(); - if (player.choose(Outcome.Detriment, colorChoice, game)) { - game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice()); - game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor()); - permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + colorChoice.getColor().getDescription()), game); - } - return true; - } - return false; - } - - @Override - public IonaShieldOfEmeriaChooseColorEffect copy() { - return new IonaShieldOfEmeriaChooseColorEffect(this); - } -} - class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectImpl { IonaShieldOfEmeriaReplacementEffect() { @@ -150,6 +113,7 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectI public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId()) ) { ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); + // spell is not on the stack yet, so we have to check the card Card card = game.getCard(event.getSourceId()); if (chosenColor != null && card != null && card.getColor(game).contains(chosenColor)) { return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java index e3786359193..52dff9e173a 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java @@ -75,4 +75,50 @@ public class FlashbackTest extends CardTestPlayerBase { assertExileCount("Fracturing Gust", 1); } + /** + * My opponent put Iona on the battlefield using Unburial Rites, but my game + * log didn't show me the color he has chosen. + * + */ + @Test + public void testUnburialRites() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); + addCard(Zone.BATTLEFIELD, playerA, "Plains", 8); + // Return target creature card from your graveyard to the battlefield. + // Flashback {3}{W} + addCard(Zone.HAND, playerA, "Unburial Rites", 1); // Sorcery - {4}{B} + + // Flying + // As Iona, Shield of Emeria enters the battlefield, choose a color. + // Your opponents can't cast spells of the chosen color. + addCard(Zone.GRAVEYARD, playerA, "Iona, Shield of Emeria"); + + // As Lurebound Scarecrow enters the battlefield, choose a color. + // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow. + addCard(Zone.GRAVEYARD, playerA, "Lurebound Scarecrow"); // Enchantment - {2}{U} + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unburial Rites", "Iona, Shield of Emeria"); + setChoice(playerA, "Red"); + + activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {3}{W}"); + addTarget(playerA, "Lurebound Scarecrow"); + setChoice(playerA, "White"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerA, "Iona, Shield of Emeria", 1); + assertPermanentCount(playerA, "Lurebound Scarecrow", 1); + + assertHandCount(playerB, "Lightning Bolt", 1); + + assertExileCount("Unburial Rites", 1); + } + } diff --git a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java index ff5d4cee3c7..76c84fba229 100644 --- a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java +++ b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java @@ -35,6 +35,7 @@ import mage.constants.Outcome; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.util.CardUtil; /** * @@ -64,10 +65,10 @@ public class ChooseColorEffect extends OneShotEffect { } } if (!game.isSimulation()) { - game.informPlayers(new StringBuilder(permanent.getLogName()).append(": ").append(controller.getLogName()).append(" has chosen ").append(choice.getChoice()).toString()); + game.informPlayers(permanent.getLogName()+": "+controller.getLogName()+" has chosen "+choice.getChoice()); } game.getState().setValue(source.getSourceId() + "_color", choice.getColor()); - permanent.addInfo("chosen color", "Chosen color: " + choice.getColor().getDescription() + "", game); + permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game); return true; } return false; From 675801e8d493b023add4333e7835751d20da07a1 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 12:50:05 +0200 Subject: [PATCH 139/148] * Fixed that it was not possible to win by commander damage. --- .../src/mage/sets/innistrad/MaskOfAvacyn.java | 9 +++++++-- .../src/mage/sets/magic2013/RingOfThune.java | 2 +- Mage/src/mage/game/GameCommanderImpl.java | 16 +++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java index cfb3ed4a2cc..298f51a5558 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java +++ b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java @@ -37,6 +37,8 @@ import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.Effect; /** * @author nantuko @@ -52,8 +54,11 @@ public class MaskOfAvacyn extends CardImpl { this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); // Equipped creature gets +1/+2 and has hexproof. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT))); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2))); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT)); + Effect effect = new BoostEquippedEffect(1, 2); + effect.setText("and has hexproof"); + ability.addEffect(effect); + this.addAbility(ability); } public MaskOfAvacyn(final MaskOfAvacyn card) { diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java index 637c8521d8c..08c01e41a5a 100644 --- a/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java +++ b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java @@ -67,7 +67,7 @@ public class RingOfThune extends CardImpl { // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white. TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white"); + ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white."); this.addAbility(ability); // Equip {1} diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java index 4a12851b2e2..92fbac34254 100644 --- a/Mage/src/mage/game/GameCommanderImpl.java +++ b/Mage/src/mage/game/GameCommanderImpl.java @@ -56,8 +56,10 @@ import mage.watchers.common.CommanderInfoWatcher; public abstract class GameCommanderImpl extends GameImpl { + static boolean CHECK_COMMANDER_DAMAGE = true; + private final Map mulliganedCards = new HashMap<>(); - private final Set commanderCombatWatcher = new HashSet<>(); + // private final Set commanderCombatWatcher = new HashSet<>(); protected boolean alsoHand; // replace commander going to hand protected boolean alsoLibrary; // replace commander going to library @@ -91,9 +93,8 @@ public abstract class GameCommanderImpl extends GameImpl { ability.addEffect(new CommanderCostModification(commander.getId())); ability.addEffect(new CommanderManaReplacementEffect(player.getId(), CardUtil.getColorIdentity(commander))); getState().setValue(commander.getId() + "_castCount", 0); - CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), true); + CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), CHECK_COMMANDER_DAMAGE); getState().getWatchers().add(watcher); - this.commanderCombatWatcher.add(watcher); watcher.addCardInfoToCommander(this); } } @@ -185,12 +186,13 @@ public abstract class GameCommanderImpl extends GameImpl { */ @Override protected boolean checkStateBasedActions() { - for (CommanderInfoWatcher damageWatcher: commanderCombatWatcher) { + for (Player player: getPlayers().values()) { + CommanderInfoWatcher damageWatcher = (CommanderInfoWatcher) getState().getWatchers().get("CommanderCombatDamageWatcher", player.getCommanderId()); for(Map.Entry entrySet : damageWatcher.getDamageToPlayer().entrySet()){ if (entrySet.getValue() > 20) { - Player player = getPlayer(entrySet.getKey()); - if (player != null && player.isInGame()){ - player.lost(this); + Player opponent = getPlayer(entrySet.getKey()); + if (opponent != null && player.isInGame()){ + opponent.lost(this); } } } From 757b9ea99ec1f0ce46bb533f9f86f3473d122a60 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 13:14:06 +0200 Subject: [PATCH 140/148] * XMage Release 1.4.1v3 --- Mage.Common/src/mage/utils/MageVersion.java | 2 +- Mage/src/mage/cards/repository/CardRepository.java | 2 +- Utils/release/getting_implemented_cards.txt | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java index 5a9acc7466c..36583d77a39 100644 --- a/Mage.Common/src/mage/utils/MageVersion.java +++ b/Mage.Common/src/mage/utils/MageVersion.java @@ -42,7 +42,7 @@ public class MageVersion implements Serializable, Comparable { public final static int MAGE_VERSION_MAJOR = 1; public final static int MAGE_VERSION_MINOR = 4; public final static int MAGE_VERSION_PATCH = 1; - public final static String MAGE_VERSION_MINOR_PATCH = "v2"; + public final static String MAGE_VERSION_MINOR_PATCH = "v3"; public final static String MAGE_VERSION_INFO = ""; private final int major; diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java index 6cfd22889bb..587634b3871 100644 --- a/Mage/src/mage/cards/repository/CardRepository.java +++ b/Mage/src/mage/cards/repository/CardRepository.java @@ -60,7 +60,7 @@ public enum CardRepository { // raise this if db structure was changed private static final long CARD_DB_VERSION = 39; // raise this if new cards were added to the server - private static final long CARD_CONTENT_VERSION = 19; + private static final long CARD_CONTENT_VERSION = 20; private final Random random = new Random(); private Dao cardDao; diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt index 203bc260828..875530ee3ee 100644 --- a/Utils/release/getting_implemented_cards.txt +++ b/Utils/release/getting_implemented_cards.txt @@ -137,6 +137,10 @@ git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-st since 1.4.1.v1 git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt +since 1.4.1.v2 +git log 675801e8d493b023add4333e7835751d20da07a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt + + 3. Copy added_cards.txt to trunk\Utils folder 4. Run script: > perl extract_in_wiki_format.perl From 03dcc4a9f60d003514ae7960ccf4b220de909c5f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 19:53:11 +0200 Subject: [PATCH 141/148] Added Menace ability. --- .../keyword/CantBlockAloneAttachedEffect.java | 15 -------- .../mage/abilities/keyword/HauntAbility.java | 1 - .../mage/abilities/keyword/MenaceAbility.java | 38 +++++++++++++++++++ Utils/keywords.txt | 1 + 4 files changed, 39 insertions(+), 16 deletions(-) delete mode 100644 Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java create mode 100644 Mage/src/mage/abilities/keyword/MenaceAbility.java diff --git a/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java b/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java deleted file mode 100644 index 06b01440a2a..00000000000 --- a/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -package mage.abilities.keyword; - -/** - * - * @author ludwig.hirth - */ -public class CantBlockAloneAttachedEffect { - -} diff --git a/Mage/src/mage/abilities/keyword/HauntAbility.java b/Mage/src/mage/abilities/keyword/HauntAbility.java index 76e3ebc6f09..d9e276b1ec7 100644 --- a/Mage/src/mage/abilities/keyword/HauntAbility.java +++ b/Mage/src/mage/abilities/keyword/HauntAbility.java @@ -40,7 +40,6 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; diff --git a/Mage/src/mage/abilities/keyword/MenaceAbility.java b/Mage/src/mage/abilities/keyword/MenaceAbility.java new file mode 100644 index 00000000000..cad29e9ab9f --- /dev/null +++ b/Mage/src/mage/abilities/keyword/MenaceAbility.java @@ -0,0 +1,38 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.keyword; + +import mage.abilities.Ability; +import mage.abilities.StaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect; +import mage.abilities.effects.common.combat.CantBeBlockedByOneEffect; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class MenaceAbility extends StaticAbility { + + public MenaceAbility() { + super(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2)); + } + + public MenaceAbility(MenaceAbility ability) { + super(ability); + } + + @Override + public Ability copy() { + return new MenaceAbility(this); + } + + @Override + public String getRule() { + return "Menace (This creature can't be blocked except by two or more creatures.)"; + } + +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 7c0e7fe9236..57945d8a0fa 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -37,6 +37,7 @@ Islandwalk|new| Level up|cost| Lifelink|instance| Living weapon|new| +Menace|new| Miracle|cost| Mountaincycling|cost| Mountainwalk|new| From 1668783ba2c87b5fe82e42d8b5ff4795111c1eed Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 19:53:41 +0200 Subject: [PATCH 142/148] Added damage done watcher. --- Mage/src/mage/MageObjectReference.java | 6 +- .../common/CardsInOpponentGraveCondition.java | 2 +- .../common/SourceDealtDamageCondition.java | 37 ++++++++++ Mage/src/mage/game/GameImpl.java | 2 + .../watchers/common/DamageDoneWatcher.java | 67 +++++++++++++++++++ 5 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java create mode 100644 Mage/src/mage/watchers/common/DamageDoneWatcher.java diff --git a/Mage/src/mage/MageObjectReference.java b/Mage/src/mage/MageObjectReference.java index b406030eb94..8242aff19ad 100644 --- a/Mage/src/mage/MageObjectReference.java +++ b/Mage/src/mage/MageObjectReference.java @@ -69,7 +69,11 @@ public class MageObjectReference implements Comparable, Ser if (mageObject != null) { this.zoneChangeCounter = mageObject.getZoneChangeCounter(game); } else { - throw new IllegalArgumentException("The provided sourceId is not connected to an object in the game"); + if (game.getPlayerList().contains(sourceId)) { + this.zoneChangeCounter = 0; + } else { + throw new IllegalArgumentException("The provided sourceId is not connected to an object in the game"); + } } } diff --git a/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java b/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java index 6c825961335..1c2d203d2c9 100644 --- a/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java +++ b/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java @@ -13,7 +13,7 @@ import java.util.UUID; * @author Loki */ public class CardsInOpponentGraveCondition implements Condition { - private int value; + private final int value; public CardsInOpponentGraveCondition(int value) { this.value = value; diff --git a/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java b/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java new file mode 100644 index 00000000000..0a4f7044e12 --- /dev/null +++ b/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.game.Game; +import mage.watchers.common.DamageDoneWatcher; + +/** + * + * @author LevelX2 + */ + +public class SourceDealtDamageCondition implements Condition { + private final int value; + + public SourceDealtDamageCondition(int value) { + this.value = value; + } + + @Override + public boolean apply(Game game, Ability source) { + DamageDoneWatcher watcher = (DamageDoneWatcher) game.getState().getWatchers().get("DamageDone"); + return watcher != null && watcher.damageDone(source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game) >= value; + } + + @Override + public String toString() { + return "{this} has dealt " + value + " or more damage this turn" ; + } + + +} \ No newline at end of file diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 28383956d02..49aa03847d3 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -122,6 +122,7 @@ import mage.watchers.Watchers; import mage.watchers.common.BlockedAttackerWatcher; import mage.watchers.common.BloodthirstWatcher; import mage.watchers.common.CastSpellLastTurnWatcher; +import mage.watchers.common.DamageDoneWatcher; import mage.watchers.common.MorbidWatcher; import mage.watchers.common.PlayerDamagedBySourceWatcher; import mage.watchers.common.PlayerLostLifeWatcher; @@ -912,6 +913,7 @@ public abstract class GameImpl implements Game, Serializable { watchers.add(new SoulbondWatcher()); watchers.add(new PlayerLostLifeWatcher()); watchers.add(new BlockedAttackerWatcher()); + watchers.add(new DamageDoneWatcher()); //20100716 - 103.5 for (UUID playerId: state.getPlayerList(startingPlayerId)) { diff --git a/Mage/src/mage/watchers/common/DamageDoneWatcher.java b/Mage/src/mage/watchers/common/DamageDoneWatcher.java new file mode 100644 index 00000000000..df94911ebc6 --- /dev/null +++ b/Mage/src/mage/watchers/common/DamageDoneWatcher.java @@ -0,0 +1,67 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.watchers.common; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mage.MageObjectReference; +import mage.constants.WatcherScope; +import mage.game.Game; +import mage.game.events.DamageEvent; +import mage.game.events.GameEvent; +import mage.watchers.Watcher; + +/** + * + * @author LevelX2 + */ + +public class DamageDoneWatcher extends Watcher { + + // which object did how much damage during the turn + public Map damagingObjects = new HashMap<>(); + + public DamageDoneWatcher() { + super("DamageDone", WatcherScope.GAME); + } + + public DamageDoneWatcher(final DamageDoneWatcher watcher) { + super(watcher); + this.damagingObjects.putAll(damagingObjects); + } + + @Override + public DamageDoneWatcher copy() { + return new DamageDoneWatcher(this); + } + + @Override + public void watch(GameEvent event, Game game) { + switch(event.getType()) { + case DAMAGED_CREATURE: + case DAMAGED_PLANESWALKER: + case DAMAGED_PLAYER: + { + MageObjectReference mor = new MageObjectReference(event.getSourceId(), game); + int count = damagingObjects.containsKey(mor) ? damagingObjects.get(mor) : 0; + damagingObjects.put(mor, count + event.getAmount()); + } + } + } + + @Override + public void reset() { + super.reset(); + damagingObjects.clear(); + } + + public int damageDone(UUID objectId, int zoneChangeCounter, Game game) { + MageObjectReference mor = new MageObjectReference(objectId, zoneChangeCounter, game); + return damagingObjects.containsKey(mor) ? damagingObjects.get(mor) : 0; + } + +} From 613fbd26e3df3b44f0bc51da84ef560707a062f4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 19:54:57 +0200 Subject: [PATCH 143/148] [ORI] Added Boggart Brute, Chandra FIre of Kaladesh, Lighning Javelin, Pia and Kiran Nalaar. --- .../mage/sets/magicorigins/BoggartBrute.java | 63 ++++++++ .../magicorigins/ChandraFireOfKaladesh.java | 96 ++++++++++++ .../magicorigins/ChandraRoaringFlame.java | 146 ++++++++++++++++++ .../sets/magicorigins/LightningJavelin.java | 63 ++++++++ .../sets/magicorigins/PiaAndKiranNalaar.java | 95 ++++++++++++ 5 files changed, 463 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java diff --git a/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java b/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java new file mode 100644 index 00000000000..e4778a4b55d --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LevelX2 + */ +public class BoggartBrute extends CardImpl { + + public BoggartBrute(UUID ownerId) { + super(ownerId, 133, "Boggart Brute", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Goblin"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Menace + this.addAbility(new MenaceAbility()); + } + + public BoggartBrute(final BoggartBrute card) { + super(card); + } + + @Override + public BoggartBrute copy() { + return new BoggartBrute(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java b/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java new file mode 100644 index 00000000000..a81cf2576b9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java @@ -0,0 +1,96 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.condition.common.SourceDealtDamageCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect; +import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class ChandraFireOfKaladesh extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a red spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public ChandraFireOfKaladesh(UUID ownerId) { + super(ownerId, 135, "Chandra, Fire of Kaladesh", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Shaman"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + this.canTransform = true; + this.secondSideCard = new ChandraRoaringFlame(ownerId); + + // Whenever you cast a red spell, untap Chandra, Fire of Kaladesh. + this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false)); + + // {T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control. + this.addAbility(new TransformAbility()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + ability.addEffect(new ConditionalOneShotEffect(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new SourceDealtDamageCondition(3))); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + } + + public ChandraFireOfKaladesh(final ChandraFireOfKaladesh card) { + super(card); + } + + @Override + public ChandraFireOfKaladesh copy() { + return new ChandraFireOfKaladesh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java new file mode 100644 index 00000000000..a12cfc19dd7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java @@ -0,0 +1,146 @@ +/* + * 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.magicorigins; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageSelfEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.command.Emblem; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ChandraRoaringFlame extends CardImpl { + + public ChandraRoaringFlame(UUID ownerId) { + super(ownerId, 135, "Chandra, Roaring Flame", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, ""); + this.expansionSetCode = "ORI"; + this.subtype.add("Chandra"); + this.color.setRed(true); + + this.nightCard = true; + this.canTransform = true; + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + + // +1: Chandra, Roaring Flame deals 2 damage to target player. + LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), 1); + loyaltyAbility.addTarget(new TargetPlayer()); + this.addAbility(loyaltyAbility); + + //-2: Chandra, Roaring Flame deals 2 damage to target creature. + loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), -2); + loyaltyAbility.addTarget(new TargetCreaturePermanent()); + this.addAbility(loyaltyAbility); + + //-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you." + this.addAbility(new LoyaltyAbility(new ChandraRoaringFlameEmblemEffect(), -7)); + + + } + + public ChandraRoaringFlame(final ChandraRoaringFlame card) { + super(card); + } + + @Override + public ChandraRoaringFlame copy() { + return new ChandraRoaringFlame(this); + } +} + +class ChandraRoaringFlameEmblemEffect extends OneShotEffect { + + public ChandraRoaringFlameEmblemEffect() { + super(Outcome.Damage); + this.staticText = "{this} deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with \"At the beginning of your upkeep, this emblem deals 3 damage to you.\""; + } + + public ChandraRoaringFlameEmblemEffect(final ChandraRoaringFlameEmblemEffect effect) { + super(effect); + } + + @Override + public ChandraRoaringFlameEmblemEffect copy() { + return new ChandraRoaringFlameEmblemEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + List opponentsEmblem = new ArrayList<>(); + for(UUID playerId: game.getOpponents(controller.getId())) { + Player opponent = game.getPlayer(playerId); + if (opponent != null) { + if (opponent.damage(6, source.getSourceId(), game, false, true) > 0) { + opponentsEmblem.add(opponent); + } + } + } + for (Player opponent : opponentsEmblem) { + game.addEmblem(new ChandraRoaringFlameEmblem(), source, opponent.getId()); + } + } + return false; + } +} + +/** + * Emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you." + */ +class ChandraRoaringFlameEmblem extends Emblem { + + public ChandraRoaringFlameEmblem() { + setName("EMBLEM: Chandra, Roaring Flame"); + Effect effect = new DamageTargetEffect(3); + effect.setText("this emblem deals 3 damage to you"); + this.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, effect, TargetController.YOU, false, true)); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java b/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java new file mode 100644 index 00000000000..f81246bc81b --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.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.magicorigins; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.keyword.ScryEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class LightningJavelin extends CardImpl { + + public LightningJavelin(UUID ownerId) { + super(ownerId, 153, "Lightning Javelin", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); + this.expansionSetCode = "ORI"; + + // Lightning Javelin deals 3 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); + // Scry 1. + this.getSpellAbility().addEffect(new ScryEffect(1)); + } + + public LightningJavelin(final LightningJavelin card) { + super(card); + } + + @Override + public LightningJavelin copy() { + return new LightningJavelin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java new file mode 100644 index 00000000000..62aa3fc7883 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java @@ -0,0 +1,95 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.game.permanent.token.Token; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LevelX2 + */ +public class PiaAndKiranNalaar extends CardImpl { + + public PiaAndKiranNalaar(UUID ownerId) { + super(ownerId, 157, "Pia and Kiran Nalaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "ORI"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PiaAndKiranNalaarThopterToken(), 2))); + + // {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledArtifactPermanent("an artifact"),true))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public PiaAndKiranNalaar(final PiaAndKiranNalaar card) { + super(card); + } + + @Override + public PiaAndKiranNalaar copy() { + return new PiaAndKiranNalaar(this); + } +} + + +class PiaAndKiranNalaarThopterToken extends Token { + PiaAndKiranNalaarThopterToken() { + super("Thopter", "a 1/1 colorless Thopter artifact creature token with flying"); + cardType.add(CardType.CREATURE); + cardType.add(CardType.ARTIFACT); + subtype.add("Thopter"); + power = new MageInt(1); + toughness = new MageInt(1); + this.addAbility(FlyingAbility.getInstance()); + } +} \ No newline at end of file From 911c239074044b0bcfc810c2a7056ebbff6e4f4e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 19:59:12 +0200 Subject: [PATCH 144/148] [ORI] Updated mtg-cards-data.txt (90 cards). --- Utils/mtg-cards-data.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 7539be256da..00a8867a887 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -26217,6 +26217,7 @@ Jace, Vryn's Prodigy|Magic Origins|60|M|{1}{U}{1}{U}|Legendary Creature - Human Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$Whenever Jhessian Thief deals combat damage to a player, draw a card.| Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying (This creature can't be blocked except by creatures with flying or reach.)$Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)| Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.| +Sphinx's Tutelage|Magic Origins|76|U|{2}{U}|Enchantment|||Whenever you draw a card, target opponent puts the top two cards of his or her library into his or her graveyard. If they're both nonland cards that share a color, repeat this process.${5}{U}: Draw a card, then discard a card.| Into the Void|Magic Origins|277|U|{3}{U}{3}{U}|Sorcery|||Return up to two target creatures to their owners' hands.$Return up to two target creatures to their owners' hands.| Mahamoti Djinn|Magic Origins|278|R|{4}{U}{U}{4}{U}{U}|Creature - Djinn|5|65|6|Flying$Flying| Weave Fate|Magic Origins|279|C|{3}{U}{3}{U}|Instant|||Draw two cards.$Draw two cards.| @@ -26263,6 +26264,7 @@ Vastwood Gorger|Magic Origins|?|C|{5}{G}{5}{G}|Creature - Wurm|5|65|6|| Yeva's Forcemage|Magic Origins|?|C|{2}{G}{2}{G}|Creature - Elf Shaman|2|22|2|When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.$When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.| Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.| Dwynen, Gilt-Leaf Daen|Magic Origins|172|R|{2}{G}{G}|Legendary Creature - Elf Warrior|3|4|Reach$Other Elf creatures you control get +1/+1.$Whenever Dwynen, Gilt-Leaf Daen attacks, you gain 1 life for each attacking Elf you control.| +Elemental Bond|Magic Origins|174|U|{2}{G}|Enchantment|||Whenever a creature with power 3 or greater enters the battlefield under your control, draw a card.| Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach| Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.| Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.| @@ -26271,6 +26273,7 @@ Nissa, Vastwood Seer|Magic Origins|189|M|{2}{G}{2}{G}|Legendary Creature - Elf S Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.| Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.| Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample| +Zendikar Incarnate|Magic Origins|219|U|{2}{R}{G}|Creature - Elemental|0|4|Zendikar Incarnate's power is equal to the amount of lands you control.| Meteorite|Magic Origins|?|U|{5}{5}|Artifact|||When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.$When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.| Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying| Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.| From 1acf0fa509a565cee4e2dc34b1e7d9551b08ac35 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 20 Jun 2015 23:38:43 +0200 Subject: [PATCH 145/148] Forcefield, added a log text about the chosen creature. --- Mage.Sets/src/mage/sets/mastersedition/Forcefield.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java index cc7ebcd2527..dd707a170d4 100644 --- a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java +++ b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java @@ -28,6 +28,7 @@ package mage.sets.mastersedition; import java.util.UUID; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -45,6 +46,7 @@ import mage.filter.predicate.permanent.UnblockedPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -98,9 +100,14 @@ class ForcefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + MageObject sourceObject = source.getSourceObject(game); + if (controller != null && sourceObject != null) { Target target = new TargetCreaturePermanent(1, 1, filter, true); if (controller.choose(Outcome.PreventDamage, target, source.getSourceId(), game)) { + Permanent creature = game.getPermanent(target.getFirstTarget()); + if (creature != null) { + game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + creature.getLogName()); + } ContinuousEffect effect = new ForcefieldPreventionEffect(); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); From 0ef8fbf567ee78a8ffc16f2741a6ece24dee8640 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 21 Jun 2015 01:31:38 +0200 Subject: [PATCH 146/148] [ORI] Added 5 red cards. --- .../mage/sets/journeyintonyx/Starfall.java | 1 - .../src/mage/sets/magic2012/TectonicRift.java | 50 +++------ .../src/mage/sets/magic2014/SeismicStomp.java | 48 ++------ .../sets/magicorigins/EnthrallingVictor.java | 90 +++++++++++++++ .../mage/sets/magicorigins/RavagingBlaze.java | 105 ++++++++++++++++++ .../sets/magicorigins/SeismicElemental.java | 74 ++++++++++++ .../sets/magicorigins/SubterraneanScout.java | 78 +++++++++++++ .../sets/magicorigins/VolcanicRambler.java | 71 ++++++++++++ .../common/SpellMasteryCondition.java | 51 +++++++++ 9 files changed, 493 insertions(+), 75 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java create mode 100644 Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java create mode 100644 Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java b/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java index 6bd88fd895a..59a2497194a 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java @@ -30,7 +30,6 @@ package mage.sets.journeyintonyx; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; diff --git a/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java b/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java index 24c54246ef8..61e118d1248 100644 --- a/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java +++ b/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java @@ -31,13 +31,13 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.abilities.Ability; -import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.combat.CantBlockAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; import mage.target.common.TargetLandPermanent; /** @@ -45,15 +45,22 @@ import mage.target.common.TargetLandPermanent; * @author North */ public class TectonicRift extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + public TectonicRift(UUID ownerId) { super(ownerId, 157, "Tectonic Rift", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}"); this.expansionSetCode = "M12"; - + // Destroy target land. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetLandPermanent()); - this.getSpellAbility().addEffect(new TectonicRiftEffect()); + // Creatures without flying can't block this turn. + this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn)); } public TectonicRift(final TectonicRift card) { @@ -65,34 +72,3 @@ public class TectonicRift extends CardImpl { return new TectonicRift(this); } } - -class TectonicRiftEffect extends RestrictionEffect { - - TectonicRiftEffect() { - super(Duration.EndOfTurn); - staticText = "Creatures without flying can't block this turn"; - } - - TectonicRiftEffect(final TectonicRiftEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (!permanent.getAbilities().contains(FlyingAbility.getInstance())) { - return true; - } - return false; - } - - @Override - public TectonicRiftEffect copy() { - return new TectonicRiftEffect(this); - } - - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java b/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java index a8d57175e10..a35907ae63e 100644 --- a/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java +++ b/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java @@ -28,29 +28,34 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.combat.CantBlockAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; /** * * @author jeffwadsworth */ public class SeismicStomp extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + public SeismicStomp(UUID ownerId) { super(ownerId, 152, "Seismic Stomp", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); this.expansionSetCode = "M14"; - // Creatures without flying can't block this turn. - this.getSpellAbility().addEffect(new SeismicStompEffect()); + this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn)); } public SeismicStomp(final SeismicStomp card) { @@ -62,34 +67,3 @@ public class SeismicStomp extends CardImpl { return new SeismicStomp(this); } } - -class SeismicStompEffect extends RestrictionEffect { - - SeismicStompEffect() { - super(Duration.EndOfTurn); - staticText = "Creatures without flying can't block this turn"; - } - - SeismicStompEffect(final SeismicStompEffect effect) { - super(effect); - } - - @Override - public boolean applies(Permanent permanent, Ability source, Game game) { - if (!permanent.getAbilities().contains(FlyingAbility.getInstance())) { - return true; - } - return false; - } - - @Override - public SeismicStompEffect copy() { - return new SeismicStompEffect(this); - } - - @Override - public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) { - return false; - } - -} diff --git a/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java b/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java new file mode 100644 index 00000000000..231b0d9ac5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java @@ -0,0 +1,90 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + + +/** + * + * @author LevelX2 + */ +public class EnthrallingVictor extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls with power 2 or less"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public EnthrallingVictor(UUID ownerId) { + super(ownerId, 142, "Enthralling Victor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn. + Ability ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn, true), false); + Effect effect = new UntapTargetEffect(); + effect.setText("untap that creature"); + ability.addEffect(effect); + ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn, "it gains haste until end of turn")); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public EnthrallingVictor(final EnthrallingVictor card) { + super(card); + } + + @Override + public EnthrallingVictor copy() { + return new EnthrallingVictor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java b/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java new file mode 100644 index 00000000000..15d9672c16f --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java @@ -0,0 +1,105 @@ +/* + * 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.magicorigins; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.SpellMasteryCondition; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class RavagingBlaze extends CardImpl { + + public RavagingBlaze(UUID ownerId) { + super(ownerId, 159, "Ravaging Blaze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{R}{R}"); + this.expansionSetCode = "ORI"; + + // Ravaging Blaze deals X damage to target creature. + // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller. + this.getSpellAbility().addEffect(new RavagingBlazeEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public RavagingBlaze(final RavagingBlaze card) { + super(card); + } + + @Override + public RavagingBlaze copy() { + return new RavagingBlaze(this); + } +} + +class RavagingBlazeEffect extends OneShotEffect { + + public RavagingBlazeEffect() { + super(Outcome.Damage); + staticText = "{this} deals X damage to target creature.
    " + + "Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, {this} also deals X damage to that creature's controller."; + } + + public RavagingBlazeEffect(final RavagingBlazeEffect effect) { + super(effect); + } + + @Override + public RavagingBlazeEffect copy() { + return new RavagingBlazeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent != null) { + int xValue = source.getManaCostsToPay().getX(); + if (xValue > 0) { + permanent.damage(xValue, source.getSourceId(), game, false, true); + if (SpellMasteryCondition.getInstance().apply(game, source)) { + Player targetController = game.getPlayer(permanent.getControllerId()); + if (targetController != null) { + targetController.damage(xValue, source.getSourceId(), game, false, true); + } + } + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java new file mode 100644 index 00000000000..3f67be9e03c --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; + +/** + * + * @author LevelX2 + */ +public class SeismicElemental extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + + static { + filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public SeismicElemental(UUID ownerId) { + super(ownerId, 161, "Seismic Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Elemental"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Seismic Elemental enters the battlefield, creatures without flying can't block this turn. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CantBlockAllEffect(filter, Duration.EndOfTurn), false)); + } + + public SeismicElemental(final SeismicElemental card) { + super(card); + } + + @Override + public SeismicElemental copy() { + return new SeismicElemental(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java b/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java new file mode 100644 index 00000000000..9604a67346d --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.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.magicorigins; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.Filter; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.PowerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class SubterraneanScout extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less"); + + static { + filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); + } + + public SubterraneanScout(UUID ownerId) { + super(ownerId, 164, "Subterranean Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Subterranean Scout enters the battlefield, target creature with power 2 or less can't be blocked this turn. + Ability ability = new EntersBattlefieldTriggeredAbility(new CantBeBlockedTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + } + + public SubterraneanScout(final SubterraneanScout card) { + super(card); + } + + @Override + public SubterraneanScout copy() { + return new SubterraneanScout(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java b/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java new file mode 100644 index 00000000000..17361c9fc80 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.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.magicorigins; + +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.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class VolcanicRambler extends CardImpl { + + public VolcanicRambler(UUID ownerId) { + super(ownerId, 167, "Volcanic Rambler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "ORI"; + this.subtype.add("Elemental"); + this.power = new MageInt(6); + this.toughness = new MageInt(4); + + // {2}{R}: Volcanic Rambler deals 1 damage to target player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{2}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public VolcanicRambler(final VolcanicRambler card) { + super(card); + } + + @Override + public VolcanicRambler copy() { + return new VolcanicRambler(this); + } +} diff --git a/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java new file mode 100644 index 00000000000..db9faa20080 --- /dev/null +++ b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java @@ -0,0 +1,51 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.condition.common; + +import mage.abilities.Ability; +import mage.abilities.condition.Condition; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ + +public class SpellMasteryCondition implements Condition { + + private static final FilterCard filter = new FilterCard(); + + static { + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); + } + + private static SpellMasteryCondition fInstance = null; + + public static SpellMasteryCondition getInstance() { + if (fInstance == null) { + fInstance = new SpellMasteryCondition(); + } + return fInstance; + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + return player != null && player.getGraveyard().count(filter, game) >= 2; + } + + @Override + public String toString() { + return "there are two or more instant and/or sorcery cards in your graveyard"; + } + + +} \ No newline at end of file From a41d8d8d6e60568234b4f3b020e0285eb57bfe07 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 21 Jun 2015 01:33:51 +0200 Subject: [PATCH 147/148] [ORI] Fixed power of Hixus, Prison Warden. --- Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java index bc5db55e567..43db2e99f16 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java @@ -63,7 +63,7 @@ public class HixusPrisonWarden extends CardImpl { this.subtype.add("Human"); this.subtype.add("Soldier"); this.power = new MageInt(4); - this.toughness = new MageInt(44); + this.toughness = new MageInt(4); // Flash this.addAbility(FlashAbility.getInstance()); From 3a5748550153eb2b740a5ec69d4b28e6dca5ae0a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 21 Jun 2015 01:39:25 +0200 Subject: [PATCH 148/148] [ORI] Fix of SpellMasteryCondition. --- .../mage/abilities/condition/common/SpellMasteryCondition.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java index db9faa20080..fd8a29207cb 100644 --- a/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java +++ b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java @@ -36,6 +36,8 @@ public class SpellMasteryCondition implements Condition { return fInstance; } + private SpellMasteryCondition() {} + @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId());