From 2953baa466ee875239e4220cf4b5a0b1f6db2903 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 27 Aug 2015 15:44:31 +0300 Subject: [PATCH 01/63] Add AttacksAloneTriggeredAbility and use it for Nefarox, Overlord of Grixis. Implement cards: Lunk Errant; Ma Chao, Western Warrior; Reckless Ogre; Rogue Kavu; and Yuan Shao's Infantry --- .../src/mage/sets/exodus/RecklessOgre.java | 64 ++++++++++++++ .../src/mage/sets/invasion/RogueKavu.java | 52 +++++++++++ .../magic2013/NefaroxOverlordOfGrixis.java | 61 +------------ .../src/mage/sets/morningtide/LunkErrant.java | 75 ++++++++++++++++ .../src/mage/sets/ninthedition/RogueKavu.java | 64 ++++++++++++++ .../MaChaoWesternWarrior.java | 73 ++++++++++++++++ .../YuanShaosInfantry.java | 68 +++++++++++++++ .../common/AttacksAloneTriggeredAbility.java | 86 +++++++++++++++++++ 8 files changed, 486 insertions(+), 57 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/exodus/RecklessOgre.java create mode 100644 Mage.Sets/src/mage/sets/invasion/RogueKavu.java create mode 100644 Mage.Sets/src/mage/sets/morningtide/LunkErrant.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java create mode 100644 Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java diff --git a/Mage.Sets/src/mage/sets/exodus/RecklessOgre.java b/Mage.Sets/src/mage/sets/exodus/RecklessOgre.java new file mode 100644 index 0000000000..b6c3cd8bef --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/RecklessOgre.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.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RecklessOgre extends CardImpl { + + public RecklessOgre(UUID ownerId) { + super(ownerId, 98, "Reckless Ogre", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Reckless Ogre attacks alone, it gets +3/+0 until end of turn. + this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(3, 0, Duration.EndOfTurn))); + } + + public RecklessOgre(final RecklessOgre card) { + super(card); + } + + @Override + public RecklessOgre copy() { + return new RecklessOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/RogueKavu.java b/Mage.Sets/src/mage/sets/invasion/RogueKavu.java new file mode 100644 index 0000000000..4d428a0844 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RogueKavu.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.invasion; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends mage.sets.ninthedition.RogueKavu { + + public RogueKavu(UUID ownerId) { + super(ownerId); + this.cardNumber = 160; + this.expansionSetCode = "INV"; + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java index a6f7b79e94..ef64887d86 100644 --- a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java +++ b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java @@ -29,7 +29,7 @@ package mage.sets.magic2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.AttacksAloneTriggeredAbility; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.FlyingAbility; @@ -37,12 +37,7 @@ 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 mage.filter.common.FilterControlledCreaturePermanent; /** * @@ -64,7 +59,8 @@ public class NefaroxOverlordOfGrixis extends CardImpl { // Exalted this.addAbility(new ExaltedAbility()); // Whenever Nefarox, Overlord of Grixis attacks alone, defending player sacrifices a creature. - this.addAbility(new NefaroxOverlordOfGrixisTriggeredAbility()); + this.addAbility(new AttacksAloneTriggeredAbility(new SacrificeEffect( + new FilterControlledCreaturePermanent("a creature"), 1, "defending player"))); } public NefaroxOverlordOfGrixis(final NefaroxOverlordOfGrixis card) { @@ -76,52 +72,3 @@ public class NefaroxOverlordOfGrixis extends CardImpl { return new NefaroxOverlordOfGrixis(this); } } - -class NefaroxOverlordOfGrixisTriggeredAbility extends TriggeredAbilityImpl { - - private static final FilterControlledPermanent filter; - - static { - filter = new FilterControlledPermanent(" a creature"); - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - - public NefaroxOverlordOfGrixisTriggeredAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, "defending player")); - } - - public NefaroxOverlordOfGrixisTriggeredAbility(final NefaroxOverlordOfGrixisTriggeredAbility ability) { - super(ability); - } - - @Override - public NefaroxOverlordOfGrixisTriggeredAbility copy() { - 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 (game.getActivePlayerId().equals(this.controllerId) ) { - UUID nefarox = this.getSourceId(); - if (nefarox != null) { - if (game.getCombat().attacksAlone() && nefarox == game.getCombat().getAttackers().get(0)) { - UUID defender = game.getCombat().getDefenderId(nefarox); - this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); - return true; - } - } - } - return false; - } - - @Override - public String getRule() { - return "Whenever {this} attacks alone, defending player sacrifices a creature."; - } - -} diff --git a/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.java new file mode 100644 index 0000000000..4c73889e2a --- /dev/null +++ b/Mage.Sets/src/mage/sets/morningtide/LunkErrant.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.morningtide; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class LunkErrant extends CardImpl { + + public LunkErrant(UUID ownerId) { + super(ownerId, 94, "Lunk Errant", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "MOR"; + this.subtype.add("Giant"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Lunk Errant attacks alone, it gets +1/+1 and gains trample until end of turn. + Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn); + effect.setText("it gets +1/+1"); + Ability ability = new AttacksAloneTriggeredAbility(effect); + effect = new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains trample until end of turn"); + ability.addEffect(effect); + this.addAbility(ability); + } + + public LunkErrant(final LunkErrant card) { + super(card); + } + + @Override + public LunkErrant copy() { + return new LunkErrant(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.java new file mode 100644 index 0000000000..88b9d47c88 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/RogueKavu.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.ninthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class RogueKavu extends CardImpl { + + public RogueKavu(UUID ownerId) { + super(ownerId, 213, "Rogue Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "9ED"; + this.subtype.add("Kavu"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Rogue Kavu attacks alone, it gets +2/+0 until end of turn. + this.addAbility(new AttacksAloneTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn))); + } + + public RogueKavu(final RogueKavu card) { + super(card); + } + + @Override + public RogueKavu copy() { + return new RogueKavu(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java new file mode 100644 index 0000000000..02d3e2c645 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/MaChaoWesternWarrior.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MaChaoWesternWarrior extends CardImpl { + + public MaChaoWesternWarrior(UUID ownerId) { + super(ownerId, 116, "Ma Chao, Western Warrior", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Ma Chao, Western Warrior attacks alone, it can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public MaChaoWesternWarrior(final MaChaoWesternWarrior card) { + super(card); + } + + @Override + public MaChaoWesternWarrior copy() { + return new MaChaoWesternWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.java new file mode 100644 index 0000000000..7b082db19c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/YuanShaosInfantry.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAloneTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class YuanShaosInfantry extends CardImpl { + + public YuanShaosInfantry(UUID ownerId) { + super(ownerId, 129, "Yuan Shao's Infantry", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Yuan Shao's Infantry attacks alone, Yuan Shao's Infantry can't be blocked this combat. + Effect effect = new CantBeBlockedSourceEffect(Duration.EndOfCombat); + effect.setText("it can't be blocked this combat"); + this.addAbility(new AttacksAloneTriggeredAbility(effect)); + } + + public YuanShaosInfantry(final YuanShaosInfantry card) { + super(card); + } + + @Override + public YuanShaosInfantry copy() { + return new YuanShaosInfantry(this); + } +} diff --git a/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.java new file mode 100644 index 0000000000..bcbf272c1e --- /dev/null +++ b/Mage/src/mage/abilities/common/AttacksAloneTriggeredAbility.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.abilities.common; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author LoneFox + */ +public class AttacksAloneTriggeredAbility extends TriggeredAbilityImpl { + + public AttacksAloneTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public AttacksAloneTriggeredAbility(final AttacksAloneTriggeredAbility ability) { + super(ability); + } + + @Override + public AttacksAloneTriggeredAbility copy() { + return new AttacksAloneTriggeredAbility(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) ) { + UUID creatureId = this.getSourceId(); + if(creatureId != null) { + if(game.getCombat().attacksAlone() && creatureId == game.getCombat().getAttackers().get(0)) { + UUID defender = game.getCombat().getDefenderId(creatureId); + if(defender != null) { + for(Effect effect: getEffects()) { + effect.setTargetPointer(new FixedTarget(defender)); + } + } + return true; + } + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} attacks alone, " + super.getRule(); + } +} From c8afc3e1f17709d18e4dd8e9ed1fca2e0959555f Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 27 Aug 2015 16:33:42 +0300 Subject: [PATCH 02/63] Implement cards: Flanking Troops, Shu Defender, Slashing Tiger, and Trained Cheetah --- .../sets/masterseditioniii/SlashingTiger.java | 54 +++++++++++++++ .../portalthreekingdoms/FlankingTroops.java | 68 +++++++++++++++++++ .../sets/portalthreekingdoms/ShuDefender.java | 65 ++++++++++++++++++ .../portalthreekingdoms/SlashingTiger.java | 64 +++++++++++++++++ .../portalthreekingdoms/TrainedCheetah.java | 64 +++++++++++++++++ 5 files changed, 315 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.java new file mode 100644 index 0000000000..0075609f81 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/SlashingTiger.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.masterseditioniii; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends mage.sets.portalthreekingdoms.SlashingTiger { + + public SlashingTiger(UUID ownerId) { + super(ownerId); + this.cardNumber = 133; + this.expansionSetCode = "ME3"; + this.rarity = Rarity.COMMON; + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.java new file mode 100644 index 0000000000..d6c3305c13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FlankingTroops.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FlankingTroops extends CardImpl { + + public FlankingTroops(UUID ownerId) { + super(ownerId, 5, "Flanking Troops", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Flanking Troops attacks, you may tap target creature. + Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), true); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FlankingTroops(final FlankingTroops card) { + super(card); + } + + @Override + public FlankingTroops copy() { + return new FlankingTroops(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.java new file mode 100644 index 0000000000..30532cf1f4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ShuDefender.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ShuDefender extends CardImpl { + + public ShuDefender(UUID ownerId) { + super(ownerId, 20, "Shu Defender", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Shu Defender blocks, it gets +0/+2 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(0, 2, Duration.EndOfTurn), false)); + } + + public ShuDefender(final ShuDefender card) { + super(card); + } + + @Override + public ShuDefender copy() { + return new ShuDefender(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.java new file mode 100644 index 0000000000..fa80e8677c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SlashingTiger.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SlashingTiger extends CardImpl { + + public SlashingTiger(UUID ownerId) { + super(ownerId, 145, "Slashing Tiger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Slashing Tiger becomes blocked, it gets +2/+2 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), false)); + } + + public SlashingTiger(final SlashingTiger card) { + super(card); + } + + @Override + public SlashingTiger copy() { + return new SlashingTiger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.java new file mode 100644 index 0000000000..51fe695f0c --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TrainedCheetah.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BecomesBlockedTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TrainedCheetah extends CardImpl { + + public TrainedCheetah(UUID ownerId) { + super(ownerId, 154, "Trained Cheetah", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Whenever Trained Cheetah becomes blocked, it gets +1/+1 until end of turn. + this.addAbility(new BecomesBlockedTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public TrainedCheetah(final TrainedCheetah card) { + super(card); + } + + @Override + public TrainedCheetah copy() { + return new TrainedCheetah(this); + } +} From 1eb2420c04e04067b20578ce065ebc4310b1f736 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 27 Aug 2015 17:07:55 +0300 Subject: [PATCH 03/63] Implement cards: Forced Retreat, Sage's Knowledge, Taoist Mystic, and Wolf Pack --- .../mage/sets/masterseditionii/WolfPack.java | 62 ++++++++++++++++ .../sets/masterseditioniii/ForcedRetreat.java | 60 +++++++++++++++ .../portalthreekingdoms/ForcedRetreat.java | 52 +++++++++++++ .../portalthreekingdoms/SagesKnowledge.java | 68 +++++++++++++++++ .../portalthreekingdoms/TaoistMystic.java | 74 +++++++++++++++++++ .../sets/portalthreekingdoms/WolfPack.java | 52 +++++++++++++ 6 files changed, 368 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java diff --git a/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.java new file mode 100644 index 0000000000..6bf9aeb6bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/WolfPack.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.masterseditionii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DamageAsThoughNotBlockedAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WolfPack extends CardImpl { + + public WolfPack(UUID ownerId) { + super(ownerId, 187, "Wolf Pack", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}"); + this.expansionSetCode = "ME2"; + this.subtype.add("Wolf"); + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + // You may have Wolf Pack assign its combat damage as though it weren't blocked. + this.addAbility(DamageAsThoughNotBlockedAbility.getInstance()); + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.java new file mode 100644 index 0000000000..4ab6fb188b --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ForcedRetreat.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.masterseditioniii; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends CardImpl { + + public ForcedRetreat(UUID ownerId) { + super(ownerId, 37, "Forced Retreat", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "ME3"; + + // Put target creature on top of its owner's library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.java new file mode 100644 index 0000000000..21f5c31634 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ForcedRetreat.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.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ForcedRetreat extends mage.sets.masterseditioniii.ForcedRetreat { + + public ForcedRetreat(UUID ownerId) { + super(ownerId); + this.cardNumber = 44; + this.expansionSetCode = "PTK"; + } + + public ForcedRetreat(final ForcedRetreat card) { + super(card); + } + + @Override + public ForcedRetreat copy() { + return new ForcedRetreat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.java new file mode 100644 index 0000000000..2ede43fdb7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/SagesKnowledge.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.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class SagesKnowledge extends CardImpl { + + public static final FilterCard filter = new FilterCard("sorcery card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.SORCERY)); + } + + public SagesKnowledge(UUID ownerId) { + super(ownerId, 52, "Sage's Knowledge", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); + this.expansionSetCode = "PTK"; + + // Return target sorcery card from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter)); + } + + public SagesKnowledge(final SagesKnowledge card) { + super(card); + } + + @Override + public SagesKnowledge copy() { + return new SagesKnowledge(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.java new file mode 100644 index 0000000000..655f5825eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/TaoistMystic.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +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.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class TaoistMystic extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public TaoistMystic(UUID ownerId) { + super(ownerId, 151, "Taoist Mystic", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Mystic"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Taoist Mystic can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public TaoistMystic(final TaoistMystic card) { + super(card); + } + + @Override + public TaoistMystic copy() { + return new TaoistMystic(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.java new file mode 100644 index 0000000000..89dd5e32a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WolfPack.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.portalthreekingdoms; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WolfPack extends mage.sets.masterseditionii.WolfPack { + + public WolfPack(UUID ownerId) { + super(ownerId); + this.cardNumber = 158; + this.expansionSetCode = "PTK"; + } + + public WolfPack(final WolfPack card) { + super(card); + } + + @Override + public WolfPack copy() { + return new WolfPack(this); + } +} From e40aec6bc312368fc95454b9b74ff41db4a4553b Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 27 Aug 2015 17:39:10 +0300 Subject: [PATCH 04/63] Implement cards: Zhang He, Wei General; Zhang Liao, Hero of Hefei; Zhao Zilong, Tiger General; and Zuo Ci, The Mocking Sage --- .../ZhangHeWeiGeneral.java | 71 +++++++++++++++++ .../ZhangLiaoHeroOfHefei.java | 65 ++++++++++++++++ .../ZhaoZilongTigerGeneral.java | 70 +++++++++++++++++ .../ZuoCiTheMockingSage.java | 78 +++++++++++++++++++ 4 files changed, 284 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.java new file mode 100644 index 0000000000..21d6840940 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangHeWeiGeneral.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class ZhangHeWeiGeneral extends CardImpl { + + public ZhangHeWeiGeneral(UUID ownerId) { + super(ownerId, 95, "Zhang He, Wei General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(4); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhang He, Wei General attacks, each other creature you control gets +1/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, + new FilterCreaturePermanent(), true), false)); + } + + public ZhangHeWeiGeneral(final ZhangHeWeiGeneral card) { + super(card); + } + + @Override + public ZhangHeWeiGeneral copy() { + return new ZhangHeWeiGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java new file mode 100644 index 0000000000..7d3cd94740 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhangLiaoHeroOfHefei extends CardImpl { + + public ZhangLiaoHeroOfHefei(UUID ownerId) { + super(ownerId, 96, "Zhang Liao, Hero of Hefei", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Zhang Liao, Hero of Hefei deals damage to an opponent, that opponent discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + } + + public ZhangLiaoHeroOfHefei(final ZhangLiaoHeroOfHefei card) { + super(card); + } + + @Override + public ZhangLiaoHeroOfHefei copy() { + return new ZhangLiaoHeroOfHefei(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.java new file mode 100644 index 0000000000..221dd7ec38 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhaoZilongTigerGeneral.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.common.BlocksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZhaoZilongTigerGeneral extends CardImpl { + + public ZhaoZilongTigerGeneral(UUID ownerId) { + super(ownerId, 33, "Zhao Zilong, Tiger General", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Zhao Zilong, Tiger General blocks, it gets +1/+1 until end of turn. + this.addAbility(new BlocksTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false)); + } + + public ZhaoZilongTigerGeneral(final ZhaoZilongTigerGeneral card) { + super(card); + } + + @Override + public ZhaoZilongTigerGeneral copy() { + return new ZhaoZilongTigerGeneral(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.java new file mode 100644 index 0000000000..a85f789371 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZuoCiTheMockingSage.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.abilities.keyword.HorsemanshipAbility; +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.mageobject.AbilityPredicate; + +/** + * + * @author LoneFox + */ +public class ZuoCiTheMockingSage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with horsemanship"); + + static { + filter.add(new AbilityPredicate(HorsemanshipAbility.class)); + } + + public ZuoCiTheMockingSage(UUID ownerId) { + super(ownerId, 165, "Zuo Ci, the Mocking Sage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "PTK"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Advisor"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Hexproof + this.addAbility(HexproofAbility.getInstance()); + // Zuo Ci, the Mocking Sage can't be blocked by creatures with horsemanship. + this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); + } + + public ZuoCiTheMockingSage(final ZuoCiTheMockingSage card) { + super(card); + } + + @Override + public ZuoCiTheMockingSage copy() { + return new ZuoCiTheMockingSage(this); + } +} From f01080281dbca20642d705db4e815c0bc900c778 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 27 Aug 2015 18:47:37 +0300 Subject: [PATCH 05/63] Implement cards: False Mourning, Wei Ambush Force, Wei Night Raiders, and Wu Scout --- .../masterseditioniii/WeiNightRaiders.java | 52 +++++++++++++ .../portalthreekingdoms/FalseMourning.java | 60 +++++++++++++++ .../portalthreekingdoms/WeiAmbushForce.java | 65 ++++++++++++++++ .../portalthreekingdoms/WeiNightRaiders.java | 67 +++++++++++++++++ .../sets/portalthreekingdoms/WuScout.java | 75 +++++++++++++++++++ 5 files changed, 319 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java new file mode 100644 index 0000000000..9f9001e97d --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/WeiNightRaiders.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends mage.sets.portalthreekingdoms.WeiNightRaiders { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId); + this.cardNumber = 81; + this.expansionSetCode = "ME3"; + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.java new file mode 100644 index 0000000000..5f33ccffb4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FalseMourning.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.portalthreekingdoms; + +import java.util.UUID; +import mage.abilities.effects.common.PutOnLibraryTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author LoneFox + */ +public class FalseMourning extends CardImpl { + + public FalseMourning(UUID ownerId) { + super(ownerId, 134, "False Mourning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}"); + this.expansionSetCode = "PTK"; + + // Put target card from your graveyard on top of your library. + this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); + } + + public FalseMourning(final FalseMourning card) { + super(card); + } + + @Override + public FalseMourning copy() { + return new FalseMourning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.java new file mode 100644 index 0000000000..6b5af019f7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiAmbushForce.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiAmbushForce extends CardImpl { + + public WeiAmbushForce(UUID ownerId) { + super(ownerId, 85, "Wei Ambush Force", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever Wei Ambush Force attacks, it gets +2/+0 until end of turn. + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false)); + } + + public WeiAmbushForce(final WeiAmbushForce card) { + super(card); + } + + @Override + public WeiAmbushForce copy() { + return new WeiAmbushForce(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java new file mode 100644 index 0000000000..5b20e8e973 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsDamageToOpponentTriggeredAbility; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class WeiNightRaiders extends CardImpl { + + public WeiNightRaiders(UUID ownerId) { + super(ownerId, 89, "Wei Night Raiders", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // Whenever Wei Night Raiders deals damage to an opponent, that player discards a card. + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + } + + public WeiNightRaiders(final WeiNightRaiders card) { + super(card); + } + + @Override + public WeiNightRaiders copy() { + return new WeiNightRaiders(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.java new file mode 100644 index 0000000000..9e21e745d9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WuScout.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.portalthreekingdoms; + +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.LookAtTargetPlayerHandEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class WuScout extends CardImpl { + + public WuScout(UUID ownerId) { + super(ownerId, 62, "Wu Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Wu Scout enters the battlefield, look at target opponent's hand. + Effect effect = new LookAtTargetPlayerHandEffect(); + effect.setText("look at target opponent's hand"); + Ability ability = new EntersBattlefieldTriggeredAbility(effect, false); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public WuScout(final WuScout card) { + super(card); + } + + @Override + public WuScout copy() { + return new WuScout(this); + } +} From 15cabd9369b5e11b502838c44ef2054836dc0fae Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 28 Aug 2015 11:04:53 +0300 Subject: [PATCH 06/63] Implement cards: Angel of Fury; Guan Yu, Sainted Warrior; and Zodiac Dragon --- .../sets/masterseditionii/AngelOfFury.java | 52 ++++++++++++++ .../GuanYuSaintedWarrior.java | 69 +++++++++++++++++++ .../sets/masterseditioniii/ZodiacDragon.java | 52 ++++++++++++++ .../sets/portalsecondage/AngelOfFury.java | 66 ++++++++++++++++++ .../GuanYuSaintedWarrior.java | 54 +++++++++++++++ .../portalthreekingdoms/ZodiacDragon.java | 63 +++++++++++++++++ 6 files changed, 356 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java create mode 100644 Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java diff --git a/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.java new file mode 100644 index 0000000000..e72554ff41 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/AngelOfFury.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; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends mage.sets.portalsecondage.AngelOfFury { + + public AngelOfFury(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "ME2"; + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.java new file mode 100644 index 0000000000..87fd01dfd4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/GuanYuSaintedWarrior.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.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.HorsemanshipAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends CardImpl { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId, 12, "Guan Yu, Sainted Warrior", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); + this.expansionSetCode = "ME3"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Soldier"); + this.subtype.add("Warrior"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Horsemanship + this.addAbility(HorsemanshipAbility.getInstance()); + // When Guan Yu, Sainted Warrior is put into your graveyard from the battlefield, you may shuffle Guan Yu into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java new file mode 100644 index 0000000000..8cd972b8ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/ZodiacDragon.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends mage.sets.portalthreekingdoms.ZodiacDragon { + + public ZodiacDragon(UUID ownerId) { + super(ownerId); + this.cardNumber = 112; + this.expansionSetCode = "ME3"; + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.java new file mode 100644 index 0000000000..4b43914196 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/AngelOfFury.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.portalsecondage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ShuffleIntoLibrarySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class AngelOfFury extends CardImpl { + + public AngelOfFury(UUID ownerId) { + super(ownerId, 127, "Angel of Fury", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}"); + this.expansionSetCode = "PO2"; + this.subtype.add("Angel"); + this.power = new MageInt(3); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Angel of Fury is put into your graveyard from the battlefield, you may shuffle it into your library. + this.addAbility(new DiesTriggeredAbility(new ShuffleIntoLibrarySourceEffect(), true)); + } + + public AngelOfFury(final AngelOfFury card) { + super(card); + } + + @Override + public AngelOfFury copy() { + return new AngelOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.java new file mode 100644 index 0000000000..a5ad17bba7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/GuanYuSaintedWarrior.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.portalthreekingdoms; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class GuanYuSaintedWarrior extends mage.sets.masterseditioniii.GuanYuSaintedWarrior { + + public GuanYuSaintedWarrior(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "PTK"; + this.rarity = Rarity.RARE; + } + + public GuanYuSaintedWarrior(final GuanYuSaintedWarrior card) { + super(card); + } + + @Override + public GuanYuSaintedWarrior copy() { + return new GuanYuSaintedWarrior(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.java new file mode 100644 index 0000000000..3b6459ec95 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZodiacDragon.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.portalthreekingdoms; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class ZodiacDragon extends CardImpl { + + public ZodiacDragon(UUID ownerId) { + super(ownerId, 131, "Zodiac Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{7}{R}{R}"); + this.expansionSetCode = "PTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // When Zodiac Dragon is put into your graveyard from the battlefield, you may return it to your hand. + this.addAbility(new DiesTriggeredAbility(new ReturnToHandSourceEffect(), true)); + } + + public ZodiacDragon(final ZodiacDragon card) { + super(card); + } + + @Override + public ZodiacDragon copy() { + return new ZodiacDragon(this); + } +} From faac815ed276118c0f0b41204692ad015eab457a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 11:40:46 +0200 Subject: [PATCH 07/63] * Guardian of Tazeem - Fixed conditional handling. --- .../battleforzendikar/GuardianOfTazeem.java | 56 ++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java index 82e06c9f91..d82f72d6ad 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GuardianOfTazeem.java @@ -31,11 +31,15 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect; import mage.abilities.effects.common.TapTargetEffect; 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; @@ -45,13 +49,14 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FixedTarget; /** * * @author fireshoes */ public class GuardianOfTazeem extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { @@ -67,7 +72,7 @@ public class GuardianOfTazeem extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Landfall - Whenever a land enters the battlefield under you control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step. Ability ability = new GuardianOfTazeemTriggeredAbility(); ability.addTarget(new TargetCreaturePermanent(filter)); @@ -87,7 +92,8 @@ public class GuardianOfTazeem extends CardImpl { class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { public GuardianOfTazeemTriggeredAbility() { - super(Zone.BATTLEFIELD, null, false); + super(Zone.BATTLEFIELD, new TapTargetEffect(), false); + addEffect(new GuardianOfTazeemEffect()); } public GuardianOfTazeemTriggeredAbility(final GuardianOfTazeemTriggeredAbility ability) { @@ -107,10 +113,13 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId)) { - addEffect(new TapTargetEffect()); - if (permanent.hasSubtype("Island")) { - addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature")); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + for (Effect effect : getEffects()) { + if (effect instanceof GuardianOfTazeemEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } } return true; } @@ -119,6 +128,37 @@ class GuardianOfTazeemTriggeredAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "Landfall - Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step."; + return "Landfall - Whenever a land enters the battlefield under your control, " + super.getRule(); + } +} + +class GuardianOfTazeemEffect extends OneShotEffect { + + public GuardianOfTazeemEffect() { + super(Outcome.Benefit); + this.staticText = "If that land is an Island, that creature doesn't untap during its controller's next untap step"; + } + + public GuardianOfTazeemEffect(final GuardianOfTazeemEffect effect) { + super(effect); + } + + @Override + public GuardianOfTazeemEffect copy() { + return new GuardianOfTazeemEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + if (land != null && targetCreature != null) { + if (land.hasSubtype("Island")) { + ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature"); + effect.setTargetPointer(new FixedTarget(targetCreature, game)); + game.addEffect(effect, source); + } + } + return true; } } From 758f56792ea1cd11f24f1d17c9422064ec450c37 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 11:44:14 +0200 Subject: [PATCH 08/63] * Added button popup menu to be able to automatically answer ability related "Yes" / "No" requests (related to #328). --- .../java/mage/client/game/FeedbackPanel.java | 84 +++--- .../java/mage/client/game/HelperPanel.java | 269 ++++++++++++++---- .../java/mage/client/game/PlayAreaPanel.java | 12 + Mage.Common/src/mage/constants/Constants.java | 4 + .../src/mage/player/human/HumanPlayer.java | 85 +++++- .../java/mage/server/game/GameController.java | 6 +- .../mage/server/game/GameSessionPlayer.java | 4 +- .../mage/sets/tenthedition/AngelsFeather.java | 54 +--- .../mage/test/AI/basic/CastCreaturesTest.java | 29 ++ .../cards/triggers/TargetedTriggeredTest.java | 67 +++++ Mage/src/mage/constants/PlayerAction.java | 8 +- Mage/src/mage/game/Game.java | 7 +- Mage/src/mage/game/GameImpl.java | 28 +- .../mage/game/events/PlayerQueryEvent.java | 10 +- .../game/events/PlayerQueryEventSource.java | 5 +- Mage/src/mage/util/MessageToClient.java | 43 +++ Mage/src/mage/util/TreeNode.java | 24 +- 17 files changed, 555 insertions(+), 184 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java create mode 100644 Mage/src/mage/util/MessageToClient.java diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index 5daa90a9f7..2690ef639d 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -47,7 +47,9 @@ import mage.client.components.MageTextArea; import mage.client.dialog.MageDialog; import mage.client.util.audio.AudioManager; import mage.client.util.gui.ArrowBuilder; -import mage.constants.Constants; +import static mage.constants.Constants.Option.ORIGINAL_ID; +import static mage.constants.Constants.Option.SECOND_MESSAGE; +import static mage.constants.Constants.Option.SPECIAL_BUTTON; import mage.constants.PlayerAction; import mage.remote.Session; import org.apache.log4j.Logger; @@ -85,6 +87,7 @@ public class FeedbackPanel extends javax.swing.JPanel { public void init(UUID gameId) { this.gameId = gameId; session = MageFrame.getSession(); + helper.init(gameId); } public void getFeedback(FeedbackMode mode, String message, boolean special, Map options, int messageId) { @@ -95,61 +98,42 @@ public class FeedbackPanel extends javax.swing.JPanel { } this.lastMessageId = messageId; } - - this.lblMessage.setText(message); - this.helper.setMessage(message); + this.helper.setBasicMessage(message); + this.helper.setOriginalId(null); // reference to the feedback causing ability + String lblText = addAdditionalText(message, options); + this.helper.setTextArea(lblText); + this.lblMessage.setText(lblText); this.mode = mode; switch (this.mode) { case INFORM: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(false); - this.helper.setState("", false, "", false); + setButtonState("", "", mode); break; case QUESTION: - this.btnLeft.setVisible(true); - this.btnLeft.setText("Yes"); - this.btnRight.setVisible(true); - this.btnRight.setText("No"); - this.helper.setState("Yes", true, "No", true); + setButtonState("Yes", "No", mode); + if (options != null && options.containsKey(ORIGINAL_ID)) { + this.helper.setOriginalId((UUID) options.get(ORIGINAL_ID)); + } break; case CONFIRM: - this.btnLeft.setVisible(true); - this.btnLeft.setText("OK"); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("Ok", true, "Cancel", true); + setButtonState("OK", "Cancel", mode); break; case CANCEL: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Cancel"); - this.helper.setState("", false, "Cancel", true); + setButtonState("", "Cancel", mode); this.helper.setUndoEnabled(false); break; case SELECT: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Done"); - this.helper.setState("", false, "Done", true); + setButtonState("", "Done", mode); break; case END: - this.btnLeft.setVisible(false); - this.btnRight.setVisible(true); - this.btnRight.setText("Close game"); - this.helper.setState("", false, "Close game", true); + setButtonState("", "Close game", mode); ArrowBuilder.getBuilder().removeAllArrows(gameId); endWithTimeout(); break; } - if (options != null && options.containsKey(Constants.Option.SPECIAL_BUTTON)) { - String specialText = (String) options.get(Constants.Option.SPECIAL_BUTTON); - this.btnSpecial.setVisible(true); - this.btnSpecial.setText(specialText); - this.helper.setSpecial(specialText, true); + if (options != null && options.containsKey(SPECIAL_BUTTON)) { + this.setSpecial((String) options.get(SPECIAL_BUTTON), true); } else { - this.btnSpecial.setVisible(special); - this.btnSpecial.setText("Special"); - this.helper.setSpecial("Special", special); + this.setSpecial("Special", special); } requestFocusIfPossible(); @@ -162,6 +146,32 @@ public class FeedbackPanel extends javax.swing.JPanel { this.helper.setVisible(true); } + private void setButtonState(String leftText, String rightText, FeedbackMode mode) { + btnLeft.setVisible(!leftText.isEmpty()); + btnLeft.setText(leftText); + btnRight.setVisible(!rightText.isEmpty()); + btnRight.setText(rightText); + this.helper.setState(leftText, !leftText.isEmpty(), rightText, !rightText.isEmpty(), mode); + } + + private String addAdditionalText(String message, Map options) { + if (options != null && options.containsKey(SECOND_MESSAGE)) { + return message + getSmallText((String) options.get(SECOND_MESSAGE)); + } else { + return message; + } + } + + protected String getSmallText(String text) { + return "
" + text + "
"; + } + + private void setSpecial(String text, boolean visible) { + this.btnSpecial.setText(text); + this.btnSpecial.setVisible(visible); + this.helper.setSpecial(text, visible); + } + /** * Close game window by pressing OK button after 8 seconds */ diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index 829493e0e1..8e27613ecc 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -28,17 +28,34 @@ package mage.client.game; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagLayout; +import java.awt.Point; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.UUID; import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; +import mage.client.MageFrame; import mage.client.components.MageTextArea; +import mage.client.game.FeedbackPanel.FeedbackMode; +import static mage.client.game.FeedbackPanel.FeedbackMode.QUESTION; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_ID_YES; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_NO; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_TEXT_YES; +import mage.remote.Session; /** * Panel with buttons that copy the state of feedback panel. @@ -64,12 +81,34 @@ public class HelperPanel extends JPanel { private final int defaultDismissTimeout = ToolTipManager.sharedInstance().getDismissDelay(); private final Object tooltipBackground = UIManager.get("info"); + private static final String CMD_AUTO_ANSWER_ID_YES = "cmdAutoAnswerIdYes"; + private static final String CMD_AUTO_ANSWER_ID_NO = "cmdAutoAnswerIdNo"; + private static final String CMD_AUTO_ANSWER_NAME_YES = "cmdAutoAnswerNameYes"; + private static final String CMD_AUTO_ANSWER_NAME_NO = "cmdAutoAnswerNameNo"; + private static final String CMD_AUTO_ANSWER_RESET_ALL = "cmdAutoAnswerResetAll"; + + // popup menu for set automatic answers + private JPopupMenu popupMenuAskYes; + private JPopupMenu popupMenuAskNo; + + // originalId of feedback causing ability + private UUID originalId; + private String message; + + private UUID gameId; + private Session session; + public HelperPanel() { initComponents(); } - private void initComponents() { + public void init(UUID gameId) { + this.gameId = gameId; + session = MageFrame.getSession(); + } + private void initComponents() { + initPopupMenuTriggerOrder(); setBackground(new Color(0, 0, 0, 100)); //setLayout(new GridBagLayout()); setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); @@ -108,71 +147,49 @@ public class HelperPanel extends JPanel { btnUndo.setVisible(false); container.add(btnUndo); - btnLeft.addActionListener(new java.awt.event.ActionListener() { + MouseListener checkPopupAdapter = new MouseAdapter() { + @Override + public void mousePressed(MouseEvent me) { + checkPopupMenu(me); + } + + @Override + public void mouseReleased(MouseEvent me) { + checkPopupMenu(me); + } + + }; + + btnLeft.addMouseListener(checkPopupAdapter); + btnLeft.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkLeft != null) { - { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkLeft.doClick(); - } - }); - } - }; - worker.start(); - } + clickButton(linkLeft); } } }); - btnRight.addActionListener(new java.awt.event.ActionListener() { + btnRight.addMouseListener(checkPopupAdapter); + btnRight.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkRight != null) { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkRight.doClick(); - } - }); - } - }; - worker.start(); + clickButton(linkRight); } } }); - btnSpecial.addActionListener(new java.awt.event.ActionListener() { + btnSpecial.addActionListener(new ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkSpecial != null) { { - Thread worker = new Thread() { - @Override - public void run() { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - setState("", false, "", false); - setSpecial("", false); - linkSpecial.doClick(); - } - }); - } - }; - worker.start(); +// if (evt.getActionCommand().equals("automatic")) { +// showPopupMenu(evt); +// } else { + clickButton(linkSpecial); +// } } } } @@ -200,7 +217,7 @@ public class HelperPanel extends JPanel { } }); - // sets a darker background and higher simiss time fpr tooltip in the feedback / helper panel + // sets a darker background and higher simiss time fur tooltip in the feedback / helper panel textArea.addMouseListener(new MouseAdapter() { @Override @@ -217,15 +234,50 @@ public class HelperPanel extends JPanel { }); } - public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible) { + private void checkPopupMenu(MouseEvent me) { + if (me.isPopupTrigger() + && originalId != null) { // only Yes/No requests from abilities can be automated + JButton source = (JButton) me.getSource(); + if (source.getActionCommand().startsWith(QUESTION.toString())) { + showPopupMenu(me.getComponent(), source.getActionCommand()); + me.consume(); + } + } + } + + private void clickButton(final JButton button) { + Thread worker = new Thread() { + @Override + public void run() { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + setState("", false, "", false, null); + setSpecial("", false); + button.doClick(); + } + }); + } + }; + worker.start(); + } + + public void setState(String txtLeft, boolean leftVisible, String txtRight, boolean rightVisible, FeedbackMode mode) { this.btnLeft.setVisible(leftVisible); if (!txtLeft.isEmpty()) { this.btnLeft.setText(txtLeft); + if (mode != null) { + this.btnLeft.setActionCommand(mode.toString() + txtLeft); + } } this.btnRight.setVisible(rightVisible); if (!txtRight.isEmpty()) { this.btnRight.setText(txtRight); + if (mode != null) { + this.btnRight.setActionCommand(mode.toString() + txtRight); + } } + } public void setSpecial(String txtSpecial, boolean specialVisible) { @@ -251,25 +303,116 @@ public class HelperPanel extends JPanel { this.linkUndo = undo; } - public void setMessage(String message) { -// if (message.startsWith("Use alternative cost")) { -// message = "Use alternative cost?"; -// } else if (message.contains("Use ")) { -// if (message.length() < this.getWidth() / 10) { -// message = getSmallText(message); -// } else { -// message = "Use ability?" + getSmallText(message.substring(0, this.getWidth() / 10)); -// } -// } - textArea.setText(message, this.getWidth()); + public void setOriginalId(UUID originalId) { + this.originalId = originalId; } - protected String getSmallText(String text) { - return "
" + text + "
"; + public void setBasicMessage(String message) { + this.message = message; + this.textArea.setText(message, this.getWidth()); + } + + public void setTextArea(String message) { + this.textArea.setText(message, this.getWidth()); } @Override public void requestFocus() { this.btnRight.requestFocus(); } + + private void initPopupMenuTriggerOrder() { + + ActionListener actionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + handleAutoAnswerPopupMenuEvent(e); + } + }; + + popupMenuAskYes = new JPopupMenu(); + popupMenuAskNo = new JPopupMenu(); + + // String tooltipText = ""; + JMenuItem menuItem; + menuItem = new JMenuItem("Always Yes for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_YES); + menuItem.addActionListener(actionListener); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with Yes."); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text and ability"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_ID_NO); + menuItem.setToolTipText("If the same question from the same ability would
be asked again, it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Always Yes for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_YES); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with Yes."); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Always No for the same text"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_NAME_NO); + menuItem.setToolTipText("If the same question would be asked again (regardless from which source),
it's automatically answered with No."); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskYes.add(menuItem); + + menuItem = new JMenuItem("Delete all automatic Yes/No settings"); + menuItem.setActionCommand(CMD_AUTO_ANSWER_RESET_ALL); + menuItem.addActionListener(actionListener); + popupMenuAskNo.add(menuItem); + } + + public void handleAutoAnswerPopupMenuEvent(ActionEvent e) { + switch (e.getActionCommand()) { + case CMD_AUTO_ANSWER_ID_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_YES, gameId, originalId.toString() + "#" + message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_ID_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_ID_NO, gameId, originalId.toString() + "#" + message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_NAME_YES: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_YES, gameId, message); + clickButton(btnLeft); + break; + case CMD_AUTO_ANSWER_NAME_NO: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_TEXT_NO, gameId, message); + clickButton(btnRight); + break; + case CMD_AUTO_ANSWER_RESET_ALL: + session.sendPlayerAction(REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + break; + } + } + + private void showPopupMenu(Component callingComponent, String actionCommand) { + // Get the location of the point 'on the screen' + Point p = callingComponent.getLocationOnScreen(); + // Show the JPopupMenu via program + // Parameter desc + // ---------------- + // this - represents current frame + // 0,0 is the co ordinate where the popup + // is shown + JPopupMenu menu; + if (actionCommand.endsWith("Yes")) { + menu = popupMenuAskYes; + } else { + menu = popupMenuAskNo; + } + menu.show(this, 0, 0); + + // Now set the location of the JPopupMenu + // This location is relative to the screen + menu.setLocation(p.x, p.y + callingComponent.getHeight()); + } } 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 cdf949d149..44f2f509b5 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -290,6 +290,18 @@ public class PlayAreaPanel extends javax.swing.JPanel { } }); + menuItem = new JMenuItem("Use requests - reset automatic answers"); + menuItem.setMnemonic(KeyEvent.VK_T); + menuItem.setToolTipText("Deletes all defined automatic answers for Yes/No usage requests."); + automaticConfirmsMenu.add(menuItem); + // Reset the replacement effcts that were auto selected for the game + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + gamePanel.getSession().sendPlayerAction(PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL, gameId, null); + } + }); + JMenu handCardsMenu = new JMenu("Cards on hand"); handCardsMenu.setMnemonic(KeyEvent.VK_H); popupMenu.add(handCardsMenu); diff --git a/Mage.Common/src/mage/constants/Constants.java b/Mage.Common/src/mage/constants/Constants.java index a5b586c63a..965346f281 100644 --- a/Mage.Common/src/mage/constants/Constants.java +++ b/Mage.Common/src/mage/constants/Constants.java @@ -83,6 +83,10 @@ public final class Constants { public static final String POSSIBLE_ATTACKERS = "possibleAttackers"; public static final String SPECIAL_BUTTON = "specialButton"; + // used to control automatic answers of optional effects + public static final String ORIGINAL_ID = "originalId"; + public static final String SECOND_MESSAGE = "secondMessage"; + public static final String HINT_TEXT = "hintText"; } diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index aed2451d8b..dfec5b69e6 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -63,6 +63,7 @@ import mage.constants.ManaType; import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.PlayerAction; +import static mage.constants.PlayerAction.REQUEST_AUTO_ANSWER_RESET_ALL; import static mage.constants.PlayerAction.TRIGGER_AUTO_ORDER_RESET_ALL; import mage.constants.RangeOfInfluence; import mage.constants.Zone; @@ -89,6 +90,7 @@ import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetDefender; import mage.util.GameLog; import mage.util.ManaUtil; +import mage.util.MessageToClient; import org.apache.log4j.Logger; /** @@ -115,6 +117,9 @@ public class HumanPlayer extends PlayerImpl { protected Set triggerAutoOrderNameFirst = new HashSet<>(); protected Set triggerAutoOrderNameLast = new HashSet<>(); + protected Map requestAutoAnswerId = new HashMap<>(); + protected Map requestAutoAnswerText = new HashMap<>(); + public HumanPlayer(String name, RangeOfInfluence range, int skill) { super(name, range); replacementEffectChoice = new ChoiceImpl(true); @@ -173,10 +178,9 @@ public class HumanPlayer extends PlayerImpl { public boolean chooseMulligan(Game game) { updateGameStatePriority("chooseMulligan", game); int nextHandSize = game.mulliganDownTo(playerId); - game.fireAskPlayerEvent(playerId, new StringBuilder("Mulligan ") - .append(getHand().size() > nextHandSize ? "down to " : "for free, draw ") - .append(nextHandSize) - .append(nextHandSize == 1 ? " card?" : " cards?").toString()); + game.fireAskPlayerEvent(playerId, new MessageToClient("Mulligan " + + (getHand().size() > nextHandSize ? "down to " : "for free, draw ") + + nextHandSize + (nextHandSize == 1 ? " card?" : " cards?")), null); waitForBooleanResponse(game); if (!abort) { return response.getBoolean(); @@ -186,8 +190,19 @@ public class HumanPlayer extends PlayerImpl { @Override public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) { + if (source != null) { + Boolean answer = requestAutoAnswerId.get(source.getOriginalId() + "#" + message); + if (answer != null) { + return answer; + } else { + answer = requestAutoAnswerText.get(message); + if (answer != null) { + return answer; + } + } + } updateGameStatePriority("chooseUse", game); - game.fireAskPlayerEvent(playerId, addSecondLineWithObjectName(message, source == null ? null : source.getSourceId(), game)); + game.fireAskPlayerEvent(playerId, new MessageToClient(message, getRelatedObjectName(source, game)), source); waitForBooleanResponse(game); if (!abort) { return response.getBoolean(); @@ -195,6 +210,21 @@ public class HumanPlayer extends PlayerImpl { return false; } + private String getRelatedObjectName(Ability source, Game game) { + if (source != null) { + return getRelatedObjectName(source.getSourceId(), game); + } + return null; + } + + private String getRelatedObjectName(UUID sourceId, Game game) { + MageObject mageObject = game.getObject(sourceId); + if (mageObject != null) { + return mageObject.getLogName(); + } + return null; + } + private String addSecondLineWithObjectName(String message, UUID sourceId, Game game) { if (sourceId != null) { MageObject mageObject = game.getPermanent(sourceId); @@ -304,7 +334,7 @@ public class HumanPlayer extends PlayerImpl { List chosen = target.getTargets(); options.put("chosen", (Serializable) chosen); - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), sourceId, game), targetIds, required, getOptions(target, options)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(sourceId, game)), targetIds, required, getOptions(target, options)); waitForResponse(game); if (response.getUUID() != null) { if (!targetIds.contains(response.getUUID())) { @@ -370,7 +400,7 @@ public class HumanPlayer extends PlayerImpl { required = false; } - game.fireSelectTargetEvent(getId(), addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), possibleTargets, required, getOptions(target, null)); + game.fireSelectTargetEvent(getId(), new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), possibleTargets, required, getOptions(target, null)); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { @@ -438,7 +468,7 @@ public class HumanPlayer extends PlayerImpl { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage()), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.canTarget(response.getUUID(), cards, game)) { @@ -492,7 +522,7 @@ public class HumanPlayer extends PlayerImpl { if (!choosable.isEmpty()) { options.put("choosable", (Serializable) choosable); } - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage(), source == null ? null : source.getSourceId(), game), cards, required, options); + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), cards, required, options); waitForResponse(game); if (response.getUUID() != null) { if (target.getTargets().contains(response.getUUID())) { // if already included remove it @@ -521,7 +551,7 @@ public class HumanPlayer extends PlayerImpl { public boolean chooseTargetAmount(Outcome outcome, TargetAmount target, Ability source, Game game) { updateGameStatePriority("chooseTargetAmount", game); while (!abort) { - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), source == null ? null : source.getSourceId(), game), + game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), getRelatedObjectName(source, game)), target.possibleTargets(source == null ? null : source.getSourceId(), playerId, game), target.isRequired(source), getOptions(target, null)); @@ -1043,7 +1073,8 @@ public class HumanPlayer extends PlayerImpl { protected void selectCombatGroup(UUID defenderId, UUID blockerId, Game game) { updateGameStatePriority("selectCombatGroup", game); TargetAttackingCreature target = new TargetAttackingCreature(); - game.fireSelectTargetEvent(playerId, addSecondLineWithObjectName("Select attacker to block", blockerId, game), target.possibleTargets(null, playerId, game), false, getOptions(target, null)); + game.fireSelectTargetEvent(playerId, new MessageToClient("Select attacker to block", getRelatedObjectName(blockerId, game)), + target.possibleTargets(null, playerId, game), false, getOptions(target, null)); waitForResponse(game); if (response.getBoolean() != null) { // do nothing @@ -1354,11 +1385,43 @@ public class HumanPlayer extends PlayerImpl { case TRIGGER_AUTO_ORDER_RESET_ALL: setTriggerAutoOrder(playerAction, game, data); break; + case REQUEST_AUTO_ANSWER_ID_NO: + case REQUEST_AUTO_ANSWER_ID_YES: + case REQUEST_AUTO_ANSWER_TEXT_NO: + case REQUEST_AUTO_ANSWER_TEXT_YES: + case REQUEST_AUTO_ANSWER_RESET_ALL: + setRequestAutoAnswer(playerAction, game, data); + break; default: super.sendPlayerAction(playerAction, game, data); } } + private void setRequestAutoAnswer(PlayerAction playerAction, Game game, Object data) { + if (playerAction.equals(REQUEST_AUTO_ANSWER_RESET_ALL)) { + requestAutoAnswerId.clear(); + requestAutoAnswerText.clear(); + return; + } + if (data instanceof String) { + String key = (String) data; + switch (playerAction) { + case REQUEST_AUTO_ANSWER_ID_NO: + requestAutoAnswerId.put(key, false); + break; + case REQUEST_AUTO_ANSWER_TEXT_NO: + requestAutoAnswerText.put(key, false); + break; + case REQUEST_AUTO_ANSWER_ID_YES: + requestAutoAnswerId.put(key, true); + break; + case REQUEST_AUTO_ANSWER_TEXT_YES: + requestAutoAnswerText.put(key, true); + break; + } + } + } + private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) { if (playerAction.equals(TRIGGER_AUTO_ORDER_RESET_ALL)) { triggerAutoOrderAbilityFirst.clear(); 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 5242a01961..eec4ea0dfe 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -228,7 +228,7 @@ public class GameController implements GameCallback { try { switch (event.getQueryType()) { case ASK: - ask(event.getPlayerId(), event.getMessage()); + ask(event.getPlayerId(), event.getMessage(), event.getOptions()); break; case PICK_TARGET: target(event.getPlayerId(), event.getMessage(), event.getCards(), event.getPerms(), event.getTargets(), event.isRequired(), event.getOptions()); @@ -774,11 +774,11 @@ public class GameController implements GameCallback { // TODO: inform watchers about game end and who won } - private synchronized void ask(UUID playerId, final String question) throws MageException { + private synchronized void ask(UUID playerId, final String question, final Map options) throws MageException { perform(playerId, new Command() { @Override public void execute(UUID playerId) { - getGameSession(playerId).ask(question); + getGameSession(playerId).ask(question, options); } }); diff --git a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java index 157211555e..2f93e94376 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java +++ b/Mage.Server/src/main/java/mage/server/game/GameSessionPlayer.java @@ -78,11 +78,11 @@ public class GameSessionPlayer extends GameSessionWatcher { super.CleanUp(); } - public void ask(final String question) { + public void ask(final String question, final Map options) { if (!killed) { User user = UserManager.getInstance().getUser(userId); if (user != null) { - user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question))); + user.fireCallback(new ClientCallback("gameAsk", game.getId(), new GameClientMessage(getGameView(), question, options))); } } } diff --git a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java index c518a21d95..c9036a6021 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java +++ b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java @@ -25,20 +25,17 @@ * 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; -import mage.abilities.TriggeredAbilityImpl; +import mage.ObjectColor; +import mage.abilities.common.SpellCastAllTriggeredAbility; 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; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,10 +43,18 @@ import mage.game.stack.Spell; */ public class AngelsFeather extends CardImpl { + private final static FilterSpell filter = new FilterSpell("a white spell"); + + static { + filter.add(new ColorPredicate(ObjectColor.WHITE)); + } + public AngelsFeather(UUID ownerId) { super(ownerId, 311, "Angel's Feather", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); this.expansionSetCode = "10E"; - this.addAbility(new AngelsFeatherAbility()); + + // Whenever a player casts a white spell, you may gain 1 life. + this.addAbility(new SpellCastAllTriggeredAbility(new GainLifeEffect(1), filter, true)); } public AngelsFeather(final AngelsFeather card) { @@ -62,36 +67,3 @@ public class AngelsFeather extends CardImpl { } } - -class AngelsFeatherAbility extends TriggeredAbilityImpl { - - public AngelsFeatherAbility() { - super(Zone.BATTLEFIELD, new GainLifeEffect(1), true); - } - - public AngelsFeatherAbility(final AngelsFeatherAbility ability) { - super(ability); - } - - @Override - public AngelsFeatherAbility copy() { - 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) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isWhite(); - } - - @Override - public String getRule() { - return "Whenever a player casts a white spell, you may gain 1 life."; - } - -} diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java index d14393676f..565fc57e36 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java @@ -100,6 +100,35 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Blazing Specter", 1); } + @Test + public void testSimpleCast5() { + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 3); + addCard(Zone.HAND, playerA, "Soul Warden"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Soul Warden", 1); + } + + @Test + public void testSimpleCast6() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Plains", 2); + addCard(Zone.HAND, playerA, "Mountain", 2); + addCard(Zone.HAND, playerA, "Silvercoat Lion", 1); + addCard(Zone.HAND, playerA, "Pillarfield Ox", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Plains", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); + } + @Test public void testCast4Creature() { addCard(Zone.LIBRARY, playerA, "Swamp", 1); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.java new file mode 100644 index 0000000000..e0056f8638 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/TargetedTriggeredTest.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.triggers; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Ignore; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class TargetedTriggeredTest extends CardTestPlayerBase { + + /** + * Tests that the first spell that targets Kira, Great Glass-Spinner is + * countered. + * + */ + @Test + @Ignore + // this does currently not work in test, because the target event will be fired earlier during tests, + // so the zone change counter for the fixed target of the counterspell will not work + public void testKiraGreatGlassSpinnerFirstSpellTurn() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + addCard(Zone.BATTLEFIELD, playerB, "Kira, Great Glass-Spinner", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Kira, Great Glass-Spinner"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerB, "Kira, Great Glass-Spinner", 1); + } + +} diff --git a/Mage/src/mage/constants/PlayerAction.java b/Mage/src/mage/constants/PlayerAction.java index e572a6f2b6..746db8f13a 100644 --- a/Mage/src/mage/constants/PlayerAction.java +++ b/Mage/src/mage/constants/PlayerAction.java @@ -60,5 +60,11 @@ public enum PlayerAction { ADD_PERMISSION_TO_ROLLBACK_TURN, DENY_PERMISSON_TO_ROLLBACK_TURN, PERMISSION_REQUESTS_ALLOWED_ON, - PERMISSION_REQUESTS_ALLOWED_OFF + PERMISSION_REQUESTS_ALLOWED_OFF, + REQUEST_AUTO_ANSWER_ID_YES, + REQUEST_AUTO_ANSWER_ID_NO, + REQUEST_AUTO_ANSWER_TEXT_YES, + REQUEST_AUTO_ANSWER_TEXT_NO, + REQUEST_AUTO_ANSWER_RESET_ALL, + } diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java index 0c10ca220a..e558dc02ad 100644 --- a/Mage/src/mage/game/Game.java +++ b/Mage/src/mage/game/Game.java @@ -73,6 +73,7 @@ import mage.game.turn.Turn; import mage.players.Player; import mage.players.PlayerList; import mage.players.Players; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; public interface Game extends MageItem, Serializable { @@ -221,13 +222,13 @@ public interface Game extends MageItem, Serializable { void addPlayerQueryEventListener(Listener listener); - void fireAskPlayerEvent(UUID playerId, String message); + void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source); void fireChooseChoiceEvent(UUID playerId, Choice choice); - void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options); - void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options); + void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options); void fireSelectTargetTriggeredAbilityEvent(UUID playerId, String message, List abilities); diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index bddd512b7b..b8ad5577fe 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -118,6 +118,7 @@ import mage.target.Target; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.util.GameLog; +import mage.util.MessageToClient; import mage.util.functions.ApplyToPermanent; import mage.watchers.Watchers; import mage.watchers.common.BlockedAttackerWatcher; @@ -1886,11 +1887,11 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireAskPlayerEvent(UUID playerId, String message) { + public void fireAskPlayerEvent(UUID playerId, MessageToClient message, Ability source) { if (simulation) { return; } - playerQueryEventSource.ask(playerId, message); + playerQueryEventSource.ask(playerId, message.getMessage(), source, addMessageToOptions(message, null)); } @Override @@ -1914,19 +1915,19 @@ public abstract class GameImpl implements Game, Serializable { } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Set targets, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Set targets, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, targets, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), targets, required, addMessageToOptions(message, options)); } @Override - public void fireSelectTargetEvent(UUID playerId, String message, Cards cards, boolean required, Map options) { + public void fireSelectTargetEvent(UUID playerId, MessageToClient message, Cards cards, boolean required, Map options) { if (simulation) { return; } - playerQueryEventSource.target(playerId, message, cards, required, options); + playerQueryEventSource.target(playerId, message.getMessage(), cards, required, addMessageToOptions(message, options)); } /** @@ -2692,4 +2693,19 @@ public abstract class GameImpl implements Game, Serializable { return enterWithCounters.get(sourceId); } + private Map addMessageToOptions(MessageToClient message, Map options) { + if (message.getSecondMessage() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("secondMessage", message.getSecondMessage()); + } + if (message.getHintText() != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("hintText", message.getHintText()); + } + return options; + } } diff --git a/Mage/src/mage/game/events/PlayerQueryEvent.java b/Mage/src/mage/game/events/PlayerQueryEvent.java index 6b299f2085..ea9b943451 100644 --- a/Mage/src/mage/game/events/PlayerQueryEvent.java +++ b/Mage/src/mage/game/events/PlayerQueryEvent.java @@ -149,8 +149,14 @@ public class PlayerQueryEvent extends EventObject implements ExternalEvent, Seri this.playerId = playerId; } - public static PlayerQueryEvent askEvent(UUID playerId, String message) { - return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, null); + public static PlayerQueryEvent askEvent(UUID playerId, String message, Ability source, Map options) { + if (source != null) { + if (options == null) { + options = new HashMap<>(); + } + options.put("originalId", source.getOriginalId()); + } + return new PlayerQueryEvent(playerId, message, null, null, null, null, QueryType.ASK, 0, 0, false, options); } public static PlayerQueryEvent chooseAbilityEvent(UUID playerId, String message, String objectName, List choices) { diff --git a/Mage/src/mage/game/events/PlayerQueryEventSource.java b/Mage/src/mage/game/events/PlayerQueryEventSource.java index 7620ed1657..ea5f0aed97 100644 --- a/Mage/src/mage/game/events/PlayerQueryEventSource.java +++ b/Mage/src/mage/game/events/PlayerQueryEventSource.java @@ -32,6 +32,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.ActivatedAbility; import mage.abilities.TriggeredAbility; import mage.cards.Card; @@ -58,8 +59,8 @@ public class PlayerQueryEventSource implements EventSource, Se dispatcher.removeAllListener(); } - public void ask(UUID playerId, String message) { - dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message)); + public void ask(UUID playerId, String message, Ability source, Map options) { + dispatcher.fireEvent(PlayerQueryEvent.askEvent(playerId, message, source, options)); } public void select(UUID playerId, String message) { diff --git a/Mage/src/mage/util/MessageToClient.java b/Mage/src/mage/util/MessageToClient.java new file mode 100644 index 0000000000..fca0e28906 --- /dev/null +++ b/Mage/src/mage/util/MessageToClient.java @@ -0,0 +1,43 @@ +/* + * 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.util; + +/** + * + * @author LevelX2 + */ +public class MessageToClient { + + private String message; + private String secondMessage; + private String hintText; + + public MessageToClient(String message) { + this(message, null); + } + + public MessageToClient(String message, String secondMessage) { + this(message, secondMessage, null); + } + + public MessageToClient(String message, String secondMessage, String hintText) { + this.message = message; + this.secondMessage = secondMessage; + this.hintText = hintText; + } + + public String getMessage() { + return message; + } + + public String getSecondMessage() { + return secondMessage; + } + + public String getHintText() { + return hintText; + } +} diff --git a/Mage/src/mage/util/TreeNode.java b/Mage/src/mage/util/TreeNode.java index 7463b7addc..b9d4620629 100644 --- a/Mage/src/mage/util/TreeNode.java +++ b/Mage/src/mage/util/TreeNode.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,12 +20,11 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.util; import java.util.ArrayList; @@ -34,14 +33,16 @@ import java.util.List; /** * * @author BetaSteward_at_googlemail.com + * @param */ public class TreeNode { + protected T data; protected List> children; public TreeNode() { super(); - children = new ArrayList>(); + children = new ArrayList<>(); } public TreeNode(T data) { @@ -70,7 +71,7 @@ public class TreeNode { } public void addChild(T child) { - children.add(new TreeNode(child)); + children.add(new TreeNode<>(child)); } public void addChildAt(int index, TreeNode child) throws IndexOutOfBoundsException { @@ -93,7 +94,7 @@ public class TreeNode { return this.data; } - public void setData(T data) { + private void setData(T data) { this.data = data; } @@ -116,10 +117,7 @@ public class TreeNode { return false; } final TreeNode other = (TreeNode) obj; - if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) { - return false; - } - return true; + return !(this.data != other.data && (this.data == null || !this.data.equals(other.data))); } } From 39e62095e4ed6e83b6977ceffc9b3de39314a5d6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 14:29:54 +0200 Subject: [PATCH 09/63] Fixed some dialogs for human players that were not shown after a reconnect to a game (e.g choose mulligan, any use Yes/No choice, amount choice, Pile choice). --- .../java/mage/client/game/HelperPanel.java | 8 +- .../main/java/mage/client/util/gui/Arrow.java | 50 +++++----- .../src/mage/player/human/HumanPlayer.java | 96 ++++++++----------- 3 files changed, 69 insertions(+), 85 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java index 8e27613ecc..8a06f33d53 100644 --- a/Mage.Client/src/main/java/mage/client/game/HelperPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/HelperPanel.java @@ -184,13 +184,7 @@ public class HelperPanel extends JPanel { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { if (linkSpecial != null) { - { -// if (evt.getActionCommand().equals("automatic")) { -// showPopupMenu(evt); -// } else { - clickButton(linkSpecial); -// } - } + clickButton(linkSpecial); } } }); diff --git a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java index b513ea7966..0befa70bed 100644 --- a/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java +++ b/Mage.Client/src/main/java/mage/client/util/gui/Arrow.java @@ -11,11 +11,11 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.geom.Area; import java.awt.geom.GeneralPath; - import javax.swing.JFrame; import javax.swing.JPanel; public class Arrow extends JPanel { + private static final long serialVersionUID = -4631054277822828303L; private int startX; @@ -27,21 +27,25 @@ public class Arrow extends JPanel { private Composite composite; private Color color = Color.red; - public Arrow () { + public Arrow() { setOpaque(false); setOpacity(0.6f); } - protected void paintComponent (Graphics g) { + protected void paintComponent(Graphics g) { super.paintComponent(g); float ex = endX - startX; float ey = endY - startY; - if (ex == 0 && ey == 0) return; - float length = (float)Math.sqrt(ex * ex + ey * ey); - float bendPercent = (float)Math.asin(ey / length); - if (endX > startX) bendPercent = -bendPercent; + if (ex == 0 && ey == 0) { + return; + } + float length = (float) Math.sqrt(ex * ex + ey * ey); + float bendPercent = (float) Math.asin(ey / length); + if (endX > startX) { + bendPercent = -bendPercent; + } Area arrow = getArrow(length, bendPercent); - Graphics2D g2d = (Graphics2D)g; + Graphics2D g2d = (Graphics2D) g; g2d.translate(startX, startY); g2d.rotate(Math.atan2(ey, ex)); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); @@ -52,16 +56,16 @@ public class Arrow extends JPanel { g2d.draw(arrow); } - private Area getArrow (float length, float bendPercent) { + private Area getArrow(float length, float bendPercent) { float p1x = 0, p1y = 0; float p2x = length, p2y = 0; float cx = length / 2, cy = length / 8f * bendPercent; float adjSize, ex, ey, abs_e; - adjSize = (float)(bodyWidth / 2 / Math.sqrt(2)); + adjSize = (float) (bodyWidth / 2 / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath bodyPath = new GeneralPath(); @@ -71,10 +75,10 @@ public class Arrow extends JPanel { bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize); bodyPath.closePath(); - adjSize = (float)(headSize / Math.sqrt(2)); + adjSize = (float) (headSize / Math.sqrt(2)); ex = p2x - cx; ey = p2y - cy; - abs_e = (float)Math.sqrt(ex * ex + ey * ey); + abs_e = (float) Math.sqrt(ex * ex + ey * ey); ex /= abs_e; ey /= abs_e; GeneralPath headPath = new GeneralPath(); @@ -88,23 +92,23 @@ public class Arrow extends JPanel { return area; } - public int getBodyWidth () { + public int getBodyWidth() { return bodyWidth; } - public void setBodyWidth (int bodyWidth) { + public void setBodyWidth(int bodyWidth) { this.bodyWidth = bodyWidth; } - public float getHeadSize () { + public float getHeadSize() { return headSize; } - public void setHeadSize (float headSize) { + public void setHeadSize(float headSize) { this.headSize = headSize; } - public void setArrowLocation (int startX, int startY, int endX, int endY) { + public void setArrowLocation(int startX, int startY, int endX, int endY) { this.startX = startX; this.startY = startY; this.endX = endX; @@ -112,7 +116,7 @@ public class Arrow extends JPanel { repaint(); } - public void setOpacity (float opacity) { + public void setOpacity(float opacity) { composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity); } @@ -120,7 +124,7 @@ public class Arrow extends JPanel { this.color = color; } - public static void main (String[] args) { + public static void main(String[] args) { final JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); @@ -130,11 +134,13 @@ public class Arrow extends JPanel { frame.setResizable(false); frame.setVisible(true); frame.getContentPane().addMouseMotionListener(new MouseMotionListener() { - public void mouseMoved (MouseEvent e) { + @Override + public void mouseMoved(MouseEvent e) { arrow.setArrowLocation(320, 240, e.getX(), e.getY()); } - public void mouseDragged (MouseEvent e) { + @Override + public void mouseDragged(MouseEvent e) { } }); } diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index dfec5b69e6..0b4c9a2432 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -107,7 +107,7 @@ public class HumanPlayer extends PlayerImpl { protected static FilterBlockingCreature filterBlock = new FilterBlockingCreature(); protected final Choice replacementEffectChoice; - private static final Logger log = Logger.getLogger(HumanPlayer.class); + private static final Logger logger = Logger.getLogger(HumanPlayer.class); protected HashSet autoSelectReplacementEffects = new HashSet<>(); protected ManaCost currentlyUnpaidMana; @@ -136,52 +136,30 @@ public class HumanPlayer extends PlayerImpl { protected void waitForResponse(Game game) { response.clear(); - log.debug("Waiting response from player: " + getId()); + logger.debug("Waiting response from player: " + getId()); game.resumeTimer(getTurnControlledBy()); synchronized (response) { try { response.wait(); - log.debug("Got response from player: " + getId()); + logger.debug("Got response from player: " + getId()); } catch (InterruptedException ex) { - ex.printStackTrace(); + logger.error("Response error for player " + getName() + " gameId: " + game.getId(), ex); } finally { game.pauseTimer(getTurnControlledBy()); } } } - protected void waitForBooleanResponse(Game game) { - do { - waitForResponse(game); - } while (response.getBoolean() == null && !abort); - } - - protected void waitForUUIDResponse(Game game) { - do { - waitForResponse(game); - } while (response.getUUID() == null && !abort); - } - - protected void waitForStringResponse(Game game) { - do { - waitForResponse(game); - } while (response.getString() == null && !abort); - } - - protected void waitForIntegerResponse(Game game) { - do { - waitForResponse(game); - } while (response.getInteger() == null && !abort); - } - @Override public boolean chooseMulligan(Game game) { updateGameStatePriority("chooseMulligan", game); int nextHandSize = game.mulliganDownTo(playerId); - game.fireAskPlayerEvent(playerId, new MessageToClient("Mulligan " - + (getHand().size() > nextHandSize ? "down to " : "for free, draw ") - + nextHandSize + (nextHandSize == 1 ? " card?" : " cards?")), null); - waitForBooleanResponse(game); + do { + game.fireAskPlayerEvent(playerId, new MessageToClient("Mulligan " + + (getHand().size() > nextHandSize ? "down to " : "for free, draw ") + + nextHandSize + (nextHandSize == 1 ? " card?" : " cards?")), null); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -202,8 +180,10 @@ public class HumanPlayer extends PlayerImpl { } } updateGameStatePriority("chooseUse", game); - game.fireAskPlayerEvent(playerId, new MessageToClient(message, getRelatedObjectName(source, game)), source); - waitForBooleanResponse(game); + do { + game.fireAskPlayerEvent(playerId, new MessageToClient(message, getRelatedObjectName(source, game)), source); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -262,7 +242,7 @@ public class HumanPlayer extends PlayerImpl { while (!abort) { game.fireChooseChoiceEvent(playerId, replacementEffectChoice); waitForResponse(game); - log.debug("Choose effect: " + response.getString()); + logger.debug("Choose effect: " + response.getString()); if (response.getString() != null) { if (response.getString().startsWith("#")) { autoSelectReplacementEffects.add(response.getString().substring(1)); @@ -809,8 +789,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXMana(int min, int max, String message, Game game, Ability ability) { int xValue = 0; updateGameStatePriority("announceXMana", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -821,8 +803,10 @@ public class HumanPlayer extends PlayerImpl { public int announceXCost(int min, int max, String message, Game game, Ability ability, VariableCost variableCost) { int xValue = 0; updateGameStatePriority("announceXCost", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { xValue = response.getInteger(); } @@ -1121,8 +1105,10 @@ public class HumanPlayer extends PlayerImpl { @Override public int getAmount(int min, int max, String message, Game game) { updateGameStatePriority("getAmount", game); - game.fireGetAmountEvent(playerId, message, min, max); - waitForIntegerResponse(game); + do { + game.fireGetAmountEvent(playerId, message, min, max); + waitForResponse(game); + } while (response.getInteger() == null && !abort); if (response != null && response.getInteger() != null) { return response.getInteger(); } else { @@ -1209,11 +1195,7 @@ public class HumanPlayer extends PlayerImpl { if (!ability.getSourceId().equals(getCastSourceIdWithAlternateMana()) && ability.getManaCostsToPay().convertedManaCost() > 0) { return true; } - if (ability instanceof ManaAbility) { - return true; - } - // if ability has no mana costs you have to pick it from ability picker - return false; + return ability instanceof ManaAbility; } return true; } @@ -1288,8 +1270,10 @@ public class HumanPlayer extends PlayerImpl { @Override public boolean choosePile(Outcome outcome, String message, List pile1, List pile2, Game game) { updateGameStatePriority("choosePile", game); - game.fireChoosePileEvent(playerId, message, pile1, pile2); - waitForBooleanResponse(game); + do { + game.fireChoosePileEvent(playerId, message, pile1, pile2); + waitForResponse(game); + } while (response.getBoolean() == null && !abort); if (!abort) { return response.getBoolean(); } @@ -1301,7 +1285,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setString(responseString); response.notify(); - log.debug("Got response string from player: " + getId()); + logger.debug("Got response string from player: " + getId()); } } @@ -1311,7 +1295,7 @@ public class HumanPlayer extends PlayerImpl { response.setManaType(manaType); response.setResponseManaTypePlayerId(manaTypePlayerId); response.notify(); - log.debug("Got response mana type from player: " + getId()); + logger.debug("Got response mana type from player: " + getId()); } } @@ -1320,7 +1304,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setUUID(responseUUID); response.notify(); - log.debug("Got response UUID from player: " + getId()); + logger.debug("Got response UUID from player: " + getId()); } } @@ -1329,7 +1313,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setBoolean(responseBoolean); response.notify(); - log.debug("Got response boolean from player: " + getId()); + logger.debug("Got response boolean from player: " + getId()); } } @@ -1338,7 +1322,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(responseInteger); response.notify(); - log.debug("Got response integer from player: " + getId()); + logger.debug("Got response integer from player: " + getId()); } } @@ -1347,7 +1331,7 @@ public class HumanPlayer extends PlayerImpl { abort = true; synchronized (response) { response.notify(); - log.debug("Got cancel action from player: " + getId()); + logger.debug("Got cancel action from player: " + getId()); } } @@ -1356,7 +1340,7 @@ public class HumanPlayer extends PlayerImpl { synchronized (response) { response.setInteger(0); response.notify(); - log.debug("Got skip action from player: " + getId()); + logger.debug("Got skip action from player: " + getId()); } } @@ -1367,7 +1351,7 @@ public class HumanPlayer extends PlayerImpl { protected void updateGameStatePriority(String methodName, Game game) { if (game.getState().getPriorityPlayerId() != null) { // don't do it if priority was set to null before (e.g. discard in cleanaup) - log.debug("Setting game priority to " + getId() + " [" + methodName + "]"); + logger.debug("Setting game priority to " + getId() + " [" + methodName + "]"); game.getState().setPriorityPlayerId(getId()); } } From 423e1fd368f445aeaae78badccbea0252ac69619 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 15:16:24 +0200 Subject: [PATCH 10/63] * Triggered abilities order selection is applied immediately now. --- .../main/java/mage/client/game/GamePanel.java | 9 ++- .../src/mage/player/human/HumanPlayer.java | 55 +++++++++---------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 7ba3fae85f..2c96919274 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -1998,7 +1998,7 @@ public final class GamePanel extends javax.swing.JPanel { } } if (event.getEventName().equals("action-consumed")) { - dialog.hideDialog(); + dialog.removeDialog(); } } }; @@ -2017,24 +2017,31 @@ public final class GamePanel extends javax.swing.JPanel { switch (e.getActionCommand()) { case CMD_AUTO_ORDER_FIRST: session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_FIRST, gameId, abilityId); + session.sendPlayerUUID(gameId, abilityId); break; case CMD_AUTO_ORDER_LAST: session.sendPlayerAction(TRIGGER_AUTO_ORDER_ABILITY_LAST, gameId, abilityId); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities break; case CMD_AUTO_ORDER_NAME_FIRST: if (abilityRuleText != null) { session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_FIRST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, abilityId); } break; case CMD_AUTO_ORDER_NAME_LAST: if (abilityRuleText != null) { session.sendPlayerAction(TRIGGER_AUTO_ORDER_NAME_LAST, gameId, abilityRuleText); + session.sendPlayerUUID(gameId, null); // Don't use this but refresh the displayed abilities } break; case CMD_AUTO_ORDER_RESET_ALL: session.sendPlayerAction(TRIGGER_AUTO_ORDER_RESET_ALL, gameId, null); break; } + for (ShowCardsDialog dialog : pickTarget) { + dialog.removeDialog(); + } } private void initPopupMenuTriggerOrder() { diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 0b4c9a2432..0c25eaffc7 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -685,35 +685,34 @@ public class HumanPlayer extends PlayerImpl { @Override public TriggeredAbility chooseTriggeredAbility(List abilities, Game game) { - // try to set trigger auto order - List abilitiesWithNoOrderSet = new ArrayList<>(); - TriggeredAbility abilityOrderLast = null; - for (TriggeredAbility ability : abilities) { - if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { - return ability; - } - if (triggerAutoOrderNameFirst.contains(ability.getRule())) { - return ability; - } - if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { - abilityOrderLast = ability; - continue; - } - if (triggerAutoOrderNameLast.contains(ability.getRule())) { - abilityOrderLast = ability; - continue; - } - abilitiesWithNoOrderSet.add(ability); - } - if (abilitiesWithNoOrderSet.isEmpty()) { - return abilityOrderLast; - } - if (abilitiesWithNoOrderSet.size() == 1) { - return abilitiesWithNoOrderSet.iterator().next(); - } - - updateGameStatePriority("chooseTriggeredAbility", game); while (!abort) { + // try to set trigger auto order + List abilitiesWithNoOrderSet = new ArrayList<>(); + TriggeredAbility abilityOrderLast = null; + for (TriggeredAbility ability : abilities) { + if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { + return ability; + } + if (triggerAutoOrderNameFirst.contains(ability.getRule())) { + return ability; + } + if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { + abilityOrderLast = ability; + continue; + } + if (triggerAutoOrderNameLast.contains(ability.getRule())) { + abilityOrderLast = ability; + continue; + } + abilitiesWithNoOrderSet.add(ability); + } + if (abilitiesWithNoOrderSet.isEmpty()) { + return abilityOrderLast; + } + if (abilitiesWithNoOrderSet.size() == 1) { + return abilitiesWithNoOrderSet.iterator().next(); + } + updateGameStatePriority("chooseTriggeredAbility", game); game.fireSelectTargetTriggeredAbilityEvent(playerId, "Pick triggered ability (goes to the stack first)", abilitiesWithNoOrderSet); waitForResponse(game); if (response.getUUID() != null) { From b6c3355329072e28c0f9b8708ca3ccfe4331dcb9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 16:51:37 +0200 Subject: [PATCH 11/63] [BFZ] Added Devoid and Ingest keywords. --- .../src/main/resources/image.url.properties | 2 +- .../mage/abilities/keyword/DevoidAbility.java | 41 ++ .../mage/abilities/keyword/IngestAbility.java | 71 +++ Utils/gen-card.pl | 492 +++++++++--------- Utils/keywords.txt | 2 + 5 files changed, 362 insertions(+), 246 deletions(-) create mode 100644 Mage/src/mage/abilities/keyword/DevoidAbility.java create mode 100644 Mage/src/mage/abilities/keyword/IngestAbility.java diff --git a/Mage.Client/src/main/resources/image.url.properties b/Mage.Client/src/main/resources/image.url.properties index 625d27d3ba..21627b43ec 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,MM2,V15,BFZ,DDP +ignore.urls=TOK,V15,DDP # sets ordered by release time (newest goes first) token.lookup.order=DDP,BFZ,FVD,FVE,FVL,FVR,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,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/src/mage/abilities/keyword/DevoidAbility.java b/Mage/src/mage/abilities/keyword/DevoidAbility.java new file mode 100644 index 0000000000..ec25acc972 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/DevoidAbility.java @@ -0,0 +1,41 @@ +/* + * 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.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.constants.Zone; + +/** + * + * @author LevelX2 + */ +public class DevoidAbility extends SimpleStaticAbility { + + public DevoidAbility(ObjectColor color) { + super(Zone.ALL, null); + color.setBlack(false); + color.setWhite(false); + color.setGreen(false); + color.setBlue(false); + color.setRed(false); + } + + public DevoidAbility(final DevoidAbility ability) { + super(ability); + } + + @Override + public DevoidAbility copy() { + return new DevoidAbility(this); + } + + @Override + public String getRule() { + return "Devoid (This card has no color.)"; + } + +} diff --git a/Mage/src/mage/abilities/keyword/IngestAbility.java b/Mage/src/mage/abilities/keyword/IngestAbility.java new file mode 100644 index 0000000000..40f68dc4b8 --- /dev/null +++ b/Mage/src/mage/abilities/keyword/IngestAbility.java @@ -0,0 +1,71 @@ +/* + * 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.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class IngestAbility extends DealsCombatDamageToAPlayerTriggeredAbility { + + public IngestAbility() { + super(new IngestEffect(), false, true); + + } + + public IngestAbility(IngestAbility ability) { + super(ability); + } + + @Override + public String getRule() { + return "Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)"; + } + + @Override + public IngestAbility copy() { + return new IngestAbility(this); + } +} + +class IngestEffect extends OneShotEffect { + + public IngestEffect() { + super(Outcome.Exile); + this.staticText = "that player exiles the top card of his or her library"; + } + + public IngestEffect(final IngestEffect effect) { + super(effect); + } + + @Override + public IngestEffect copy() { + return new IngestEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (targetPlayer != null) { + Card card = targetPlayer.getLibrary().getFromTop(game); + if (card != null) { + targetPlayer.moveCards(card, Zone.LIBRARY, Zone.EXILED, source, game); + } + return true; + } + return false; + } +} diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index d18b670427..880b8d13ab 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -1,245 +1,247 @@ -#!/usr/bin/perl -w - -#author: North - -use Text::Template; -use strict; - - -my $authorFile = 'author.txt'; -my $dataFile = 'mtg-cards-data.txt'; -my $setsFile = 'mtg-sets-data.txt'; -my $knownSetsFile = 'known-sets.txt'; -my $keywordsFile = 'keywords.txt'; - - -my %cards; -my %sets; -my %knownSets; -my %keywords; - -sub toCamelCase { - my $string = $_[0]; - $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; - $string =~ s/[-,\s\']//g; - $string; -} - -sub fixCost { - my $string = $_[0]; - $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; - $string; -} - -my $author; -if (-e $authorFile) { - open (DATA, $authorFile); - $author = ; - chomp $author; - close(DATA); -} else { - $author = 'anonymous'; -} - -open (DATA, $dataFile) || die "can't open $dataFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $cards{$data[0]}{$data[1]} = \@data; -} -close(DATA); - -open (DATA, $setsFile) || die "can't open $setsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $sets{$data[0]}= $data[1]; - #print "$data[0]--$data[1]\n" -} -close(DATA); - -open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $knownSets{$data[0]}= $data[1]; -} -close(DATA); - -open (DATA, $keywordsFile) || die "can't open $keywordsFile"; -while(my $line = ) { - my @data = split('\\|', $line); - $keywords{toCamelCase($data[0])}= $data[1]; -} -close(DATA); - -my %cardTypes; -$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; -$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; -$cardTypes{'Creature'} = 'CardType.CREATURE'; -$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; -$cardTypes{'Instant'} = 'CardType.INSTANT'; -$cardTypes{'Land'} = 'CardType.LAND'; -$cardTypes{'Sorcery'} = 'CardType.SORCERY'; -$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; -$cardTypes{'Tribal'} = 'CardType.TRIBAL'; - -my %raritiesConversion; -$raritiesConversion{'C'} = 'COMMON'; -$raritiesConversion{'U'} = 'UNCOMMON'; -$raritiesConversion{'R'} = 'RARE'; -$raritiesConversion{'M'} = 'MYTHIC'; -$raritiesConversion{'Special'} = 'SPECIAL'; -$raritiesConversion{'Bonus'} = 'BONUS'; - -# Get card name -my $cardName = $ARGV[0]; -if(!$cardName) { - print 'Enter a card name: '; - $cardName = ; - chomp $cardName; -} - -if (!exists $cards{$cardName}) { - die "Card name doesn't exist: $cardName\n"; -} - -# Check if card is already implemented -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - if(-e $fileName) { - die "$cardName is already implemented (set found in: $setName).\n"; - } - } -} - -# Generate the cards -my $simpleOnly = $ARGV[1] || 'false'; -my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); -my %vars; - -$vars{'author'} = $author; -$vars{'name'} = $cardName; -$vars{'className'} = toCamelCase($cardName); - -if ($simpleOnly ne 'true') { - print "Files generated:\n"; -} -my $baseRarity = ''; -foreach my $setName (keys %{$cards{$cardName}}) { - if (exists $knownSets{$setName}) { - my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; - my $result; - - $vars{'set'} = $knownSets{$setName}; - $vars{'expansionSetCode'} = $sets{$setName}; - $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; - $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; - - if (!$baseRarity) { - $baseRarity = $cards{$cardName}{$setName}[3]; - - $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); - $vars{'power'} = $cards{$cardName}{$setName}[6]; - $vars{'toughness'} = $cards{$cardName}{$setName}[7]; - - my @types; - $vars{'subType'} = ''; - my $type = $cards{$cardName}{$setName}[5]; - while ($type =~ m/([a-zA-Z]+)( )*/g) { - if (exists($cardTypes{$1})) { - push(@types, $cardTypes{$1}); - } else { - if (@types) { - $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; - } else { - $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; - } - } - } - $vars{'type'} = join(', ', @types); - - $vars{'abilitiesImports'} = ''; - $vars{'abilities'} = ''; - - my @abilities = split('\$', $cards{$cardName}{$setName}[8]); - foreach my $ability (@abilities) { - $ability =~ s/ .+?<\/i>//g; - - my $notKeyWord; - foreach my $keyword (keys %keywords) { - if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { - $notKeyWord = 'false'; - my @ka = split(', ', $ability); - foreach my $kw (@ka) { - my $kwUnchanged = $kw; - foreach my $kk (keys %keywords) { - if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { - $kw = $kk; - } - } - if ($keywords{$kw}) { - $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); - if ($keywords{$kw} eq 'instance') { - $vars{'abilities'} .= "\n this.addAbility(" . $kw . "Ability.getInstance());"; - } elsif ($keywords{$kw} eq 'new') { - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability());"; - } elsif ($keywords{$kw} eq 'number') { - $ability =~ m/(\b\d+?\b)/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; - } elsif ($keywords{$kw} eq 'cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } elsif ($keywords{$kw} eq 'card, manaString') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; - } elsif ($keywords{$kw} eq 'card, cost') { - $ability =~ m/({.*})/g; - $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; - $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; - } - - - $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; - } else { - $vars{'abilities'} .= "\n // $kwUnchanged"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - } - } - - if (!$notKeyWord) { - $vars{'abilities'} .= "\n // $ability"; - if ($simpleOnly eq 'true') { - exit 0; - } - } - } - if ($vars{'abilities'}) { - $vars{'abilities'} = "\n" . $vars{'abilities'}; - } - - $vars{'baseSet'} = $vars{'set'}; - $vars{'baseClassName'} = $vars{'className'}; - - $result = $template->fill_in(HASH => \%vars); - } else { - $vars{'rarityExtended'} = ''; - if ($baseRarity ne $cards{$cardName}{$setName}[3]) { - $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; - } - $result = $templateExtended->fill_in(HASH => \%vars); - } - - open CARD, "> $fileName"; - print CARD $result; - close CARD; - - print "$vars{'set'}.$vars{'className'}\n"; - } else { - print "Set not found in known sets: $setName\n"; - } -} +#!/usr/bin/perl -w + +#author: North + +use Text::Template; +use strict; + + +my $authorFile = 'author.txt'; +my $dataFile = 'mtg-cards-data.txt'; +my $setsFile = 'mtg-sets-data.txt'; +my $knownSetsFile = 'known-sets.txt'; +my $keywordsFile = 'keywords.txt'; + + +my %cards; +my %sets; +my %knownSets; +my %keywords; + +sub toCamelCase { + my $string = $_[0]; + $string =~ s/\b([\w']+)\b/ucfirst($1)/ge; + $string =~ s/[-,\s\']//g; + $string; +} + +sub fixCost { + my $string = $_[0]; + $string =~ s/{([2BUGRW])([2BUGRW])}/{$1\/$2}/g; + $string; +} + +my $author; +if (-e $authorFile) { + open (DATA, $authorFile); + $author = ; + chomp $author; + close(DATA); +} else { + $author = 'anonymous'; +} + +open (DATA, $dataFile) || die "can't open $dataFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $cards{$data[0]}{$data[1]} = \@data; +} +close(DATA); + +open (DATA, $setsFile) || die "can't open $setsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $sets{$data[0]}= $data[1]; + #print "$data[0]--$data[1]\n" +} +close(DATA); + +open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $knownSets{$data[0]}= $data[1]; +} +close(DATA); + +open (DATA, $keywordsFile) || die "can't open $keywordsFile"; +while(my $line = ) { + my @data = split('\\|', $line); + $keywords{toCamelCase($data[0])}= $data[1]; +} +close(DATA); + +my %cardTypes; +$cardTypes{'Artifact'} = 'CardType.ARTIFACT'; +$cardTypes{'Conspiracy'} = 'CardType.CONSPIRACY'; +$cardTypes{'Creature'} = 'CardType.CREATURE'; +$cardTypes{'Enchantment'} = 'CardType.ENCHANTMENT'; +$cardTypes{'Instant'} = 'CardType.INSTANT'; +$cardTypes{'Land'} = 'CardType.LAND'; +$cardTypes{'Sorcery'} = 'CardType.SORCERY'; +$cardTypes{'Planeswalker'} = 'CardType.PLANESWALKER'; +$cardTypes{'Tribal'} = 'CardType.TRIBAL'; + +my %raritiesConversion; +$raritiesConversion{'C'} = 'COMMON'; +$raritiesConversion{'U'} = 'UNCOMMON'; +$raritiesConversion{'R'} = 'RARE'; +$raritiesConversion{'M'} = 'MYTHIC'; +$raritiesConversion{'Special'} = 'SPECIAL'; +$raritiesConversion{'Bonus'} = 'BONUS'; + +# Get card name +my $cardName = $ARGV[0]; +if(!$cardName) { + print 'Enter a card name: '; + $cardName = ; + chomp $cardName; +} + +if (!exists $cards{$cardName}) { + die "Card name doesn't exist: $cardName\n"; +} + +# Check if card is already implemented +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + if(-e $fileName) { + die "$cardName is already implemented (set found in: $setName).\n"; + } + } +} + +# Generate the cards +my $simpleOnly = $ARGV[1] || 'false'; +my $template = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my $templateExtended = Text::Template->new(TYPE => 'FILE', SOURCE => 'cardExtendedClass.tmpl', DELIMITERS => [ '[=', '=]' ]); +my %vars; + +$vars{'author'} = $author; +$vars{'name'} = $cardName; +$vars{'className'} = toCamelCase($cardName); + +if ($simpleOnly ne 'true') { + print "Files generated:\n"; +} +my $baseRarity = ''; +foreach my $setName (keys %{$cards{$cardName}}) { + if (exists $knownSets{$setName}) { + my $fileName = "../Mage.Sets/src/mage/sets/" . $knownSets{$setName} . "/" . toCamelCase($cardName) . ".java"; + my $result; + + $vars{'set'} = $knownSets{$setName}; + $vars{'expansionSetCode'} = $sets{$setName}; + $vars{'cardNumber'} = $cards{$cardName}{$setName}[2]; + $vars{'rarity'} = $raritiesConversion{$cards{$cardName}{$setName}[3]}; + + if (!$baseRarity) { + $baseRarity = $cards{$cardName}{$setName}[3]; + + $vars{'manaCost'} = fixCost($cards{$cardName}{$setName}[4]); + $vars{'power'} = $cards{$cardName}{$setName}[6]; + $vars{'toughness'} = $cards{$cardName}{$setName}[7]; + + my @types; + $vars{'subType'} = ''; + my $type = $cards{$cardName}{$setName}[5]; + while ($type =~ m/([a-zA-Z]+)( )*/g) { + if (exists($cardTypes{$1})) { + push(@types, $cardTypes{$1}); + } else { + if (@types) { + $vars{'subType'} .= "\n this.subtype.add(\"$1\");"; + } else { + $vars{'subType'} .= "\n this.supertype.add(\"$1\");"; + } + } + } + $vars{'type'} = join(', ', @types); + + $vars{'abilitiesImports'} = ''; + $vars{'abilities'} = ''; + + my @abilities = split('\$', $cards{$cardName}{$setName}[8]); + foreach my $ability (@abilities) { + $ability =~ s/ .+?<\/i>//g; + + my $notKeyWord; + foreach my $keyword (keys %keywords) { + if (toCamelCase($ability) =~ m/^$keyword(?=[A-Z{\d]|$)/g) { + $notKeyWord = 'false'; + my @ka = split(', ', $ability); + foreach my $kw (@ka) { + my $kwUnchanged = $kw; + foreach my $kk (keys %keywords) { + if (toCamelCase($kw) =~ m/^$kk(?=[A-Z{\d]|$)/g) { + $kw = $kk; + } + } + if ($keywords{$kw}) { + $vars{'abilities'} .= "\n // " . ucfirst($kwUnchanged); + if ($keywords{$kw} eq 'instance') { + $vars{'abilities'} .= "\n this.addAbility(" . $kw . "Ability.getInstance());"; + } elsif ($keywords{$kw} eq 'new') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability());"; + } elsif ($keywords{$kw} eq 'color') { + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . "Ability(this.color));"; + } elsif ($keywords{$kw} eq 'number') { + $ability =~ m/(\b\d+?\b)/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(' . $1 . '));'; + } elsif ($keywords{$kw} eq 'cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } elsif ($keywords{$kw} eq 'card, manaString') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, "' . fixCost($1) . '"));'; + } elsif ($keywords{$kw} eq 'card, cost') { + $ability =~ m/({.*})/g; + $vars{'abilities'} .= "\n this.addAbility(new " . $kw . 'Ability(this, new ManaCostsImpl("' . fixCost($1) . '")));'; + $vars{'abilitiesImports'} .= "\nimport mage.abilities.costs.mana.ManaCostsImpl;"; + } + + + $vars{'abilitiesImports'} .= "\nimport mage.abilities.keyword." . $kw . "Ability;"; + } else { + $vars{'abilities'} .= "\n // $kwUnchanged"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + } + } + + if (!$notKeyWord) { + $vars{'abilities'} .= "\n // $ability"; + if ($simpleOnly eq 'true') { + exit 0; + } + } + } + if ($vars{'abilities'}) { + $vars{'abilities'} = "\n" . $vars{'abilities'}; + } + + $vars{'baseSet'} = $vars{'set'}; + $vars{'baseClassName'} = $vars{'className'}; + + $result = $template->fill_in(HASH => \%vars); + } else { + $vars{'rarityExtended'} = ''; + if ($baseRarity ne $cards{$cardName}{$setName}[3]) { + $vars{'rarityExtended'} = "\n this.rarity = Rarity.$raritiesConversion{$cards{$cardName}{$setName}[3]};"; + } + $result = $templateExtended->fill_in(HASH => \%vars); + } + + open CARD, "> $fileName"; + print CARD $result; + close CARD; + + print "$vars{'set'}.$vars{'className'}\n"; + } else { + print "Set not found in known sets: $setName\n"; + } +} diff --git a/Utils/keywords.txt b/Utils/keywords.txt index 0e7ad4bea2..dd3fd7f594 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -11,6 +11,7 @@ Dash|card, manaString| Deathtouch|instance| Delve|new| Dethrone|new| +Devoid|color| Defender|instance| Double Strike|instance| Dredge|number| @@ -32,6 +33,7 @@ Hexproof|instance| Indestructible|instance| Infect|instance| Intimidate|instance| +Ingest|new| Islandcycling|cost| Islandwalk|new| Level up|cost| From ff3d262a9b398719be993b9afc5d44fb6d5be28c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 16:52:14 +0200 Subject: [PATCH 12/63] [BFZ] Added Forerunner of Slaughter and Dominator Drone. --- .../battleforzendikar/DominatorDrone.java | 92 +++++++++++++++++++ .../ForerunnerOfSlaughter.java | 52 +++++++++++ .../zendikarvseldrazi/DominatorDrone.java | 52 +++++++++++ .../ForerunnerOfSlaughter.java | 84 +++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java create mode 100644 Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java create mode 100644 Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java new file mode 100644 index 0000000000..58ec8320c0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +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.common.DamagePlayersEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public DominatorDrone(UUID ownerId) { + super(ownerId, 997, "Dominator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) + this.addAbility(new IngestAbility()); + + // When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life. + TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT)); + this.addAbility(new ConditionalTriggeredAbility( + triggeredAbility, + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), + "When {this} enters the battlefield, if you control another colorless creature, each opponent loses 2 life.")); + + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java new file mode 100644 index 0000000000..a9f1dff920 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.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.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends mage.sets.zendikarvseldrazi.ForerunnerOfSlaughter { + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId); + this.cardNumber = 998; + this.expansionSetCode = "BFZ"; + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.java new file mode 100644 index 0000000000..99555127b4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/DominatorDrone.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.zendikarvseldrazi; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends mage.sets.battleforzendikar.DominatorDrone { + + public DominatorDrone(UUID ownerId) { + super(ownerId); + this.cardNumber = 51; + this.expansionSetCode = "DDP"; + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java new file mode 100644 index 0000000000..4a411beb28 --- /dev/null +++ b/Mage.Sets/src/mage/sets/zendikarvseldrazi/ForerunnerOfSlaughter.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.zendikarvseldrazi; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.HasteAbility; +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.ColorlessPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creature"); + + static { + filter.add(new ColorlessPredicate()); + } + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId, 64, "Forerunner of Slaughter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{R}"); + this.expansionSetCode = "DDP"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid (This card has no color.) + this.addAbility(new DevoidAbility(this.color)); + + // {1}: Target colorless creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(1)); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} From dfe1e2ef5af231879dbf9a5d61b6c8b49011af66 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Aug 2015 16:52:33 +0200 Subject: [PATCH 13/63] Some minor changes. --- .../client/plugins/adapters/MageActionCallback.java | 4 ++-- .../src/mage/sets/magicorigins/DwynensElite.java | 4 ++-- .../mage/sets/magicorigins/SeismicElemental.java | 6 +++--- .../mage/test/AI/basic/TargetsAreChosenTest.java | 13 +++++++++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java index 83ba8b763d..c236a42741 100644 --- a/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java +++ b/Mage.Client/src/main/java/mage/client/plugins/adapters/MageActionCallback.java @@ -135,10 +135,10 @@ public class MageActionCallback implements ActionCallback { ArrowUtil.drawArrowsForPairedCards(data, parentPoint); ArrowUtil.drawArrowsForEnchantPlayers(data, parentPoint); - showPopup(data, parentComponent, parentPoint); + showTooltipPopup(data, parentComponent, parentPoint); } - private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { + private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { if (data.component != null) { String showTooltips = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true"); if (showTooltips.equals("false")) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java index d13a3b9fcf..6ad3180ae6 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java +++ b/Mage.Sets/src/mage/sets/magicorigins/DwynensElite.java @@ -48,7 +48,7 @@ import mage.game.permanent.token.ElfToken; * @author fireshoes */ public class DwynensElite extends CardImpl { - + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another Elf"); static { @@ -69,7 +69,7 @@ public class DwynensElite extends CardImpl { this.addAbility(new ConditionalTriggeredAbility( triggeredAbility, new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), - "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield")); + "When {this} enters the battlefield, if you control another Elf, put a 1/1 green Elf Warrior creature token onto the battlefield.")); } public DwynensElite(final DwynensElite card) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java index 3f67be9e03..ea83725bd9 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java +++ b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java @@ -45,13 +45,13 @@ import mage.filter.predicate.mageobject.AbilityPredicate; * @author LevelX2 */ public class SeismicElemental extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying"); + + 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"; diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java index 31a037b721..4859e3af03 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/TargetsAreChosenTest.java @@ -63,7 +63,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { /** * Check that the AI does not cast Rack and Ruin if it would destroy the - * owly creature on the battlefield owned by the AI + * only creature on the battlefield owned by the AI */ @Test public void testRackAndRuin2() { @@ -196,7 +196,7 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } /** - * Test that AI counters creatire spell + * Test that AI counters creature spell */ @Test @Ignore // counter spells don't seem to be cast by AI @@ -222,4 +222,13 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI { } + /** + * Target selection from EntersTheBattlefield is not varied in the AI + * calculation, so value is only calculated for the one selected target set. + * + * E.g. If AI casts an Eyeblight Assassin and opponent has a 3/1 and a 2/2, + * the AI should target the 3/1. + * + * Add test to check such situations + */ } From dc6db8d684a50967781e6eb71f6ddee12685a034 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 28 Aug 2015 15:46:53 -0500 Subject: [PATCH 14/63] - Added Vesuvan Doppleganger and Merieke Ri Berit. --- .../src/mage/sets/iceage/MeriekeRiBerit.java | 168 ++++++++++++++++++ .../limitedalpha/VesuvanDoppelganger.java | 52 ++++++ .../sets/limitedbeta/VesuvanDoppelganger.java | 52 ++++++ .../mastersedition/VesuvanDoppelganger.java | 52 ++++++ .../revisededition/VesuvanDoppelganger.java | 52 ++++++ .../mage/sets/timeshifted/MeriekeRiBerit.java | 54 ++++++ .../unlimitededition/VesuvanDoppelganger.java | 130 ++++++++++++++ 7 files changed, 560 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java create mode 100644 Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java diff --git a/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java new file mode 100644 index 0000000000..50e2a856a4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/MeriekeRiBerit.java @@ -0,0 +1,168 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.abilities.effects.common.DestroyTargetEffect; +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.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.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends CardImpl { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId, 375, "Merieke Ri Berit", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}"); + this.expansionSetCode = "ICE"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Merieke Ri Berit doesn't untap during your untap step. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepSourceEffect())); + + // {tap}: Gain control of target creature for as long as you control Merieke Ri Berit. When Merieke Ri Berit leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated. + ConditionalContinuousEffect MeriekeRiBeritGainControlEffect = new ConditionalContinuousEffect( + new GainControlTargetEffect(Duration.Custom), + new SourceOnBattlefieldControlUnchangedCondition(), + "Gain control of target creature for as long as you control {this}"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, MeriekeRiBeritGainControlEffect, new TapSourceCost()); + ability.addTarget(new TargetPermanent(new FilterCreaturePermanent("target creature"))); + ability.addEffect(new MeriekeRiBeritCreateDelayedTriggerEffect()); + this.addAbility(ability); + + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} + +class MeriekeRiBeritCreateDelayedTriggerEffect extends OneShotEffect { + + public MeriekeRiBeritCreateDelayedTriggerEffect() { + super(Outcome.Detriment); + this.staticText = "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } + + public MeriekeRiBeritCreateDelayedTriggerEffect(final MeriekeRiBeritCreateDelayedTriggerEffect effect) { + super(effect); + } + + @Override + public MeriekeRiBeritCreateDelayedTriggerEffect copy() { + return new MeriekeRiBeritCreateDelayedTriggerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent controlledCreature = game.getPermanent(source.getFirstTarget()); + if (controlledCreature != null) { + DelayedTriggeredAbility delayedAbility = new MeriekeRiBeritDelayedTriggeredAbility(); + delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature.getId())); + delayedAbility.setSourceId(source.getSourceId()); + delayedAbility.setControllerId(source.getControllerId()); + delayedAbility.setSourceObject(source.getSourceObject(game), game); + delayedAbility.init(game); + game.addDelayedTriggeredAbility(delayedAbility); + return true; + } + return false; + } +} + +class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility { + + MeriekeRiBeritDelayedTriggeredAbility() { + super(new DestroyTargetEffect(true), Duration.EndOfGame, true); + } + + MeriekeRiBeritDelayedTriggeredAbility(MeriekeRiBeritDelayedTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ZONE_CHANGE + || event.getType() == EventType.UNTAPPED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getSourceId() != null) { + if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) + && event.getTargetId().equals(getSourceId())) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + return zEvent.getFromZone().equals(Zone.BATTLEFIELD); + } + } + return GameEvent.EventType.UNTAPPED.equals(event.getType()) + && event.getTargetId() != null && event.getTargetId().equals(getSourceId()); + } + + @Override + public MeriekeRiBeritDelayedTriggeredAbility copy() { + return new MeriekeRiBeritDelayedTriggeredAbility(this); + } + + @Override + public String getRule() { + return "When {this} leaves the battlefield or becomes untapped, destroy that creature. It can't be regenerated."; + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.java new file mode 100644 index 0000000000..af28ac5b00 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/VesuvanDoppelganger.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 jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEA"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.java new file mode 100644 index 0000000000..774d3949b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/VesuvanDoppelganger.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 jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "LEB"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java new file mode 100644 index 0000000000..ed540f3323 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/VesuvanDoppelganger.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 54; + this.expansionSetCode = "MED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.java new file mode 100644 index 0000000000..f47eda8e13 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/VesuvanDoppelganger.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 jeffwadsworth + */ +public class VesuvanDoppelganger extends mage.sets.unlimitededition.VesuvanDoppelganger { + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId); + this.cardNumber = 88; + this.expansionSetCode = "3ED"; + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java new file mode 100644 index 0000000000..a97d6ac8e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/MeriekeRiBerit.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class MeriekeRiBerit extends mage.sets.iceage.MeriekeRiBerit { + + public MeriekeRiBerit(UUID ownerId) { + super(ownerId); + this.cardNumber = 95; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public MeriekeRiBerit(final MeriekeRiBerit card) { + super(card); + } + + @Override + public MeriekeRiBerit copy() { + return new MeriekeRiBerit(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.java new file mode 100644 index 0000000000..ba1a2326a2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/VesuvanDoppelganger.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.unlimitededition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.EntersBattlefieldEffect; +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.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.util.functions.ApplyToPermanent; + +/** + * + * @author jeffwadsworth + */ +public class VesuvanDoppelganger extends CardImpl { + + private static final String rule = "You may have {this} enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains \"At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability.\""; + + public VesuvanDoppelganger(UUID ownerId) { + super(ownerId, 88, "Vesuvan Doppelganger", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // You may have Vesuvan Doppelganger enter the battlefield as a copy of any creature on the battlefield except it doesn't copy that creature's color and it gains "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability." + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new VesuvanDoppelgangerCopyEffect(), rule, true)); + this.addAbility(ability); + + } + + public VesuvanDoppelganger(final VesuvanDoppelganger card) { + super(card); + } + + @Override + public VesuvanDoppelganger copy() { + return new VesuvanDoppelganger(this); + } +} + +class VesuvanDoppelgangerCopyEffect extends OneShotEffect { + + private static final String rule2 = "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability."; + + public VesuvanDoppelgangerCopyEffect() { + super(Outcome.Copy); + } + + public VesuvanDoppelgangerCopyEffect(final VesuvanDoppelgangerCopyEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + final Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + Target target = new TargetPermanent(new FilterCreaturePermanent("target creature (you copy from)")); + target.setRequired(true); + if (source instanceof SimpleStaticAbility) { + target = new TargetPermanent(new FilterCreaturePermanent("creature (you copy from)")); + target.setRequired(false); + target.setNotTarget(true); + } + if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + controller.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) { + permanent.getColor(game).setColor(sourcePermanent.getColor(game)); + permanent.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, + new VesuvanDoppelgangerCopyEffect(), TargetController.YOU, true, false, rule2)); + return true; + } + }); + return true; + } + } + } + return false; + } + + @Override + public VesuvanDoppelgangerCopyEffect copy() { + return new VesuvanDoppelgangerCopyEffect(this); + } +} \ No newline at end of file From f31bf037fe851b681bf6573c6b47c6589fd1d284 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 08:31:34 +0300 Subject: [PATCH 15/63] Implement cards: Biorhythm, Denizen of the Deep, Final Punishment, and High Ground --- .../src/mage/sets/exodus/HighGround.java | 62 ++++++++++++ .../src/mage/sets/ninthedition/Biorhythm.java | 52 ++++++++++ .../sets/ninthedition/FinalPunishment.java | 52 ++++++++++ .../src/mage/sets/onslaught/Biorhythm.java | 99 +++++++++++++++++++ .../portalsecondage/DenizenOfTheDeep.java | 52 ++++++++++ .../mage/sets/scourge/FinalPunishment.java | 91 +++++++++++++++++ .../sets/starter1999/DenizenOfTheDeep.java | 52 ++++++++++ .../sets/tenthedition/DenizenOfTheDeep.java | 74 ++++++++++++++ .../mage/sets/tenthedition/HighGround.java | 52 ++++++++++ 9 files changed, 586 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/exodus/HighGround.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java create mode 100644 Mage.Sets/src/mage/sets/onslaught/Biorhythm.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java create mode 100644 Mage.Sets/src/mage/sets/scourge/FinalPunishment.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java create mode 100644 Mage.Sets/src/mage/sets/tenthedition/HighGround.java diff --git a/Mage.Sets/src/mage/sets/exodus/HighGround.java b/Mage.Sets/src/mage/sets/exodus/HighGround.java new file mode 100644 index 0000000000..7b5c3164f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/HighGround.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.exodus; + +import java.util.UUID; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class HighGround extends CardImpl { + + public HighGround(UUID ownerId) { + super(ownerId, 7, "High Ground", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "EXO"; + + // Each creature you control can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureAllEffect(1, new FilterControlledCreaturePermanent("Each creature you control"), Duration.WhileOnBattlefield))); + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.java new file mode 100644 index 0000000000..f9019b9608 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/Biorhythm.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.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Biorhythm extends mage.sets.onslaught.Biorhythm { + + public Biorhythm(UUID ownerId) { + super(ownerId); + this.cardNumber = 231; + this.expansionSetCode = "9ED"; + } + + public Biorhythm(final Biorhythm card) { + super(card); + } + + @Override + public Biorhythm copy() { + return new Biorhythm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.java new file mode 100644 index 0000000000..1db22add0b --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/FinalPunishment.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.ninthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends mage.sets.scourge.FinalPunishment { + + public FinalPunishment(UUID ownerId) { + super(ownerId); + this.cardNumber = 131; + this.expansionSetCode = "9ED"; + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.java new file mode 100644 index 0000000000..d3ddf2be15 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/Biorhythm.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.onslaught; + +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.players.Player; + +/** + * + * @author LoneFox + */ +public class Biorhythm extends CardImpl { + + public Biorhythm(UUID ownerId) { + super(ownerId, 247, "Biorhythm", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{6}{G}{G}"); + this.expansionSetCode = "ONS"; + + // Each player's life total becomes the number of creatures he or she controls. + this.getSpellAbility().addEffect(new BiorhythmEffect()); + } + + public Biorhythm(final Biorhythm card) { + super(card); + } + + @Override + public Biorhythm copy() { + return new Biorhythm(this); + } +} + +class BiorhythmEffect extends OneShotEffect { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); + + public BiorhythmEffect() { + super(Outcome.Neutral); + this.staticText = "Each player's life total becomes the number of creatures he or she controls"; + } + + public BiorhythmEffect(final BiorhythmEffect effect) { + super(effect); + } + + @Override + public BiorhythmEffect copy() { + return new BiorhythmEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for(UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if(player != null) { + int diff = player.getLife() - game.getBattlefield().countAll(filter, playerId, game); + if(diff > 0) { + player.loseLife(diff, game); + } + if(diff < 0) { + player.gainLife(-diff, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.java new file mode 100644 index 0000000000..6a651acbe7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/DenizenOfTheDeep.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 LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 36; + this.expansionSetCode = "PO2"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java new file mode 100644 index 0000000000..6fe0446b51 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/FinalPunishment.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.dynamicvalue.DynamicValue; +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.game.Game; +import mage.target.TargetPlayer; +import mage.watchers.common.AmountOfDamageAPlayerReceivedThisTurnWatcher; + +/** + * + * @author LoneFox + */ +public class FinalPunishment extends CardImpl { + + public FinalPunishment(UUID ownerId) { + super(ownerId, 67, "Final Punishment", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{B}{B}"); + this.expansionSetCode = "SCG"; + + // Target player loses life equal to the damage already dealt to him or her this turn. + Effect effect = new LoseLifeTargetEffect(new FinalPunishmentAmount()); + effect.setText("target player loses life equal to the damage already dealt to him or her this turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addWatcher(new AmountOfDamageAPlayerReceivedThisTurnWatcher()); + } + + public FinalPunishment(final FinalPunishment card) { + super(card); + } + + @Override + public FinalPunishment copy() { + return new FinalPunishment(this); + } +} + +class FinalPunishmentAmount implements DynamicValue { + + @Override + public int calculate(Game game, Ability source, Effect effect) { + AmountOfDamageAPlayerReceivedThisTurnWatcher watcher + = (AmountOfDamageAPlayerReceivedThisTurnWatcher) game.getState().getWatchers().get("AmountOfDamageReceivedThisTurn"); + if(watcher != null) { + return watcher.getAmountOfDamageReceivedThisTurn(source.getFirstTarget()); + } + return 0; + } + + @Override + public FinalPunishmentAmount copy() { + return new FinalPunishmentAmount(); + } + + @Override + public String getMessage() { + return "the damage already dealt to him or her this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.java new file mode 100644 index 0000000000..fe93c5366f --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/DenizenOfTheDeep.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 LoneFox + */ +public class DenizenOfTheDeep extends mage.sets.tenthedition.DenizenOfTheDeep { + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId); + this.cardNumber = 35; + this.expansionSetCode = "S99"; + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.java new file mode 100644 index 0000000000..744f4560a1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/DenizenOfTheDeep.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.tenthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class DenizenOfTheDeep extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + + static{ + filter.add(new AnotherPredicate()); + } + + public DenizenOfTheDeep(UUID ownerId) { + super(ownerId, 80, "Denizen of the Deep", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + this.expansionSetCode = "10E"; + this.subtype.add("Serpent"); + this.power = new MageInt(11); + this.toughness = new MageInt(11); + + // When Denizen of the Deep enters the battlefield, return each other creature you control to its owner's hand. + Effect effect = new ReturnToHandFromBattlefieldAllEffect(filter); + effect.setText("return each other creature you control to its owner's hand"); + this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); + } + + public DenizenOfTheDeep(final DenizenOfTheDeep card) { + super(card); + } + + @Override + public DenizenOfTheDeep copy() { + return new DenizenOfTheDeep(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tenthedition/HighGround.java b/Mage.Sets/src/mage/sets/tenthedition/HighGround.java new file mode 100644 index 0000000000..dc2e0954cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/tenthedition/HighGround.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 LoneFox + */ +public class HighGround extends mage.sets.exodus.HighGround { + + public HighGround(UUID ownerId) { + super(ownerId); + this.cardNumber = 20; + this.expansionSetCode = "10E"; + } + + public HighGround(final HighGround card) { + super(card); + } + + @Override + public HighGround copy() { + return new HighGround(this); + } +} From e32e7a4638d605b932cc3360b7cec785b93a68ee Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 09:42:17 +0200 Subject: [PATCH 16/63] Added a fix for the serverlist URL setting to automatically switch xmage.info to xmage.de. --- .../mage/client/dialog/ConnectDialog.java | 105 +++++++++--------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java index 0eec9111ea..ba8cbb2bf6 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java @@ -1,46 +1,39 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ /* * ConnectDialog.java * * Created on 20-Jan-2010, 9:37:07 PM */ - package mage.client.dialog; -import mage.client.MageFrame; -import mage.client.util.Config; -import mage.remote.Connection; -import org.apache.log4j.Logger; - -import javax.swing.*; -import java.awt.*; +import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; @@ -63,10 +56,17 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import javax.swing.JOptionPane; +import javax.swing.SwingWorker; +import mage.client.MageFrame; +import static mage.client.dialog.PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_AUTO_CONNECT; import static mage.client.dialog.PreferencesDialog.KEY_CONNECT_FLAG; +import mage.client.util.Config; import mage.client.util.gui.countryBox.CountryItemEditor; +import mage.remote.Connection; import mage.remote.Connection.ProxyType; +import org.apache.log4j.Logger; /** * @author BetaSteward_at_googlemail.com @@ -101,11 +101,11 @@ public class ConnectDialog extends MageDialog { this.txtUserName.setText(MageFrame.getPreferences().get("userName", "")); this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get(KEY_CONNECT_AUTO_CONNECT, "false"))); this.chkForceUpdateDB.setSelected(false); // has always to be set manually to force comparison - + String selectedFlag = MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"); // set the selected country/flag for (int i = 0; i < cbFlag.getItemCount(); i++) { - String[] name = (String[])cbFlag.getItemAt(i); + String[] name = (String[]) cbFlag.getItemAt(i); if (name[1].equals(selectedFlag)) { cbFlag.setSelectedIndex(i); break; @@ -124,10 +124,9 @@ public class ConnectDialog extends MageDialog { } /** - * This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents @@ -293,7 +292,7 @@ public class ConnectDialog extends MageDialog { private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected())); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); if (task != null && !task.isDone()) { task.cancel(true); } else { @@ -329,7 +328,7 @@ public class ConnectDialog extends MageDialog { connection.setPort(Integer.valueOf(this.txtPort.getText().trim())); connection.setUsername(this.txtUserName.getText().trim()); connection.setForceDBComparison(this.chkForceUpdateDB.isSelected()); - MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor)cbFlag.getEditor()).getImageItem()); + MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem()); ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); @@ -354,8 +353,8 @@ public class ConnectDialog extends MageDialog { } // pref settings - MageFrame.getInstance().setUserPrefsToConnection(connection); - + MageFrame.getInstance().setUserPrefsToConnection(connection); + logger.debug("connecting: " + connection.getProxyType() + " " + connection.getProxyHost() + " " + connection.getProxyPort()); task = new ConnectTask(); task.execute(); @@ -385,7 +384,7 @@ public class ConnectDialog extends MageDialog { get(CONNECTION_TIMEOUT_MS, TimeUnit.MILLISECONDS); setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); if (result) { - lblStatus.setText(""); + lblStatus.setText(""); connected(); MageFrame.getInstance().showGames(false); } else { @@ -412,7 +411,6 @@ public class ConnectDialog extends MageDialog { this.hideDialog(); } - private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped char c = evt.getKeyChar(); if (!Character.isDigit(c)) { @@ -428,8 +426,12 @@ public class ConnectDialog extends MageDialog { private void findPublicServerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed BufferedReader in = null; try { - - URL serverListURL = new URL(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt")); + String serverUrl = PreferencesDialog.getCachedValue(KEY_CONNECTION_URL_SERVER_LIST, "http://xmage.de/files/server-list.txt"); + if (serverUrl.contains("xmage.info/files/")) { + serverUrl = serverUrl.replace("xmage.info/files/", "xmage.de/files/"); // replace old URL if still saved + PreferencesDialog.saveValue(KEY_CONNECTION_URL_SERVER_LIST, serverUrl); + } + URL serverListURL = new URL(serverUrl); Connection.ProxyType configProxyType = Connection.ProxyType.valueByText(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_PROXY_TYPE, "None")); Proxy p = null; @@ -465,12 +467,12 @@ public class ConnectDialog extends MageDialog { boolean URLNotFound = false; try { in = new BufferedReader(new InputStreamReader(serverListURL.openConnection(p).getInputStream())); - } catch (SocketTimeoutException |FileNotFoundException | UnknownHostException ex ) { + } catch (SocketTimeoutException | FileNotFoundException | UnknownHostException ex) { logger.warn("Could not read serverlist from: " + serverListURL.toString()); File f = new File("serverlist.txt"); if (f.exists() && !f.isDirectory()) { logger.info("Using buffered serverlist: serverlist.txt"); - URLNotFound = true; + URLNotFound = true; in = new BufferedReader(new FileReader("serverlist.txt")); } } @@ -518,7 +520,7 @@ public class ConnectDialog extends MageDialog { JOptionPane.showMessageDialog(null, "Wrong server data format."); } } - + } catch (Exception ex) { logger.error(ex, ex); } finally { @@ -539,7 +541,6 @@ public class ConnectDialog extends MageDialog { // TODO add your handling code here: }//GEN-LAST:event_chkForceUpdateDBActionPerformed - // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancel; private javax.swing.JButton btnConnect; From e8983ae992e8e8a7c2b7e03cb4a52e8c4e0c28ea Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 09:55:58 +0200 Subject: [PATCH 17/63] Fixed that cards moved from hand to library were named in the log by default. --- Mage/src/mage/players/PlayerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 631b5614a3..dbcd6373b2 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -2983,8 +2983,8 @@ public abstract class PlayerImpl implements Player, Serializable { case LIBRARY: for (Card card : cards) { fromZone = game.getState().getZone(card.getId()); - boolean withName = fromZone.equals(Zone.BATTLEFIELD) || !card.isFaceDown(game); - if (moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, withName)) { + boolean hideCard = fromZone.equals(Zone.HAND) || fromZone.equals(Zone.LIBRARY); + if (moveCardToLibraryWithInfo(card, source == null ? null : source.getSourceId(), game, fromZone, true, !hideCard)) { successfulMovedCards.add(card); } } From 9f4a0b008d5d04c74db98b870eec463f41e998fe Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 09:56:30 +0200 Subject: [PATCH 18/63] Fixed an text reference to xmage.info. --- .../src/mage/remote/MageVersionException.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Mage.Common/src/mage/remote/MageVersionException.java b/Mage.Common/src/mage/remote/MageVersionException.java index 4da5aec0dd..33108ab2d6 100644 --- a/Mage.Common/src/mage/remote/MageVersionException.java +++ b/Mage.Common/src/mage/remote/MageVersionException.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. @@ -38,8 +38,8 @@ public class MageVersionException extends MageException { private final MageVersion serverVersion; - public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { - super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.info or http://www.slightlymagic.net/forum/viewforum.php?f=70"); + public MageVersionException(MageVersion clientVersion, MageVersion serverVersion) { + super("Wrong client version " + clientVersion + ", expecting version " + serverVersion + ". \r\n\r\nPlease download needed version from http://XMage.de or http://www.slightlymagic.net/forum/viewforum.php?f=70"); this.serverVersion = serverVersion; } From da45a3d92142d0b344573dee81cb29623d55ae5b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:36:43 +0200 Subject: [PATCH 19/63] * The Great Aurora - Fixed that abilities of permanents moved to library triggered from later card draw or putting cards into play. --- Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java index 93e61a08d9..c6fc391ddf 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java +++ b/Mage.Sets/src/mage/sets/magicorigins/TheGreatAurora.java @@ -117,10 +117,12 @@ class TheGreatAuroraEffect extends OneShotEffect { for (Permanent permanent : list) { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); } - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } } + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or put into play + // Draw cards for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); From 5115776c6d047ee99363137f4fcaa6b8a76c668b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:37:25 +0200 Subject: [PATCH 20/63] * Warp World - Fixed that abilities of permanents moved to library triggered from later card draw or putting cards into play. --- .../src/mage/sets/magic2010/WarpWorld.java | 159 +++++++++--------- 1 file changed, 76 insertions(+), 83 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java index ef4217d596..3fac6066e2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java +++ b/Mage.Sets/src/mage/sets/magic2010/WarpWorld.java @@ -27,25 +27,25 @@ */ package mage.sets.magic2010; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.List; +import java.util.LinkedHashSet; import java.util.Map; +import java.util.Set; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; 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.permanent.Permanent; import mage.players.Player; -import mage.players.PlayerList; /** * @@ -57,7 +57,6 @@ public class WarpWorld extends CardImpl { super(ownerId, 163, "Warp World", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}{R}"); this.expansionSetCode = "M10"; - // Each player shuffles all permanents he or she owns into his or her library, then reveals that many cards from the top of his or her library. Each player puts all artifact, creature, and land cards revealed this way onto the battlefield, then does the same for enchantment cards, then puts all cards revealed this way that weren't put onto the battlefield on the bottom of his or her library. this.getSpellAbility().addEffect(new WarpWorldEffect()); } @@ -90,105 +89,99 @@ class WarpWorldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Map> permanentsOwned = new HashMap<>(); - + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject == null) { + return false; + } + Map> permanentsOwned = new HashMap<>(); Collection permanents = game.getBattlefield().getAllPermanents(); for (Permanent permanent : permanents) { - List list = permanentsOwned.get(permanent.getOwnerId()); - if (list == null) { - list = new ArrayList<>(); + Set set = permanentsOwned.get(permanent.getOwnerId()); + if (set == null) { + set = new LinkedHashSet<>(); } - list.add(permanent); - permanentsOwned.put(permanent.getOwnerId(), list); + set.add(permanent); + permanentsOwned.put(permanent.getOwnerId(), set); } // shuffle permanents into owner's library Map permanentsCount = new HashMap<>(); - PlayerList playerList = game.getPlayerList(); - playerList.setCurrent(game.getActivePlayerId()); - Player player = game.getPlayer(game.getActivePlayerId()); - do { - List list = permanentsOwned.remove(player.getId()); - Integer count = 0; - if (list != null) { - count = list.size(); - for (Permanent permanent : list) { - permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Set set = permanentsOwned.remove(playerId); + Integer count = 0; + if (set != null) { + count = set.size(); + player.moveCards(set, Zone.BATTLEFIELD, Zone.LIBRARY, source, game); } + + if (count > 0) { + player.shuffleLibrary(game); + } + permanentsCount.put(playerId, count); } + } - if (count > 0) { - player.shuffleLibrary(game); - } - - permanentsCount.put(player.getId(), count); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw or later put into play Map cardsRevealed = new HashMap<>(); // draw cards and reveal them - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); - CardsImpl cards = new CardsImpl(); - for (int i = 0; i < count; i++) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + Integer count = Math.min(permanentsCount.get(player.getId()), player.getLibrary().size()); + CardsImpl cards = new CardsImpl(); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + } } + player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ")", cards, game); + cardsRevealed.put(player.getId(), cards); } - player.revealCards("Warp World " + player.getName(), cards, game); - - cardsRevealed.put(player.getId(), cards); - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put artifacts, creaturs and lands onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && (card.getCardType().contains(CardType.ARTIFACT) - || card.getCardType().contains(CardType.CREATURE) - || card.getCardType().contains(CardType.LAND))) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && (card.getCardType().contains(CardType.ARTIFACT) + || card.getCardType().contains(CardType.CREATURE) + || card.getCardType().contains(CardType.LAND))) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put enchantments onto the battlefield - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - for (Card card : cards.getCards(game)) { - if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); - cards.remove(card); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + for (Card card : cards.getCards(game)) { + if (card != null && card.getCardType().contains(CardType.ENCHANTMENT)) { + card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), player.getId()); + cards.remove(card); + } } + } - - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + } // put the rest of the cards on buttom of the library - playerList.setCurrent(game.getActivePlayerId()); - player = game.getPlayer(game.getActivePlayerId()); - do { - CardsImpl cards = cardsRevealed.get(player.getId()); - player.putCardsOnBottomOfLibrary(cards, game, source, false); - player = playerList.getNext(game); - } while (!player.getId().equals(game.getActivePlayerId())); - + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + CardsImpl cards = cardsRevealed.get(player.getId()); + player.putCardsOnBottomOfLibrary(cards, game, source, false); + } + } return true; } } From 571c1cd640becd2383ec80e32a0ecf1adb233f07 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:37:58 +0200 Subject: [PATCH 21/63] * Molten Psyche - Fixed that abilities of permanents moved to library triggered from later card draw or putting cards into play. --- Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java index 42122cfa4c..2f8ea8af1a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenPsyche.java @@ -101,6 +101,9 @@ class MoltenPsycheEffect extends OneShotEffect { player.shuffleLibrary(game); } } + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw action + for (UUID playerId : cardsToDraw.keySet()) { Player player = game.getPlayer(playerId); if (player != null) { From 752335f4ab4b64eab595b6313529a18e36c0c628 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:39:57 +0200 Subject: [PATCH 22/63] * Winds of Change - Fixed wrong order hadling of moving cards to libraray and draw. --- .../mage/sets/fifthedition/WindsOfChange.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java index bcc08cf053..c056c1ec21 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java +++ b/Mage.Sets/src/mage/sets/fifthedition/WindsOfChange.java @@ -27,10 +27,11 @@ */ package mage.sets.fifthedition; +import java.util.HashMap; +import java.util.Map; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -49,7 +50,6 @@ public class WindsOfChange extends CardImpl { super(ownerId, 275, "Winds of Change", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{R}"); this.expansionSetCode = "5ED"; - // Each player shuffles the cards from his or her hand into his or her library, then draws that many cards. this.getSpellAbility().addEffect(new WindsOfChangeEffect()); } @@ -84,19 +84,19 @@ class WindsOfChangeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (UUID playerId : controller.getInRange()) { + Map permanentsCount = new HashMap<>(); + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - int cardsHand = player.getHand().size(); - if (cardsHand > 0){ - for (Card card: player.getHand().getCards(game)) { - player.removeFromHand(card, game); - card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - } - game.informPlayers(player.getLogName() + " shuffles the cards from his or her hand into his or her library"); - player.shuffleLibrary(game); - player.drawCards(cardsHand, game); - } + permanentsCount.put(playerId, player.getHand().size()); + player.moveCards(player.getHand(), Zone.HAND, Zone.LIBRARY, source, game); + player.shuffleLibrary(game); + } + } + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null && permanentsCount.containsKey(playerId)) { + player.drawCards(permanentsCount.get(playerId), game); } } return true; From 477401534301b5d848980d1ea5dc2a75408e72eb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:40:49 +0200 Subject: [PATCH 23/63] * Oblation - Fixed that abilities of the permanent moved to library triggered from later card draw. --- Mage.Sets/src/mage/sets/onslaught/Oblation.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/onslaught/Oblation.java b/Mage.Sets/src/mage/sets/onslaught/Oblation.java index af44e16f60..5bf88ee64a 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Oblation.java +++ b/Mage.Sets/src/mage/sets/onslaught/Oblation.java @@ -50,7 +50,6 @@ public class Oblation extends CardImpl { super(ownerId, 46, "Oblation", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{W}"); this.expansionSetCode = "ONS"; - // The owner of target nonland permanent shuffles it into his or her library, then draws two cards. this.getSpellAbility().addEffect(new OblationEffect()); this.getSpellAbility().addTarget(new TargetNonlandPermanent()); @@ -67,21 +66,21 @@ public class Oblation extends CardImpl { } class OblationEffect extends OneShotEffect { - + OblationEffect() { super(Outcome.Removal); this.staticText = "The owner of target nonland permanent shuffles it into his or her library, then draws two cards"; } - + OblationEffect(final OblationEffect effect) { super(effect); } - + @Override public OblationEffect copy() { return new OblationEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); @@ -90,6 +89,9 @@ class OblationEffect extends OneShotEffect { if (player != null) { player.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, true, true); player.shuffleLibrary(game); + + game.applyEffects(); // so effects from creatures that were on the battlefield won't trigger from draw + player.drawCards(2, game); return true; } From 447e42409bf78f17f632f77da42411afaebed0c3 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 10:53:13 +0200 Subject: [PATCH 24/63] * Lieutenant - Fixed that the Lieutenant effects were also applied if the commander was controlled by another player as the commander owner. --- .../condition/common/CommanderInPlayCondition.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java index 26196743f8..1a7e9fc393 100644 --- a/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java +++ b/Mage/src/mage/abilities/condition/common/CommanderInPlayCondition.java @@ -30,11 +30,11 @@ package mage.abilities.condition.common; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.game.Game; +import mage.game.permanent.Permanent; import mage.players.Player; - /** - * Checks if the player has its commander in play + * Checks if the player has its commander in play and controls it * * @author LevelX2 */ @@ -42,7 +42,8 @@ public class CommanderInPlayCondition implements Condition { private static CommanderInPlayCondition fInstance = null; - private CommanderInPlayCondition() {} + private CommanderInPlayCondition() { + } public static Condition getInstance() { if (fInstance == null) { @@ -55,7 +56,8 @@ public class CommanderInPlayCondition implements Condition { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - return game.getPermanent(controller.getCommanderId()) != null; + Permanent commander = game.getPermanent(controller.getCommanderId()); + return commander != null && commander.getControllerId().equals(source.getControllerId()); } return false; } @@ -65,4 +67,4 @@ public class CommanderInPlayCondition implements Condition { return "As long as you control your commander"; } -} \ No newline at end of file +} From 4c446bd1c57b080b81b724c54f11f919e36f599b Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 17:38:42 +0300 Subject: [PATCH 25/63] Add SacrificeCostConvertedMana and use it for Bosh, Iron Golem. Implement cards: Faith Healer, Priest of Yawgmoth, Sacrifice, and Soldevi Adnate --- .../mage/sets/alliances/SoldeviAdnate1.java | 83 +++++++++++++++++++ .../mage/sets/alliances/SoldeviAdnate2.java | 55 ++++++++++++ .../sets/antiquities/PriestOfYawgmoth.java | 73 ++++++++++++++++ .../src/mage/sets/limitedalpha/Sacrifice.java | 52 ++++++++++++ .../src/mage/sets/limitedbeta/Sacrifice.java | 52 ++++++++++++ .../mage/sets/planechase/BoshIronGolem.java | 74 +++-------------- .../mage/sets/revisededition/Sacrifice.java | 52 ++++++++++++ .../mage/sets/unlimitededition/Sacrifice.java | 65 +++++++++++++++ .../src/mage/sets/urzassaga/FaithHealer.java | 70 ++++++++++++++++ .../common/SacrificeCostConvertedMana.java | 82 ++++++++++++++++++ 10 files changed, 596 insertions(+), 62 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java create mode 100644 Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java create mode 100644 Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Sacrifice.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java create mode 100644 Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.java new file mode 100644 index 0000000000..6dc868b548 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate1.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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate1 extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black or artifact creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.BLACK), new CardTypePredicate(CardType.ARTIFACT))); + } + + public SoldeviAdnate1(UUID ownerId) { + super(ownerId, 25, "Soldevi Adnate", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ALL"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice a black or artifact creature: Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + this.addAbility(ability); + } + + public SoldeviAdnate1(final SoldeviAdnate1 card) { + super(card); + } + + @Override + public SoldeviAdnate1 copy() { + return new SoldeviAdnate1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.java new file mode 100644 index 0000000000..644ac23148 --- /dev/null +++ b/Mage.Sets/src/mage/sets/alliances/SoldeviAdnate2.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.alliances; + +import java.util.UUID; +import mage.MageInt; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SoldeviAdnate2 extends SoldeviAdnate1 { + + public SoldeviAdnate2(UUID ownerId) { + super(ownerId); + this.cardNumber = 26; + } + + public SoldeviAdnate2(final SoldeviAdnate2 card) { + super(card); + } + + @Override + public SoldeviAdnate2 copy() { + return new SoldeviAdnate2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java new file mode 100644 index 0000000000..e648e0db97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/antiquities/PriestOfYawgmoth.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.mana.DynamicManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterControlledArtifactPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class PriestOfYawgmoth extends CardImpl { + + public PriestOfYawgmoth(UUID ownerId) { + super(ownerId, 49, "Priest of Yawgmoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ATQ"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}, Sacrifice an artifact: Add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost. + Ability ability = new DynamicManaAbility(Mana.BlackMana, new SacrificeCostConvertedMana("artifact"), + new TapSourceCost(), "add to your mana pool an amount of {B} equal to the sacrificed artifact's converted mana cost"); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent()))); + this.addAbility(ability); + } + + public PriestOfYawgmoth(final PriestOfYawgmoth card) { + super(card); + } + + @Override + public PriestOfYawgmoth copy() { + return new PriestOfYawgmoth(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java new file mode 100644 index 0000000000..678d76f7bc --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEA"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java new file mode 100644 index 0000000000..e218a2307d --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Sacrifice.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 33; + this.expansionSetCode = "LEB"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java index 769221d7eb..34c051fa00 100644 --- a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java +++ b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java @@ -29,24 +29,20 @@ package mage.sets.planechase; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +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.permanent.Permanent; -import mage.players.Player; +import mage.filter.common.FilterControlledArtifactPermanent; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -55,13 +51,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author jeffwadsworth */ public class BoshIronGolem extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - + public BoshIronGolem(UUID ownerId) { super(ownerId, 108, "Bosh, Iron Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{8}"); this.expansionSetCode = "HOP"; @@ -73,10 +63,12 @@ public class BoshIronGolem extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); - + // {3}{R}, Sacrifice an artifact: Bosh, Iron Golem deals damage equal to the sacrificed artifact's converted mana cost to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoshIronGolemEffect(), new ManaCostsImpl("{3}{R}")); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter))); + Effect effect = new DamageTargetEffect(new SacrificeCostConvertedMana("artifact")); + effect.setText("{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } @@ -90,45 +82,3 @@ public class BoshIronGolem extends CardImpl { return new BoshIronGolem(this); } } - -class BoshIronGolemEffect extends OneShotEffect { - - public BoshIronGolemEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed artifact's converted mana cost to target creature or player"; - } - - public BoshIronGolemEffect(final BoshIronGolemEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost: source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost)cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost)cost).getPermanents().get(0).getManaCost().convertedManaCost(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BoshIronGolemEffect copy() { - return new BoshIronGolemEffect(this); - } - -} diff --git a/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.java new file mode 100644 index 0000000000..acce4e3f6e --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Sacrifice.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 LoneFox + */ +public class Sacrifice extends mage.sets.unlimitededition.Sacrifice { + + public Sacrifice(UUID ownerId) { + super(ownerId); + this.cardNumber = 34; + this.expansionSetCode = "3ED"; + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.java new file mode 100644 index 0000000000..b62d1a7e56 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Sacrifice.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.unlimitededition; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +import mage.abilities.effects.common.DynamicManaEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Sacrifice extends CardImpl { + + public Sacrifice(UUID ownerId) { + super(ownerId, 33, "Sacrifice", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "2ED"; + + // As an additional cost to cast Sacrifice, sacrifice a creature. + this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + // Add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost. + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.BlackMana, new SacrificeCostConvertedMana("creature"), + "add to your mana pool an amount of {B} equal to the sacrificed creature's converted mana cost")); + } + + public Sacrifice(final Sacrifice card) { + super(card); + } + + @Override + public Sacrifice copy() { + return new Sacrifice(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.java new file mode 100644 index 0000000000..37a5258072 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/FaithHealer.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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.common.SacrificeCostConvertedMana; +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.common.FilterControlledEnchantmentPermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class FaithHealer extends CardImpl { + + public FaithHealer(UUID ownerId) { + super(ownerId, 14, "Faith Healer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "USG"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Sacrifice an enchantment: You gain life equal to the sacrificed enchantment's converted mana cost. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(new SacrificeCostConvertedMana("enchantment")), + new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledEnchantmentPermanent())))); + } + + public FaithHealer(final FaithHealer card) { + super(card); + } + + @Override + public FaithHealer copy() { + return new FaithHealer(this); + } +} diff --git a/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.java new file mode 100644 index 0000000000..5de2bff16d --- /dev/null +++ b/Mage/src/mage/abilities/dynamicvalue/common/SacrificeCostConvertedMana.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.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.costs.Cost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author LoneFox + */ +public class SacrificeCostConvertedMana implements DynamicValue { + + private final String type; + + public SacrificeCostConvertedMana(String type) { + this.type = type; + } + + public SacrificeCostConvertedMana(SacrificeCostConvertedMana value) { + this.type = value.type; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + for(Cost cost : sourceAbility.getCosts()) { + if(cost instanceof SacrificeTargetCost) { + SacrificeTargetCost sacrificeCost = (SacrificeTargetCost) cost; + int totalCMC = 0; + for(Permanent permanent : sacrificeCost.getPermanents()) { + totalCMC += permanent.getManaCost().convertedManaCost(); + } + return totalCMC; + } + } + return 0; + } + + @Override + public SacrificeCostConvertedMana copy() { + return new SacrificeCostConvertedMana(this); + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return "the sacrificed " + type + "'s converted mana cost"; + } +} From ff8d0dad875e8911632b7134412f523509ed7a00 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 17:53:44 +0300 Subject: [PATCH 26/63] Fix card numbers of 4th edition Blessing and 5th edition Heal --- Mage.Sets/src/mage/sets/fifthedition/Heal.java | 2 +- Mage.Sets/src/mage/sets/fourthedition/Blessing.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/fifthedition/Heal.java b/Mage.Sets/src/mage/sets/fifthedition/Heal.java index fd8451be21..36445dd90b 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/Heal.java +++ b/Mage.Sets/src/mage/sets/fifthedition/Heal.java @@ -37,7 +37,7 @@ public class Heal extends mage.sets.iceage.Heal { public Heal(UUID ownerId) { super(ownerId); - this.cardNumber = 309; + this.cardNumber = 308; this.expansionSetCode = "5ED"; } diff --git a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java index 081b3a0bbf..c05d454aa1 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/Blessing.java +++ b/Mage.Sets/src/mage/sets/fourthedition/Blessing.java @@ -51,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class Blessing extends CardImpl { public Blessing(UUID ownerId) { - super(ownerId, 1, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); + super(ownerId, 259, "Blessing", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}"); this.expansionSetCode = "4ED"; this.subtype.add("Aura"); From 83e8306da844219a37b1c8400f45e568f499b9e5 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 18:59:21 +0300 Subject: [PATCH 27/63] Implement cards: Cursed Land, Feedback, Wanderlust, and Warp Artifact --- .../mage/sets/fifthedition/CursedLand.java | 52 +++++++++++++ .../src/mage/sets/fifthedition/Feedback.java | 52 +++++++++++++ .../mage/sets/fifthedition/Wanderlust.java | 52 +++++++++++++ .../mage/sets/fifthedition/WarpArtifact.java | 76 +++++++++++++++++++ .../mage/sets/fourthedition/CursedLand.java | 76 +++++++++++++++++++ .../src/mage/sets/fourthedition/Feedback.java | 52 +++++++++++++ .../mage/sets/fourthedition/Wanderlust.java | 52 +++++++++++++ .../mage/sets/fourthedition/WarpArtifact.java | 52 +++++++++++++ .../mage/sets/limitedalpha/CursedLand.java | 52 +++++++++++++ .../src/mage/sets/limitedalpha/Feedback.java | 76 +++++++++++++++++++ .../mage/sets/limitedalpha/Wanderlust.java | 52 +++++++++++++ .../mage/sets/limitedalpha/WarpArtifact.java | 52 +++++++++++++ .../src/mage/sets/limitedbeta/CursedLand.java | 52 +++++++++++++ .../src/mage/sets/limitedbeta/Feedback.java | 52 +++++++++++++ .../src/mage/sets/limitedbeta/Wanderlust.java | 52 +++++++++++++ .../mage/sets/limitedbeta/WarpArtifact.java | 52 +++++++++++++ .../mage/sets/mastersedition/Wanderlust.java | 54 +++++++++++++ .../sets/masterseditioniv/WarpArtifact.java | 54 +++++++++++++ .../mage/sets/revisededition/CursedLand.java | 52 +++++++++++++ .../mage/sets/revisededition/Feedback.java | 52 +++++++++++++ .../mage/sets/revisededition/Wanderlust.java | 52 +++++++++++++ .../sets/revisededition/WarpArtifact.java | 52 +++++++++++++ .../sets/unlimitededition/CursedLand.java | 52 +++++++++++++ .../mage/sets/unlimitededition/Feedback.java | 52 +++++++++++++ .../sets/unlimitededition/Wanderlust.java | 76 +++++++++++++++++++ .../sets/unlimitededition/WarpArtifact.java | 52 +++++++++++++ 26 files changed, 1452 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/Feedback.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java new file mode 100644 index 0000000000..06e2141027 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 14; + this.expansionSetCode = "5ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Feedback.java b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java new file mode 100644 index 0000000000..7b730ff317 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 85; + this.expansionSetCode = "5ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java new file mode 100644 index 0000000000..206e8abeec --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fifthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "5ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.java new file mode 100644 index 0000000000..27207beb93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/WarpArtifact.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.fifthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +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.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends CardImpl { + + public WarpArtifact(UUID ownerId) { + super(ownerId, 66, "Warp Artifact", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant artifact + TargetPermanent auraTarget = new TargetArtifactPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted artifact's controller, Warp Artifact deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.java new file mode 100644 index 0000000000..0ae7aa7192 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CursedLand.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.fourthedition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +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.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author LoneFox + */ +public class CursedLand extends CardImpl { + + public CursedLand(UUID ownerId) { + super(ownerId, 11, "Cursed Land", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); + this.expansionSetCode = "4ED"; + this.subtype.add("Aura"); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted land's controller, Cursed Land deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Feedback.java b/Mage.Sets/src/mage/sets/fourthedition/Feedback.java new file mode 100644 index 0000000000..937483999e --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Feedback.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 71; + this.expansionSetCode = "4ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.java new file mode 100644 index 0000000000..8f94030827 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Wanderlust.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 169; + this.expansionSetCode = "4ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.java new file mode 100644 index 0000000000..7cac4f6ce7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/WarpArtifact.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 53; + this.expansionSetCode = "4ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java new file mode 100644 index 0000000000..d6e94cef77 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEA"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.java new file mode 100644 index 0000000000..083eb5edfa --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Feedback.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.limitedalpha; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +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.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author LoneFox + */ +public class Feedback extends CardImpl { + + public Feedback(UUID ownerId) { + super(ownerId, 58, "Feedback", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); + this.expansionSetCode = "LEA"; + this.subtype.add("Aura"); + + // Enchant enchantment + TargetPermanent auraTarget = new TargetEnchantmentPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted enchantment's controller, Feedback deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java new file mode 100644 index 0000000000..0945cecfaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEA"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java new file mode 100644 index 0000000000..758a2d582b --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedalpha; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEA"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java new file mode 100644 index 0000000000..69f25a3597 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "LEB"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java new file mode 100644 index 0000000000..61edab0c87 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "LEB"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java new file mode 100644 index 0000000000..037a3591fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Wanderlust.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 135; + this.expansionSetCode = "LEB"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java new file mode 100644 index 0000000000..50673ecf58 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "LEB"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java new file mode 100644 index 0000000000..06e9dbc252 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mastersedition/Wanderlust.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.mastersedition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 137; + this.expansionSetCode = "MED"; + this.rarity = Rarity.COMMON; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.java new file mode 100644 index 0000000000..d9dfb23128 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WarpArtifact.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 LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 100; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.COMMON; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/CursedLand.java b/Mage.Sets/src/mage/sets/revisededition/CursedLand.java new file mode 100644 index 0000000000..bae229c5d2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/CursedLand.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 LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "3ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Feedback.java b/Mage.Sets/src/mage/sets/revisededition/Feedback.java new file mode 100644 index 0000000000..31cd18bffb --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Feedback.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 LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "3ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.java new file mode 100644 index 0000000000..522ce6f4bf --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Wanderlust.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 LoneFox + */ +public class Wanderlust extends mage.sets.unlimitededition.Wanderlust { + + public Wanderlust(UUID ownerId) { + super(ownerId); + this.cardNumber = 134; + this.expansionSetCode = "3ED"; + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.java new file mode 100644 index 0000000000..d0db483889 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/WarpArtifact.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 LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 43; + this.expansionSetCode = "3ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java new file mode 100644 index 0000000000..7ee2487d27 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/CursedLand.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CursedLand extends mage.sets.fourthedition.CursedLand { + + public CursedLand(UUID ownerId) { + super(ownerId); + this.cardNumber = 6; + this.expansionSetCode = "2ED"; + } + + public CursedLand(final CursedLand card) { + super(card); + } + + @Override + public CursedLand copy() { + return new CursedLand(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java new file mode 100644 index 0000000000..0d7fd8ae9f --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Feedback.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class Feedback extends mage.sets.limitedalpha.Feedback { + + public Feedback(UUID ownerId) { + super(ownerId); + this.cardNumber = 58; + this.expansionSetCode = "2ED"; + } + + public Feedback(final Feedback card) { + super(card); + } + + @Override + public Feedback copy() { + return new Feedback(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.java new file mode 100644 index 0000000000..be640016ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Wanderlust.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.unlimitededition; + +import java.util.UUID; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.Effect; +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.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class Wanderlust extends CardImpl { + + public Wanderlust(UUID ownerId) { + super(ownerId, 135, "Wanderlust", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); + this.expansionSetCode = "2ED"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // At the beginning of the upkeep of enchanted creature's controller, Wanderlust deals 1 damage to that player. + Effect effect = new DamageTargetEffect(1); + effect.setText("{this} deals 1 damage to that player"); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, effect, + TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public Wanderlust(final Wanderlust card) { + super(card); + } + + @Override + public Wanderlust copy() { + return new Wanderlust(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java new file mode 100644 index 0000000000..0afbd74f63 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/WarpArtifact.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class WarpArtifact extends mage.sets.fifthedition.WarpArtifact { + + public WarpArtifact(UUID ownerId) { + super(ownerId); + this.cardNumber = 42; + this.expansionSetCode = "2ED"; + } + + public WarpArtifact(final WarpArtifact card) { + super(card); + } + + @Override + public WarpArtifact copy() { + return new WarpArtifact(this); + } +} From 4103ab877dce932f751511b4ba7ffbfea4bedcb0 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 19:48:58 +0300 Subject: [PATCH 28/63] Implement cards: Knight of Dawn, Nettletooth Djinn, Striped Bears, and Zuran Spellcaster --- .../mage/sets/iceage/ZuranSpellcaster.java | 68 ++++++++++++++++++ .../masterseditionii/ZuranSpellcaster.java | 52 ++++++++++++++ .../mage/sets/mirage/NettletoothDjinn.java | 63 +++++++++++++++++ .../src/mage/sets/tempest/KnightOfDawn.java | 70 +++++++++++++++++++ .../mage/sets/weatherlight/StripedBears.java | 63 +++++++++++++++++ 5 files changed, 316 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java create mode 100644 Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java create mode 100644 Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java create mode 100644 Mage.Sets/src/mage/sets/weatherlight/StripedBears.java diff --git a/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.java new file mode 100644 index 0000000000..198a9ccadb --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/ZuranSpellcaster.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.iceage; + +import java.util.UUID; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends CardImpl { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId, 111, "Zuran Spellcaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {T}: Zuran Spellcaster deals 1 damage to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.java new file mode 100644 index 0000000000..7c28041325 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/ZuranSpellcaster.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; + +/** + * + * @author LoneFox + */ +public class ZuranSpellcaster extends mage.sets.iceage.ZuranSpellcaster { + + public ZuranSpellcaster(UUID ownerId) { + super(ownerId); + this.cardNumber = 76; + this.expansionSetCode = "ME2"; + } + + public ZuranSpellcaster(final ZuranSpellcaster card) { + super(card); + } + + @Override + public ZuranSpellcaster copy() { + return new ZuranSpellcaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.java new file mode 100644 index 0000000000..c14f72308f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirage/NettletoothDjinn.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.mirage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.common.DamageControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; + +/** + * + * @author LoneFox + */ +public class NettletoothDjinn extends CardImpl { + + public NettletoothDjinn(UUID ownerId) { + super(ownerId, 130, "Nettletooth Djinn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "MIR"; + this.subtype.add("Djinn"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // At the beginning of your upkeep, Nettletooth Djinn deals 1 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DamageControllerEffect(1), TargetController.YOU, false)); } + + public NettletoothDjinn(final NettletoothDjinn card) { + super(card); + } + + @Override + public NettletoothDjinn copy() { + return new NettletoothDjinn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.java new file mode 100644 index 0000000000..d03181f933 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/KnightOfDawn.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.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.GainProtectionFromColorSourceEffect; +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; + +/** + * + * @author LoneFox + */ +public class KnightOfDawn extends CardImpl { + + public KnightOfDawn(UUID ownerId) { + super(ownerId, 238, "Knight of Dawn", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}{W}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Human"); + this.subtype.add("Knight"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + // {W}{W}: Knight of Dawn gains protection from the color of your choice until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainProtectionFromColorSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{W}{W}"))); + } + + public KnightOfDawn(final KnightOfDawn card) { + super(card); + } + + @Override + public KnightOfDawn copy() { + return new KnightOfDawn(this); + } +} diff --git a/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.java new file mode 100644 index 0000000000..063c15a260 --- /dev/null +++ b/Mage.Sets/src/mage/sets/weatherlight/StripedBears.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.weatherlight; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StripedBears extends CardImpl { + + public StripedBears(UUID ownerId) { + super(ownerId, 82, "Striped Bears", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "WTH"; + this.subtype.add("Bear"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Striped Bears enters the battlefield, draw a card. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); + } + + public StripedBears(final StripedBears card) { + super(card); + } + + @Override + public StripedBears copy() { + return new StripedBears(this); + } +} From 9c3ea4fc7f892d13e0655c98f98eb59c12b30749 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 18:49:36 +0200 Subject: [PATCH 29/63] Added Conversion. --- .../mage/sets/fourthedition/Conversion.java | 52 ++++++ .../mage/sets/limitedalpha/Conversion.java | 148 ++++++++++++++++++ .../src/mage/sets/limitedbeta/Conversion.java | 52 ++++++ .../sets/masterseditioniv/Conversion.java | 54 +++++++ .../mage/sets/revisededition/Conversion.java | 52 ++++++ .../sets/unlimitededition/Conversion.java | 52 ++++++ 6 files changed, 410 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fourthedition/Conversion.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/Conversion.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/Conversion.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/Conversion.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/Conversion.java diff --git a/Mage.Sets/src/mage/sets/fourthedition/Conversion.java b/Mage.Sets/src/mage/sets/fourthedition/Conversion.java new file mode 100644 index 0000000000..856dc943df --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/Conversion.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 269; + this.expansionSetCode = "4ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java new file mode 100644 index 0000000000..fcb7c84337 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/Conversion.java @@ -0,0 +1,148 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.AbilityAddingRemovingEffects_6; +import static mage.constants.Layer.TypeChangingEffects_4; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.sets.futuresight.MagusOfTheMoon; + +/** + * + * @author LevelX2 + */ +public class Conversion extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain", "Mountains"); + + public Conversion(UUID ownerId) { + super(ownerId, 199, "Conversion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "LEA"; + + // At the beginning of your upkeep, sacrifice Conversion unless you pay {W}{W}. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{W}{W}")), TargetController.YOU, false)); + + // All Mountains are Plains. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConversionEffect())); + + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } + + class ConversionEffect extends ContinuousEffectImpl { + + ConversionEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "All Mountains are Plains"; + } + + ConversionEffect(final ConversionEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public ConversionEffect copy() { + return new ConversionEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new WhiteManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Plains"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/286046-conversion-magus-of-the-moon + if (MagusOfTheMoon.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } + + } + +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.java new file mode 100644 index 0000000000..ea00db87fc --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/Conversion.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 LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 201; + this.expansionSetCode = "LEB"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.java new file mode 100644 index 0000000000..afca2b79f5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/Conversion.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 LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 9; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.RARE; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/Conversion.java b/Mage.Sets/src/mage/sets/revisededition/Conversion.java new file mode 100644 index 0000000000..d5ad6eb5c9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/Conversion.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 LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "3ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.java new file mode 100644 index 0000000000..5f61f2899c --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/Conversion.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 LevelX2 + */ +public class Conversion extends mage.sets.limitedalpha.Conversion { + + public Conversion(UUID ownerId) { + super(ownerId); + this.cardNumber = 200; + this.expansionSetCode = "2ED"; + } + + public Conversion(final Conversion card) { + super(card); + } + + @Override + public Conversion copy() { + return new Conversion(this); + } +} From fb965ebdd6e4b74fa40f06b5b618b7250d7763b6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 18:52:46 +0200 Subject: [PATCH 30/63] * Opalescence - Fixed that the dependent effect (613.7) Opalescence was applied before the effect of Enchanted Evening if Opalescence was cast earlier. --- .../mage/sets/futuresight/MagusOfTheMoon.java | 102 +++++----- .../mage/sets/futuresight/YixlidJailer.java | 80 ++++---- .../sets/scarsofmirrodin/NecroticOoze.java | 111 +++++------ .../sets/shadowmoor/EnchantedEvening.java | 56 +++--- .../mage/sets/urzasdestiny/Opalescence.java | 26 ++- .../continuous/DependentEffectsTest.java | 176 ++++++++++++++++++ .../abilities/effects/ContinuousEffect.java | 74 +++++--- .../effects/ContinuousEffectImpl.java | 6 + .../abilities/effects/ContinuousEffects.java | 123 ++++++++---- 9 files changed, 515 insertions(+), 239 deletions(-) create mode 100644 Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java diff --git a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java index d6ee678b76..f8add1d6b6 100644 --- a/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java +++ b/Mage.Sets/src/mage/sets/futuresight/MagusOfTheMoon.java @@ -28,6 +28,12 @@ package mage.sets.futuresight; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,12 +41,6 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.mana.RedManaAbility; -import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -53,6 +53,12 @@ import mage.game.permanent.Permanent; */ public class MagusOfTheMoon extends CardImpl { + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + } + public MagusOfTheMoon(UUID ownerId) { super(ownerId, 101, "Magus of the Moon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "FUT"; @@ -74,53 +80,49 @@ public class MagusOfTheMoon extends CardImpl { public MagusOfTheMoon copy() { return new MagusOfTheMoon(this); } -} -class MagusOfTheMoonEffect extends ContinuousEffectImpl { + class MagusOfTheMoonEffect extends ContinuousEffectImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.add(Predicates.not(new SupertypePredicate("Basic"))); - } - - MagusOfTheMoonEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - this.staticText = "Nonbasic lands are Mountains"; - } - - MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public MagusOfTheMoonEffect copy() { - return new MagusOfTheMoonEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - for (Permanent land: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - land.removeAllAbilities(source.getSourceId(), game); - land.addAbility(new RedManaAbility(), source.getSourceId(), game); - break; - case TypeChangingEffects_4: - land.getSubtype().clear(); - land.getSubtype().add("Mountain"); - break; - } + MagusOfTheMoonEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + this.staticText = "Nonbasic lands are Mountains"; + } + + MagusOfTheMoonEffect(final MagusOfTheMoonEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public MagusOfTheMoonEffect copy() { + return new MagusOfTheMoonEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + for (Permanent land : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + land.removeAllAbilities(source.getSourceId(), game); + land.addAbility(new RedManaAbility(), source.getSourceId(), game); + break; + case TypeChangingEffects_4: + land.getSubtype().clear(); + land.getSubtype().add("Mountain"); + break; + } + } + return true; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; } - return true; } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.TypeChangingEffects_4; - } } diff --git a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java index 4e35a0f736..dd701feb7e 100644 --- a/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java +++ b/Mage.Sets/src/mage/sets/futuresight/YixlidJailer.java @@ -72,59 +72,59 @@ public class YixlidJailer extends CardImpl { public YixlidJailer copy() { return new YixlidJailer(this); } -} -class YixlidJailerEffect extends ContinuousEffectImpl { + class YixlidJailerEffect extends ContinuousEffectImpl { - YixlidJailerEffect() { - super(Duration.WhileOnBattlefield, Outcome.LoseAbility); - staticText = "Cards in graveyards lose all abilities."; - } + YixlidJailerEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseAbility); + staticText = "Cards in graveyards lose all abilities."; + } - YixlidJailerEffect(final YixlidJailerEffect effect) { - super(effect); - } + YixlidJailerEffect(final YixlidJailerEffect effect) { + super(effect); + } - @Override - public YixlidJailerEffect copy() { - return new YixlidJailerEffect(this); - } + @Override + public YixlidJailerEffect copy() { + return new YixlidJailerEffect(this); + } - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - if (layer == Layer.AbilityAddingRemovingEffects_6) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - for (UUID playerId : controller.getInRange()) { - Player player = game.getPlayer(playerId); - if (player != null) { - for (Card card : player.getGraveyard().getCards(game)) { - if (card != null) { - card.getAbilities(game).clear(); // Will the abilities ever come back???? - // TODO: Fix that (LevelX2) - // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); - // game.getState().resetTriggersForSourceId(card.getId()); - Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); - if (abilities != null) { - abilities.clear(); + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + if (layer == Layer.AbilityAddingRemovingEffects_6) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(game)) { + if (card != null) { + card.getAbilities(game).clear(); // Will the abilities ever come back???? + // TODO: Fix that (LevelX2) + // game.getContinuousEffects().removeGainedEffectsForSource(card.getId()); + // game.getState().resetTriggersForSourceId(card.getId()); + Abilities abilities = game.getState().getAllOtherAbilities(card.getId()); + if (abilities != null) { + abilities.clear(); + } } } } } + return true; } - return true; } + return false; } - return false; - } - @Override - public boolean apply(Game game, Ability source) { - return false; - } + @Override + public boolean apply(Game game, Ability source) { + return false; + } - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6; + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6; + } } } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java index 65d7927c47..e49932fcb0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NecroticOoze.java @@ -1,16 +1,16 @@ /* * Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,14 +20,25 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.scarsofmirrodin; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Layer; @@ -35,16 +46,10 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.SubLayer; import mage.constants.Zone; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.ActivatedAbility; -import mage.abilities.StaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.Card; -import mage.cards.CardImpl; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.sets.futuresight.YixlidJailer; /** * @@ -60,7 +65,8 @@ public class NecroticOoze extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(3); - this.addAbility(new NecroticOozeAbility()); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NecroticOozeEffect())); } public NecroticOoze(final NecroticOoze card) { @@ -72,48 +78,27 @@ public class NecroticOoze extends CardImpl { return new NecroticOoze(this); } -} + class NecroticOozeEffect extends ContinuousEffectImpl { -class NecroticOozeAbility extends StaticAbility { + public NecroticOozeEffect() { + super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; + } - public NecroticOozeAbility() { - super(Zone.BATTLEFIELD, new NecroticOozeEffect()); - } + public NecroticOozeEffect(final NecroticOozeEffect effect) { + super(effect); + } - public NecroticOozeAbility(final NecroticOozeAbility ability) { - super(ability); - } - - @Override - public NecroticOozeAbility copy() { - return new NecroticOozeAbility(this); - } - -} - -class NecroticOozeEffect extends ContinuousEffectImpl { - - public NecroticOozeEffect() { - super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); - staticText = "As long as {this} is on the battlefield, it has all activated abilities of all creature cards in all graveyards"; - } - - public NecroticOozeEffect(final NecroticOozeEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { + @Override + public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { - for (UUID playerId: controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { + for (Card card : player.getGraveyard().getCards(game)) { if (card.getCardType().contains(CardType.CREATURE)) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof ActivatedAbility) { perm.addAbility(ability, game); } @@ -122,15 +107,31 @@ class NecroticOozeEffect extends ContinuousEffectImpl { } } } + return true; } - return true; + return false; + } + + @Override + public NecroticOozeEffect copy() { + return new NecroticOozeEffect(this); + } + + @Override + public Set isDependentTo(List allEffectsInLayer) { + // the dependent classes needs to be an enclosed class for dependent check of continuous effects + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + // http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/285211-yixlid-jailer-vs-necrotic-ooze + if (YixlidJailer.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; } - return false; } - @Override - public NecroticOozeEffect copy() { - return new NecroticOozeEffect(this); - } - -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java index f90471ad70..9590020f57 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/EnchantedEvening.java @@ -54,7 +54,6 @@ public class EnchantedEvening extends CardImpl { super(ownerId, 140, "Enchanted Evening", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W/U}{W/U}"); this.expansionSetCode = "SHM"; - // All permanents are enchantments in addition to their other types. Effect effect = new EnchangedEveningEffect(CardType.ENCHANTMENT, Duration.WhileOnBattlefield, new FilterPermanent()); effect.setText("All permanents are enchantments in addition to their other types"); @@ -70,37 +69,38 @@ public class EnchantedEvening extends CardImpl { public EnchantedEvening copy() { return new EnchantedEvening(this); } -} -class EnchangedEveningEffect extends ContinuousEffectImpl { + // need to be enclosed class for dependent check of continuous effects + class EnchangedEveningEffect extends ContinuousEffectImpl { - private final CardType addedCardType; - private final FilterPermanent filter; + private final CardType addedCardType; + private final FilterPermanent filter; - public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { - super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); - this.addedCardType = addedCardType; - this.filter = filter; - } - - public EnchangedEveningEffect(final EnchangedEveningEffect effect) { - super(effect); - this.addedCardType = effect.addedCardType; - this.filter = effect.filter; - } - - @Override - public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { - if (permanent != null && !permanent.getCardType().contains(addedCardType)) { - permanent.getCardType().add(addedCardType); - } + public EnchangedEveningEffect(CardType addedCardType, Duration duration, FilterPermanent filter) { + super(duration, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit); + this.addedCardType = addedCardType; + this.filter = filter; } - return true; - } - @Override - public EnchangedEveningEffect copy() { - return new EnchangedEveningEffect(this); + public EnchangedEveningEffect(final EnchangedEveningEffect effect) { + super(effect); + this.addedCardType = effect.addedCardType; + this.filter = effect.filter; + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) { + if (permanent != null && !permanent.getCardType().contains(addedCardType)) { + permanent.getCardType().add(addedCardType); + } + } + return true; + } + + @Override + public EnchangedEveningEffect copy() { + return new EnchangedEveningEffect(this); + } } } diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java index 977547a474..cd11bb8344 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Opalescence.java @@ -27,9 +27,13 @@ */ package mage.sets.urzasdestiny; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.constants.CardType; @@ -47,6 +51,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.sets.shadowmoor.EnchantedEvening; /** * @@ -58,7 +63,6 @@ public class Opalescence extends CardImpl { super(ownerId, 13, "Opalescence", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.expansionSetCode = "UDS"; - // Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OpalescenceEffect())); @@ -72,19 +76,21 @@ public class Opalescence extends CardImpl { public Opalescence copy() { return new Opalescence(this); } + } class OpalescenceEffect extends ContinuousEffectImpl { private static final FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("Each other non-Aura enchantment"); + static { filter.add(Predicates.not(new SubtypePredicate("Aura"))); filter.add(new AnotherPredicate()); } - + public OpalescenceEffect() { super(Duration.WhileOnBattlefield, Outcome.BecomeCreature); - staticText = "Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost"; + staticText = "Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost"; } public OpalescenceEffect(final OpalescenceEffect effect) { @@ -125,10 +131,22 @@ class OpalescenceEffect extends ContinuousEffectImpl { return false; } - @Override public boolean hasLayer(Layer layer) { return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + Set dependentTo = null; + for (ContinuousEffect effect : allEffectsInLayer) { + if (EnchantedEvening.class.equals(effect.getClass().getEnclosingClass())) { + if (dependentTo == null) { + dependentTo = new HashSet<>(); + } + dependentTo.add(effect.getId()); + } + } + return dependentTo; + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java new file mode 100644 index 0000000000..e844aacf1f --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/DependentEffectsTest.java @@ -0,0 +1,176 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation 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.abilities.Ability; +import mage.constants.AbilityType; +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 DependentEffectsTest extends CardTestPlayerBase { + + /** + * Opalescence plus Enchanted Evening are still not wiping any lands. + */ + @Test + public void testLandsAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.HAND, playerA, "Opalescence", 1); // {2}{W}{W} + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 9); + addCard(Zone.BATTLEFIELD, playerA, "War Horn", 1); + + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Opalescence"); + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Enchanted Evening"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + assertPowerToughness(playerA, "War Horn", 3, 3); + + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + /** + * Opalescense is dependent on Enchanted Evening, so it will be applied + * after it regardless of timestamp. + * + * Tokens can also have mana costs, and as a consequence of that, converted + * mana costs. A token created with Rite of Replication would have the mana + * cost of the creature it targeted. Most tokens do not have mana costs + * though. + * + * Tokens with no mana costs would be 0/0, as you said, and would indeed be + * put into owner's graveyard next time State Based Actionas are performed. + * Tokens with mana costs would naturally have whatever power and toughness + * their CMC indicated. + */ + @Test + public void testTokensAreDestroyed() { + // Each other non-Aura enchantment is a creature in addition to its other types and has base power and base toughness each equal to its converted mana cost. + addCard(Zone.BATTLEFIELD, playerA, "Opalescence", 1); + addCard(Zone.BATTLEFIELD, playerA, "Island", 9); + // Kicker {5} + // Put a token that's a copy of target creature onto the battlefield. If Rite of Replication was kicked, put five of those tokens onto the battlefield instead. + addCard(Zone.HAND, playerA, "Rite of Replication", 1); // This token can have a cmc + // All permanents are enchantments in addition to their other types. + addCard(Zone.HAND, playerA, "Enchanted Evening"); // {3}{W/U}{W/U} + + addCard(Zone.BATTLEFIELD, playerB, "Cobblebrute", 1); // 5/2 cmc = 4 + addCard(Zone.BATTLEFIELD, playerB, "Plains", 2); + // Put two 1/1 white Soldier creature tokens onto the battlefield. + addCard(Zone.HAND, playerB, "Raise the Alarm"); // Instant {1}{W} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Rite of Replication", "Cobblebrute"); + setChoice(playerA, "No"); // no kicker + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Raise the Alarm"); + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Enchanted Evening"); + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerA, "Rite of Replication", 1); + assertGraveyardCount(playerB, "Raise the Alarm", 1); + + assertPowerToughness(playerA, "Enchanted Evening", 5, 5); + + assertPowerToughness(playerB, "Cobblebrute", 4, 4); + assertPowerToughness(playerA, "Cobblebrute", 4, 4); + + assertPermanentCount(playerB, "Soldier", 0); + assertPermanentCount(playerA, "Island", 0); + assertPermanentCount(playerB, "Plains", 0); + } + + @Test + public void testYixlidJailerAndNecroticOozeBasic() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("Two abilities for Necrotic Ooze", 2, numberOfActivatedAbilities); + } + + @Test + public void testYixlidJailerAndNecroticOozeLooseAll() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + // As long as Necrotic Ooze is on the battlefield, it has all activated abilities of all creature cards in all graveyards + addCard(Zone.BATTLEFIELD, playerA, "Necrotic Ooze", 1); + // {2}{1},{T}: Tap target creature. + addCard(Zone.GRAVEYARD, playerA, "Akroan Jailer", 1); + // {T}: Target attacking creature gets +1/+1 until end of turn. + addCard(Zone.GRAVEYARD, playerB, "Anointer of Champions", 1); + + // Cards in graveyards lose all abilities. + addCard(Zone.HAND, playerA, "Yixlid Jailer", 1); // Creature - {1}{B} + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Yixlid Jailer"); + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Yixlid Jailer", 1); + + Permanent necroticOoze = getPermanent("Necrotic Ooze", playerA); + int numberOfActivatedAbilities = 0; + for (Ability ability : necroticOoze.getAbilities(currentGame)) { + if (ability.getAbilityType().equals(AbilityType.ACTIVATED)) { + numberOfActivatedAbilities++; + } + } + Assert.assertEquals("All abilities from cards in graveyard are removed - so no abilities for Necrotic Ooze", 0, numberOfActivatedAbilities); + } + +} diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java index 5f6987ab47..355ff4347a 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffect.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java @@ -1,34 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects; import java.util.List; +import java.util.Set; +import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; import mage.constants.Duration; @@ -43,25 +44,42 @@ import mage.game.Game; public interface ContinuousEffect extends Effect { boolean isUsed(); + boolean isDiscarded(); + void discard(); + Duration getDuration(); + long getOrder(); + void setOrder(long order); + boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game); + boolean hasLayer(Layer layer); + boolean isInactive(Ability source, Game game); + void init(Ability source, Game game); + Layer getLayer(); + SubLayer getSublayer(); + void overrideRuleText(String text); + List getAffectedObjects(); + Set isDependentTo(List allEffectsInLayer); + @Override 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 e793058a81..48bd0bf8a2 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java @@ -29,6 +29,7 @@ package mage.abilities.effects; import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; @@ -250,4 +251,9 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.temporary = temporary; } + @Override + public Set isDependentTo(List allEffectsInLayer) { + return null; + } + } diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index a6030dc051..8871ea4658 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -38,6 +38,7 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import mage.MageObject; @@ -851,8 +852,9 @@ public class ContinuousEffects implements Serializable { //20091005 - 613 public void apply(Game game) { removeInactiveEffects(game); - List layerEffects = getLayeredEffects(game); - List layer = filterLayeredEffects(layerEffects, Layer.CopyEffects_1); + List activeLayerEffects = getLayeredEffects(game); + + List layer = filterLayeredEffects(activeLayerEffects, Layer.CopyEffects_1); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -861,10 +863,10 @@ public class ContinuousEffects implements Serializable { } //Reload layerEffect if copy effects were applied if (layer.size() > 0) { - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); } - layer = filterLayeredEffects(layerEffects, Layer.ControlChangingEffects_2); + layer = filterLayeredEffects(activeLayerEffects, Layer.ControlChangingEffects_2); // apply control changing effects multiple times if it's needed // for cases when control over permanents with change control abilities is changed // e.g. Mind Control is controlled by Steal Enchantment @@ -882,55 +884,72 @@ public class ContinuousEffects implements Serializable { // reset control before reapplying control changing effects game.getBattlefield().resetPermanentsControl(); } - layer = filterLayeredEffects(layerEffects, Layer.TextChangingEffects_3); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TextChangingEffects_3, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.TypeChangingEffects_4); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.TypeChangingEffects_4, SubLayer.NA, ability, game); - } - } - layer = filterLayeredEffects(layerEffects, Layer.ColorChangingEffects_5); - for (ContinuousEffect effect : layer) { - HashSet abilities = layeredEffects.getAbility(effect.getId()); - for (Ability ability : abilities) { - effect.apply(Layer.ColorChangingEffects_5, SubLayer.NA, ability, game); - } - } - Map> appliedEffects = new HashMap<>(); + applyLayer(activeLayerEffects, Layer.TextChangingEffects_3, game); + applyLayer(activeLayerEffects, Layer.TypeChangingEffects_4, game); + applyLayer(activeLayerEffects, Layer.ColorChangingEffects_5, game); + + Map> appliedEffectAbilities = new HashMap<>(); boolean done = false; + Map> waitingEffects = new LinkedHashMap<>(); + Set appliedEffects = new HashSet<>(); while (!done) { // loop needed if a added effect adds again an effect (e.g. Level 5- of Joraga Treespeaker) done = true; - layer = filterLayeredEffects(layerEffects, Layer.AbilityAddingRemovingEffects_6); + layer = filterLayeredEffects(activeLayerEffects, Layer.AbilityAddingRemovingEffects_6); for (ContinuousEffect effect : layer) { - if (layerEffects.contains(effect)) { - List appliedAbilities = appliedEffects.get(effect); + if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + List appliedAbilities = appliedEffectAbilities.get(effect); HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { if (appliedAbilities == null || !appliedAbilities.contains(ability)) { if (appliedAbilities == null) { appliedAbilities = new ArrayList<>(); - appliedEffects.put(effect, appliedAbilities); + appliedEffectAbilities.put(effect, appliedAbilities); } appliedAbilities.add(ability); effect.apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); done = false; // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) - layerEffects = getLayeredEffects(game); + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(effect.getId()); + + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Iterator>> iterator = waitingEffects.entrySet().iterator(); iterator.hasNext();) { + Map.Entry> entry = iterator.next(); + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + appliedAbilities = appliedEffectAbilities.get(entry.getKey()); + abilities = layeredEffects.getAbility(entry.getKey().getId()); + for (Ability ability : abilities) { + if (appliedAbilities == null || !appliedAbilities.contains(ability)) { + if (appliedAbilities == null) { + appliedAbilities = new ArrayList<>(); + appliedEffectAbilities.put(entry.getKey(), appliedAbilities); + } + appliedAbilities.add(ability); + entry.getKey().apply(Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, ability, game); + done = false; + // list must be updated after each applied effect (eg. if "Turn to Frog" removes abilities) + activeLayerEffects = getLayeredEffects(game); + } + } + appliedEffects.add(entry.getKey().getId()); + iterator.remove(); + } } } } } } - layer = filterLayeredEffects(layerEffects, Layer.PTChangingEffects_7); + layer = filterLayeredEffects(activeLayerEffects, Layer.PTChangingEffects_7); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -952,14 +971,14 @@ public class ContinuousEffects implements Serializable { effect.apply(Layer.PTChangingEffects_7, SubLayer.SwitchPT_e, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.PlayerEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.PlayerEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { effect.apply(Layer.PlayerEffects, SubLayer.NA, ability, game); } } - layer = filterLayeredEffects(layerEffects, Layer.RulesEffects); + layer = filterLayeredEffects(activeLayerEffects, Layer.RulesEffects); for (ContinuousEffect effect : layer) { HashSet abilities = layeredEffects.getAbility(effect.getId()); for (Ability ability : abilities) { @@ -968,6 +987,42 @@ public class ContinuousEffects implements Serializable { } } + private void applyLayer(List activeLayerEffects, Layer currentLayer, Game game) { + List layer = filterLayeredEffects(activeLayerEffects, currentLayer); + if (!layer.isEmpty()) { + int numberOfEffects = layer.size(); + Set appliedEffects = new HashSet<>(); + Map> waitingEffects = new LinkedHashMap<>(); + for (ContinuousEffect effect : layer) { + if (numberOfEffects > 1) { // If an effect is dependent to not applied effects yet of this layer, so wait to apply this effect + Set dependentTo = effect.isDependentTo(layer); + if (dependentTo != null && !appliedEffects.containsAll(dependentTo)) { + waitingEffects.put(effect, dependentTo); + continue; + } + } + applyContinuousEffect(effect, currentLayer, game); + appliedEffects.add(effect.getId()); + if (!waitingEffects.isEmpty()) { + // check if waiting effects can be applied now + for (Entry> entry : waitingEffects.entrySet()) { + if (appliedEffects.containsAll(entry.getValue())) { // all dependent to effects are applied now so apply the effect itself + applyContinuousEffect(entry.getKey(), currentLayer, game); + appliedEffects.add(entry.getKey().getId()); + } + } + } + } + } + } + + private void applyContinuousEffect(ContinuousEffect effect, Layer currentLayer, Game game) { + HashSet abilities = layeredEffects.getAbility(effect.getId()); + for (Ability ability : abilities) { + effect.apply(currentLayer, SubLayer.NA, ability, game); + } + } + /** * Adds a continuous ability with a reference to a sourceId. It's used for * effects that cease to exist again So this effects were removed again From 5a1c3c41bb9a553afbe851d6a03beb21cfac10c1 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 29 Aug 2015 21:22:37 +0300 Subject: [PATCH 31/63] Implement cards: Jagged Lightning, Madicine Bag, Skyshroud Elite, and Two-Headed Giant of Foriys --- .../src/mage/sets/exodus/MedicineBag.java | 69 +++++++++++++++ .../src/mage/sets/exodus/SkyshroudElite.java | 83 +++++++++++++++++++ .../limitedalpha/TwoHeadedGiantOfForiys.java | 54 ++++++++++++ .../limitedbeta/TwoHeadedGiantOfForiys.java | 54 ++++++++++++ .../TwoHeadedGiantOfForiys.java | 67 +++++++++++++++ .../sets/portalsecondage/JaggedLightning.java | 52 ++++++++++++ .../sets/starter1999/JaggedLightning.java | 52 ++++++++++++ .../TwoHeadedGiantOfForiys.java | 54 ++++++++++++ .../mage/sets/urzassaga/JaggedLightning.java | 61 ++++++++++++++ 9 files changed, 546 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/exodus/MedicineBag.java create mode 100644 Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java create mode 100644 Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java create mode 100644 Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java diff --git a/Mage.Sets/src/mage/sets/exodus/MedicineBag.java b/Mage.Sets/src/mage/sets/exodus/MedicineBag.java new file mode 100644 index 0000000000..c17bd95ef5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/MedicineBag.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.exodus; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MedicineBag extends CardImpl { + + public MedicineBag(UUID ownerId) { + super(ownerId, 133, "Medicine Bag", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "EXO"; + + // {1}, {tap}, Discard a card: Regenerate target creature. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new TapSourceCost()); + ability.addCost(new DiscardCardCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public MedicineBag(final MedicineBag card) { + super(card); + } + + @Override + public MedicineBag copy() { + return new MedicineBag(this); + } +} diff --git a/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java b/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.java new file mode 100644 index 0000000000..718847d573 --- /dev/null +++ b/Mage.Sets/src/mage/sets/exodus/SkyshroudElite.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.exodus; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +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.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class SkyshroudElite extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("nonbasic land"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SkyshroudElite(UUID ownerId) { + super(ownerId, 123, "Skyshroud Elite", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "EXO"; + this.subtype.add("Elf"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Skyshroud Elite gets +1/+2 as long as an opponent controls a nonbasic land. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0, false), + "{this} gets +1/+2 as long as an opponent controls a nonbasic land"))); + } + + public SkyshroudElite(final SkyshroudElite card) { + super(card); + } + + @Override + public SkyshroudElite copy() { + return new SkyshroudElite(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.java new file mode 100644 index 0000000000..827c9c8a62 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/TwoHeadedGiantOfForiys.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.limitedalpha; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "LEA"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.java new file mode 100644 index 0000000000..721a37aa93 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/TwoHeadedGiantOfForiys.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.limitedbeta; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 181; + this.expansionSetCode = "LEB"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.java new file mode 100644 index 0000000000..2ae3905486 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/TwoHeadedGiantOfForiys.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.masterseditioniv; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CanBlockAdditionalCreatureEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends CardImpl { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId, 139, "Two-Headed Giant of Foriys", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ME4"; + this.subtype.add("Giant"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Two-Headed Giant of Foriys can block an additional creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CanBlockAdditionalCreatureEffect())); + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.java new file mode 100644 index 0000000000..e3288cd241 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portalsecondage/JaggedLightning.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 LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 106; + this.expansionSetCode = "PO2"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.java new file mode 100644 index 0000000000..26853ac7ab --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/JaggedLightning.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 LoneFox + */ +public class JaggedLightning extends mage.sets.urzassaga.JaggedLightning { + + public JaggedLightning(UUID ownerId) { + super(ownerId); + this.cardNumber = 109; + this.expansionSetCode = "S99"; + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.java new file mode 100644 index 0000000000..5ae29d3df2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/TwoHeadedGiantOfForiys.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.unlimitededition; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class TwoHeadedGiantOfForiys extends mage.sets.masterseditioniv.TwoHeadedGiantOfForiys { + + public TwoHeadedGiantOfForiys(UUID ownerId) { + super(ownerId); + this.cardNumber = 180; + this.expansionSetCode = "2ED"; + this.rarity = Rarity.RARE; + } + + public TwoHeadedGiantOfForiys(final TwoHeadedGiantOfForiys card) { + super(card); + } + + @Override + public TwoHeadedGiantOfForiys copy() { + return new TwoHeadedGiantOfForiys(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.java new file mode 100644 index 0000000000..c164794333 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/JaggedLightning.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.urzassaga; + +import java.util.UUID; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class JaggedLightning extends CardImpl { + + public JaggedLightning(UUID ownerId) { + super(ownerId, 200, "Jagged Lightning", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); + this.expansionSetCode = "USG"; + + // Jagged Lightning deals 3 damage to each of two target creatures. + this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "each of two target creatures")); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent(), false)); + } + + public JaggedLightning(final JaggedLightning card) { + super(card); + } + + @Override + public JaggedLightning copy() { + return new JaggedLightning(this); + } +} From 043161ff4a4e2243c05762ef2fb6bd7083eb3959 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Aug 2015 20:51:18 +0200 Subject: [PATCH 32/63] * Liliana, Defiant Necromancer - Fixed that the emblem ability did only trigger for controlled creatures dying instead correctly for all. --- .../sets/magicorigins/LilianaDefiantNecromancer.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java index 68e4320e8b..c3abacd439 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java +++ b/Mage.Sets/src/mage/sets/magicorigins/LilianaDefiantNecromancer.java @@ -57,7 +57,6 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.filter.predicate.mageobject.SupertypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.target.common.TargetCardInYourGraveyard; @@ -84,7 +83,6 @@ public class LilianaDefiantNecromancer extends CardImpl { this.color.setBlack(true); this.nightCard = true; - // this.canTransform = true; this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false)); @@ -97,7 +95,7 @@ public class LilianaDefiantNecromancer extends CardImpl { ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); - //-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."; + //-8: You get an emblem with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."; this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new LilianaDefiantNecromancerEmblem()), -8)); } @@ -130,11 +128,7 @@ public class LilianaDefiantNecromancer extends CardImpl { class LilianaDefiantNecromancerEmblem extends Emblem { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature"); // 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." public LilianaDefiantNecromancerEmblem() { From 386f4a2253ed928ccd3208dc76fede4ff31c1a87 Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 29 Aug 2015 14:16:41 -0500 Subject: [PATCH 33/63] - Added Sorceress Queen and Cosmic Horror. --- .../sets/arabiannights/SorceressQueen.java | 54 ++++++++ .../sets/fifthedition/SorceressQueen.java | 52 ++++++++ .../mage/sets/fourthedition/CosmicHorror.java | 52 ++++++++ .../sets/fourthedition/SorceressQueen.java | 52 ++++++++ .../src/mage/sets/legends/CosmicHorror.java | 119 ++++++++++++++++++ .../sets/masterseditioniii/CosmicHorror.java | 52 ++++++++ .../sets/revisededition/SorceressQueen.java | 80 ++++++++++++ 7 files changed, 461 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java create mode 100644 Mage.Sets/src/mage/sets/legends/CosmicHorror.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java diff --git a/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.java new file mode 100644 index 0000000000..879a3dc638 --- /dev/null +++ b/Mage.Sets/src/mage/sets/arabiannights/SorceressQueen.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.arabiannights; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "ARN"; + this.rarity = Rarity.UNCOMMON; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.java new file mode 100644 index 0000000000..ed72daee11 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/SorceressQueen.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 jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 56; + this.expansionSetCode = "5ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.java new file mode 100644 index 0000000000..85d57bd54d --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CosmicHorror.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 10; + this.expansionSetCode = "4ED"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.java new file mode 100644 index 0000000000..3d2619efd7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/SorceressQueen.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.fourthedition; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends mage.sets.revisededition.SorceressQueen { + + public SorceressQueen(UUID ownerId) { + super(ownerId); + this.cardNumber = 46; + this.expansionSetCode = "4ED"; + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/CosmicHorror.java b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java new file mode 100644 index 0000000000..0f0e6273f2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CosmicHorror.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FirstStrikeAbility; +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.players.Player; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends CardImpl { + + public CosmicHorror(UUID ownerId) { + super(ownerId, 6, "Cosmic Horror", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Horror"); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // At the beginning of your upkeep, destroy Cosmic Horror unless you pay {3}{B}{B}{B}. If Cosmic Horror is destroyed this way, it deals 7 damage to you. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CosmicHorrorEffect(new ManaCostsImpl("{3}{B}{B}{B}")), TargetController.YOU, false)); + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} + +class CosmicHorrorEffect extends OneShotEffect { + + protected Cost cost; + + public CosmicHorrorEffect(Cost cost) { + super(Outcome.DestroyPermanent); + this.cost = cost; + staticText = "destroy {this} unless you pay {3}{B}{B}{B}. If {this} is destroyed this way it deals 7 damage to you"; + } + + public CosmicHorrorEffect(final CosmicHorrorEffect effect) { + super(effect); + this.cost = effect.cost.copy(); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent cosmicHorror = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && cosmicHorror != null) { + StringBuilder sb = new StringBuilder(cost.getText()).append("?"); + if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ")) { + sb.insert(0, "Pay "); + } + if (controller.chooseUse(Outcome.Benefit, sb.toString(), source, game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + return true; + } + } + if (cosmicHorror.destroy(source.getSourceId(), game, false)) { + controller.damage(7, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public CosmicHorrorEffect copy() { + return new CosmicHorrorEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java new file mode 100644 index 0000000000..a43202b347 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/CosmicHorror.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.masterseditioniii; + +import java.util.UUID; + +/** + * + * @author jeffwadsworth + */ +public class CosmicHorror extends mage.sets.legends.CosmicHorror { + + public CosmicHorror(UUID ownerId) { + super(ownerId); + this.cardNumber = 61; + this.expansionSetCode = "ME3"; + } + + public CosmicHorror(final CosmicHorror card) { + super(card); + } + + @Override + public CosmicHorror copy() { + return new CosmicHorror(this); + } +} diff --git a/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.java new file mode 100644 index 0000000000..9053aa1522 --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/SorceressQueen.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.revisededition; + +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.SetPowerToughnessTargetEffect; +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.AnotherPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class SorceressQueen extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target creature other than {this}"); + + static { + filter.add(new AnotherPredicate()); + } + + public SorceressQueen(UUID ownerId) { + super(ownerId, 39, "Sorceress Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "3ED"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Target creature other than Sorceress Queen becomes 0/2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(0, 2, Duration.EndOfTurn), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + + } + + public SorceressQueen(final SorceressQueen card) { + super(card); + } + + @Override + public SorceressQueen copy() { + return new SorceressQueen(this); + } +} From f7ed1b4d30ea87d32053d9346319b9a66135a769 Mon Sep 17 00:00:00 2001 From: Paulo L F Casaretto Date: Sat, 29 Aug 2015 19:09:10 -0300 Subject: [PATCH 34/63] Implement Harsh Mercy --- .../src/mage/sets/onslaught/HarshMercy.java | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/onslaught/HarshMercy.java diff --git a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java new file mode 100644 index 0000000000..62af91dd4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java @@ -0,0 +1,127 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.onslaught; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author pcasaretto + */ +public class HarshMercy extends CardImpl { + + public HarshMercy(UUID ownerId) { + super(ownerId, 39, "Harsh Mercy", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); + this.expansionSetCode = "ONS"; + + this.getSpellAbility().addEffect(new HarshMercyEffect()); + } + + public HarshMercy(final HarshMercy card) { + super(card); + } + + @Override + public HarshMercy copy() { + return new HarshMercy(this); + } +} + +class HarshMercyEffect extends OneShotEffect { + + public HarshMercyEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated."; + } + + public HarshMercyEffect(final HarshMercyEffect effect) { + super(effect); + } + + @Override + public HarshMercyEffect copy() { + return new HarshMercyEffect(this); + } + + @Override + public boolean apply(Game game, Ability ability) { + Player controller = game.getPlayer(ability.getControllerId()); + MageObject sourceObject = game.getObject(ability.getSourceId()); + if (controller != null) { + Set chosenTypes = new HashSet<>(); + for (UUID playerId : controller.getInRange()) { + Player player = game.getPlayer(playerId); + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose a creature type"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { + if (!player.canRespond()) { + break; + } + } + String chosenType = typeChoice.getChoice(); + if (chosenType != null) { + game.informPlayers(sourceObject.getName() + ": " + player.getLogName() + " has chosen " + chosenType); + chosenTypes.add(chosenType); + } + } + + List predicates = new ArrayList<>(); + for (String type : chosenTypes) { + predicates.add((SubtypePredicate) Predicates.not(new SubtypePredicate(type))); + } + FilterPermanent filter = new FilterCreaturePermanent("creatures"); + filter.add(Predicates.or(predicates)); + + return (new DestroyAllEffect(filter, true)).apply(game, ability); + } + return false; + } + +} From edbbdbeb3aa6045d67e51dd2eae17237854d0144 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 01:38:05 -0500 Subject: [PATCH 35/63] Updated 8/28-29 BFZ spoilers to mtg-cards-data.txt. Added rare dual land cycle, basic lands, Rolling Thunder reprint, Defiant Bloodlord, Eldrazi Devastator, and Hedron Archive. --- .../sets/battleforzendikar/CanopyVista.java | 79 +++++++++++++ .../sets/battleforzendikar/CinderGlade.java | 79 +++++++++++++ .../battleforzendikar/DefiantBloodlord.java | 110 ++++++++++++++++++ .../battleforzendikar/EldraziDevastator.java | 62 ++++++++++ .../mage/sets/battleforzendikar/Forest1.java | 51 ++++++++ .../mage/sets/battleforzendikar/Forest2.java | 51 ++++++++ .../mage/sets/battleforzendikar/Forest3.java | 51 ++++++++ .../mage/sets/battleforzendikar/Forest4.java | 51 ++++++++ .../mage/sets/battleforzendikar/Forest5.java | 51 ++++++++ .../sets/battleforzendikar/HedronArchive.java | 72 ++++++++++++ .../mage/sets/battleforzendikar/Island1.java | 51 ++++++++ .../mage/sets/battleforzendikar/Island2.java | 51 ++++++++ .../mage/sets/battleforzendikar/Island3.java | 51 ++++++++ .../mage/sets/battleforzendikar/Island4.java | 51 ++++++++ .../mage/sets/battleforzendikar/Island5.java | 51 ++++++++ .../sets/battleforzendikar/Mountain1.java | 51 ++++++++ .../sets/battleforzendikar/Mountain2.java | 51 ++++++++ .../sets/battleforzendikar/Mountain3.java | 51 ++++++++ .../sets/battleforzendikar/Mountain4.java | 51 ++++++++ .../sets/battleforzendikar/Mountain5.java | 51 ++++++++ .../mage/sets/battleforzendikar/Plains1.java | 51 ++++++++ .../mage/sets/battleforzendikar/Plains2.java | 51 ++++++++ .../mage/sets/battleforzendikar/Plains3.java | 51 ++++++++ .../mage/sets/battleforzendikar/Plains4.java | 51 ++++++++ .../mage/sets/battleforzendikar/Plains5.java | 51 ++++++++ .../sets/battleforzendikar/PrairieStream.java | 79 +++++++++++++ .../battleforzendikar/RollingThunder.java | 52 +++++++++ .../battleforzendikar/SmolderingMarsh.java | 79 +++++++++++++ .../sets/battleforzendikar/SunkenHollow.java | 79 +++++++++++++ .../mage/sets/battleforzendikar/Swamp1.java | 51 ++++++++ .../mage/sets/battleforzendikar/Swamp2.java | 51 ++++++++ .../mage/sets/battleforzendikar/Swamp3.java | 51 ++++++++ .../mage/sets/battleforzendikar/Swamp4.java | 51 ++++++++ .../mage/sets/battleforzendikar/Swamp5.java | 51 ++++++++ Utils/mtg-cards-data.txt | 51 +++++++- 35 files changed, 2016 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Island1.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Island2.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Island3.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Island4.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Island5.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.java new file mode 100644 index 0000000000..d6fc7f7402 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CanopyVista.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CanopyVista extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CanopyVista(UUID ownerId) { + super(ownerId, 234, "Canopy Vista", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Forest"); + this.subtype.add("Plains"); + + // Canopy Vista enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new GreenManaAbility()); + this.addAbility(new WhiteManaAbility()); + } + + public CanopyVista(final CanopyVista card) { + super(card); + } + + @Override + public CanopyVista copy() { + return new CanopyVista(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.java new file mode 100644 index 0000000000..69cad63bd5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/CinderGlade.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.GreenManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class CinderGlade extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public CinderGlade(UUID ownerId) { + super(ownerId, 235, "Cinder Glade", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Mountain"); + this.subtype.add("Forest"); + + // Cinder Glade enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new RedManaAbility()); + this.addAbility(new GreenManaAbility()); + } + + public CinderGlade(final CinderGlade card) { + super(card); + } + + @Override + public CinderGlade copy() { + return new CinderGlade(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java new file mode 100644 index 0000000000..e1bb3d98f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DefiantBloodlord.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +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.target.common.TargetOpponent; + +/** + * + * @author fireshoes + */ +public class DefiantBloodlord extends CardImpl { + + public DefiantBloodlord(UUID ownerId) { + super(ownerId, 107, "Defiant Bloodlord", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Vampire"); + this.power = new MageInt(4); + this.toughness = new MageInt(5); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you gain life, target opponent loses that much life. + DefiantBloodlordTriggeredAbility ability = new DefiantBloodlordTriggeredAbility(); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public DefiantBloodlord(final DefiantBloodlord card) { + super(card); + } + + @Override + public DefiantBloodlord copy() { + return new DefiantBloodlord(this); + } +} + +class DefiantBloodlordTriggeredAbility extends TriggeredAbilityImpl { + + public DefiantBloodlordTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + public DefiantBloodlordTriggeredAbility(final DefiantBloodlordTriggeredAbility ability) { + super(ability); + } + + @Override + public DefiantBloodlordTriggeredAbility copy() { + return new DefiantBloodlordTriggeredAbility(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.getPlayerId().equals(this.controllerId)) { + this.getEffects().clear(); + this.addEffect(new LoseLifeTargetEffect(event.getAmount())); + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever you gain life, target opponent loses that much life."; + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.java new file mode 100644 index 0000000000..75c5c88bea --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/EldraziDevastator.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class EldraziDevastator extends CardImpl { + + public EldraziDevastator(UUID ownerId) { + super(ownerId, 7, "Eldrazi Devastator", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(8); + this.toughness = new MageInt(9); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + } + + public EldraziDevastator(final EldraziDevastator card) { + super(card); + } + + @Override + public EldraziDevastator copy() { + return new EldraziDevastator(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java new file mode 100644 index 0000000000..d62397e6e1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest1 extends mage.cards.basiclands.Forest { + + public Forest1(UUID ownerId) { + super(ownerId, 270); + this.expansionSetCode = "BFZ"; + } + + public Forest1(final Forest1 card) { + super(card); + } + + @Override + public Forest1 copy() { + return new Forest1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java new file mode 100644 index 0000000000..ec7f4c906a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest2 extends mage.cards.basiclands.Forest { + + public Forest2(UUID ownerId) { + super(ownerId, 271); + this.expansionSetCode = "BFZ"; + } + + public Forest2(final Forest2 card) { + super(card); + } + + @Override + public Forest2 copy() { + return new Forest2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java new file mode 100644 index 0000000000..951dce0ba3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest3 extends mage.cards.basiclands.Forest { + + public Forest3(UUID ownerId) { + super(ownerId, 272); + this.expansionSetCode = "BFZ"; + } + + public Forest3(final Forest3 card) { + super(card); + } + + @Override + public Forest3 copy() { + return new Forest3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java new file mode 100644 index 0000000000..647fe97350 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest4 extends mage.cards.basiclands.Forest { + + public Forest4(UUID ownerId) { + super(ownerId, 273); + this.expansionSetCode = "BFZ"; + } + + public Forest4(final Forest4 card) { + super(card); + } + + @Override + public Forest4 copy() { + return new Forest4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java new file mode 100644 index 0000000000..22ed174134 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Forest5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Forest5 extends mage.cards.basiclands.Forest { + + public Forest5(UUID ownerId) { + super(ownerId, 274); + this.expansionSetCode = "BFZ"; + } + + public Forest5(final Forest5 card) { + super(card); + } + + @Override + public Forest5 copy() { + return new Forest5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.java new file mode 100644 index 0000000000..460abc0d4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/HedronArchive.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.battleforzendikar; + +import java.util.UUID; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class HedronArchive extends CardImpl { + + public HedronArchive(UUID ownerId) { + super(ownerId, 223, "Hedron Archive", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "BFZ"; + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + + // {2}, {T}, Sacrifice Hedron Archive: Draw two cards. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(2), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public HedronArchive(final HedronArchive card) { + super(card); + } + + @Override + public HedronArchive copy() { + return new HedronArchive(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java new file mode 100644 index 0000000000..d7c7643785 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island1 extends mage.cards.basiclands.Island { + + public Island1(UUID ownerId) { + super(ownerId, 255); + this.expansionSetCode = "BFZ"; + } + + public Island1(final Island1 card) { + super(card); + } + + @Override + public Island1 copy() { + return new Island1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java new file mode 100644 index 0000000000..191e7a9c94 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island2 extends mage.cards.basiclands.Island { + + public Island2(UUID ownerId) { + super(ownerId, 256); + this.expansionSetCode = "BFZ"; + } + + public Island2(final Island2 card) { + super(card); + } + + @Override + public Island2 copy() { + return new Island2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java new file mode 100644 index 0000000000..d097e0fe23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island3 extends mage.cards.basiclands.Island { + + public Island3(UUID ownerId) { + super(ownerId, 257); + this.expansionSetCode = "BFZ"; + } + + public Island3(final Island3 card) { + super(card); + } + + @Override + public Island3 copy() { + return new Island3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java new file mode 100644 index 0000000000..7346a47f65 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island4 extends mage.cards.basiclands.Island { + + public Island4(UUID ownerId) { + super(ownerId, 258); + this.expansionSetCode = "BFZ"; + } + + public Island4(final Island4 card) { + super(card); + } + + @Override + public Island4 copy() { + return new Island4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java new file mode 100644 index 0000000000..508d1081cc --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Island5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Island5 extends mage.cards.basiclands.Island { + + public Island5(UUID ownerId) { + super(ownerId, 259); + this.expansionSetCode = "BFZ"; + } + + public Island5(final Island5 card) { + super(card); + } + + @Override + public Island5 copy() { + return new Island5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java new file mode 100644 index 0000000000..049c251e4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain1 extends mage.cards.basiclands.Mountain { + + public Mountain1(UUID ownerId) { + super(ownerId, 265); + this.expansionSetCode = "BFZ"; + } + + public Mountain1(final Mountain1 card) { + super(card); + } + + @Override + public Mountain1 copy() { + return new Mountain1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java new file mode 100644 index 0000000000..adb01c4671 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain2 extends mage.cards.basiclands.Mountain { + + public Mountain2(UUID ownerId) { + super(ownerId, 266); + this.expansionSetCode = "BFZ"; + } + + public Mountain2(final Mountain2 card) { + super(card); + } + + @Override + public Mountain2 copy() { + return new Mountain2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java new file mode 100644 index 0000000000..38e5f5c4b6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain3 extends mage.cards.basiclands.Mountain { + + public Mountain3(UUID ownerId) { + super(ownerId, 267); + this.expansionSetCode = "BFZ"; + } + + public Mountain3(final Mountain3 card) { + super(card); + } + + @Override + public Mountain3 copy() { + return new Mountain3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java new file mode 100644 index 0000000000..3d72ef0dbc --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain4 extends mage.cards.basiclands.Mountain { + + public Mountain4(UUID ownerId) { + super(ownerId, 268); + this.expansionSetCode = "BFZ"; + } + + public Mountain4(final Mountain4 card) { + super(card); + } + + @Override + public Mountain4 copy() { + return new Mountain4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java new file mode 100644 index 0000000000..913411db52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Mountain5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Mountain5 extends mage.cards.basiclands.Mountain { + + public Mountain5(UUID ownerId) { + super(ownerId, 269); + this.expansionSetCode = "BFZ"; + } + + public Mountain5(final Mountain5 card) { + super(card); + } + + @Override + public Mountain5 copy() { + return new Mountain5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java new file mode 100644 index 0000000000..4b2a1798cf --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains1 extends mage.cards.basiclands.Plains { + + public Plains1(UUID ownerId) { + super(ownerId, 250); + this.expansionSetCode = "BFZ"; + } + + public Plains1(final Plains1 card) { + super(card); + } + + @Override + public Plains1 copy() { + return new Plains1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java new file mode 100644 index 0000000000..d278d488fb --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains2 extends mage.cards.basiclands.Plains { + + public Plains2(UUID ownerId) { + super(ownerId, 251); + this.expansionSetCode = "BFZ"; + } + + public Plains2(final Plains2 card) { + super(card); + } + + @Override + public Plains2 copy() { + return new Plains2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java new file mode 100644 index 0000000000..93a2b32e20 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains3 extends mage.cards.basiclands.Plains { + + public Plains3(UUID ownerId) { + super(ownerId, 252); + this.expansionSetCode = "BFZ"; + } + + public Plains3(final Plains3 card) { + super(card); + } + + @Override + public Plains3 copy() { + return new Plains3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java new file mode 100644 index 0000000000..7c95ef8945 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains4 extends mage.cards.basiclands.Plains { + + public Plains4(UUID ownerId) { + super(ownerId, 253); + this.expansionSetCode = "BFZ"; + } + + public Plains4(final Plains4 card) { + super(card); + } + + @Override + public Plains4 copy() { + return new Plains4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java new file mode 100644 index 0000000000..df7ccc8563 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Plains5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Plains5 extends mage.cards.basiclands.Plains { + + public Plains5(UUID ownerId) { + super(ownerId, 254); + this.expansionSetCode = "BFZ"; + } + + public Plains5(final Plains5 card) { + super(card); + } + + @Override + public Plains5 copy() { + return new Plains5(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.java new file mode 100644 index 0000000000..872fca6ef5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/PrairieStream.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlueManaAbility; +import mage.abilities.mana.WhiteManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class PrairieStream extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public PrairieStream(UUID ownerId) { + super(ownerId, 241, "Prairie Stream", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Plains"); + this.subtype.add("Island"); + + // Prairie Stream enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new WhiteManaAbility()); + this.addAbility(new BlueManaAbility()); + } + + public PrairieStream(final PrairieStream card) { + super(card); + } + + @Override + public PrairieStream copy() { + return new PrairieStream(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.java new file mode 100644 index 0000000000..5201f9e3ce --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RollingThunder.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.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class RollingThunder extends mage.sets.tempestremastered.RollingThunder { + + public RollingThunder(UUID ownerId) { + super(ownerId); + this.cardNumber = 154; + this.expansionSetCode = "BFZ"; + } + + public RollingThunder(final RollingThunder card) { + super(card); + } + + @Override + public RollingThunder copy() { + return new RollingThunder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.java new file mode 100644 index 0000000000..cf49a37bca --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SmolderingMarsh.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.RedManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SmolderingMarsh extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SmolderingMarsh(UUID ownerId) { + super(ownerId, 247, "Smoldering Marsh", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Swamp"); + this.subtype.add("Mountain"); + + // Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlackManaAbility()); + this.addAbility(new RedManaAbility()); + } + + public SmolderingMarsh(final SmolderingMarsh card) { + super(card); + } + + @Override + public SmolderingMarsh copy() { + return new SmolderingMarsh(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.java new file mode 100644 index 0000000000..6a585b8ca8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/SunkenHollow.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.TapSourceEffect; +import mage.abilities.mana.BlackManaAbility; +import mage.abilities.mana.BlueManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class SunkenHollow extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent(); + + static { + filter.add(new SupertypePredicate("Basic")); + } + + public SunkenHollow(UUID ownerId) { + super(ownerId, 248, "Sunken Hollow", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "BFZ"; + this.subtype.add("Island"); + this.subtype.add("Swamp"); + + // Sunken Hollow enters the battlefield tapped unless you control two or more basic lands. + Condition controls = new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 1)); + String abilityText = "tapped unless you control two or more basic lands"; + this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); + this.addAbility(new BlueManaAbility()); + this.addAbility(new BlackManaAbility()); + } + + public SunkenHollow(final SunkenHollow card) { + super(card); + } + + @Override + public SunkenHollow copy() { + return new SunkenHollow(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java new file mode 100644 index 0000000000..bea737b374 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp1.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp1 extends mage.cards.basiclands.Swamp { + + public Swamp1(UUID ownerId) { + super(ownerId, 260); + this.expansionSetCode = "BFZ"; + } + + public Swamp1(final Swamp1 card) { + super(card); + } + + @Override + public Swamp1 copy() { + return new Swamp1(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java new file mode 100644 index 0000000000..0436899d9c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp2.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp2 extends mage.cards.basiclands.Swamp { + + public Swamp2(UUID ownerId) { + super(ownerId, 261); + this.expansionSetCode = "BFZ"; + } + + public Swamp2(final Swamp2 card) { + super(card); + } + + @Override + public Swamp2 copy() { + return new Swamp2(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java new file mode 100644 index 0000000000..4bceb8a424 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp3.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp3 extends mage.cards.basiclands.Swamp { + + public Swamp3(UUID ownerId) { + super(ownerId, 262); + this.expansionSetCode = "BFZ"; + } + + public Swamp3(final Swamp3 card) { + super(card); + } + + @Override + public Swamp3 copy() { + return new Swamp3(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java new file mode 100644 index 0000000000..87bd2b49c7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp4.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp4 extends mage.cards.basiclands.Swamp { + + public Swamp4(UUID ownerId) { + super(ownerId, 263); + this.expansionSetCode = "BFZ"; + } + + public Swamp4(final Swamp4 card) { + super(card); + } + + @Override + public Swamp4 copy() { + return new Swamp4(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java new file mode 100644 index 0000000000..b2ebc6e393 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Swamp5.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author fireshoes + */ +public class Swamp5 extends mage.cards.basiclands.Swamp { + + public Swamp5(UUID ownerId) { + super(ownerId, 264); + this.expansionSetCode = "BFZ"; + } + + public Swamp5(final Swamp5 card) { + super(card); + } + + @Override + public Swamp5 copy() { + return new Swamp5(this); + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 31debb5a35..777b596f33 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27330,5 +27330,54 @@ Retreat to Kazandu|Battle for Zendikar|999||U|{2}{G}|Enchantment|||Landfall(This card has no color.)${1}: Target colorless creature gains haste until end of turn.| Veteran Warleader|Battle for Zendikar|999|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| Oblivion Sower|Battle for Zendikar|999|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| +Blight Herder|Battle for Zendikar|2|R|{5}|Creature - Eldrazi Processor|4|5|When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Eldrazi Devastator|Battle for Zendikar|7|C|{8}|Creature - Eldrazi|8|9|Trample| +Kozilek's Channeler|Battle for Zendikar|10|C|{5}|Creature - Eldrazi|4|4|{T}: Add {2} to your mana pool.| +Titan's Presence|Battle for Zendikar|14|U|{3}|Instant|||As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand.$Exile target creature if its power is less than or equal to the revealed card's power.| +Ulamog, the Ceaseless Hunger|Battle for Zendikar|15||M|{10}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| +Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice Felidar Cub: Destroy target enchantment.| +Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|||+1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| +Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| +Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4|3|Rally - Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn.| +Incubator Drone|Battle for Zendikar|60|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| +Mist Intruder|Battle for Zendikar|61|C|{1}{U}|Creature - Eldrazi Drone|1|2|Devoid (This card has no color.)$Flying$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| Guardian of Tazeem|Battle for Zendikar|78|R|{3}{U}{U}|Creature - Sphinx|4|5|Flying$Landfall - Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step.| -Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| \ No newline at end of file +Defiant Bloodlord|Battle for Zendikar|107|R|{5}{B}{B}|Creature - Vampire|4|5|Flying$Whenever you gain life, target opponent loses that much life.| +Ruinous Path|Battle for Zendikar|123|R|{1}{B}{B}|Sorcery|||Destroy target creature or planeswalker.$Awaken 4-{5}{B}{B} (If you cast this spell for {5}{B}{B}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| +Barrage Tyrant|Battle for Zendikar|127|R|{4}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)${2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player.| +Radiant Flames|Battle for Zendikar|151|R|{2}{R}|Sorcery||Converge - Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.| +Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players.| +Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| +Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| +Hedron Archive|Battle for Zendikar|223|U|{4}|Artifact|||{T}: Add {2} to your mana pool.${2}, {T}, Sacrifice Hedron Archive: Draw two cards.| +Canopy Vista|Battle for Zendikar|234|R||Land - Forest Plains|||Canopy Vista enters the battlefield tapped unless you control two or more basic lands.| +Cinder Glade|Battle for Zendikar|235|R||Land - Mountain Forest|||Cinder Glade enters the battlefield tapped unless you control two or more basic lands.| +Evolving Wilds|Battle for Zendikar|236|C||Land|||{T}, Sacrifice Evolving Wilds: Search your library for a basic land card and put it onto the battlefield tapped. Then shuffle your library.| +Prairie Stream|Battle for Zendikar|241|R||Land - Plains Island|||Prairie Stream enters the battlefield tapped unless you control two or more basic lands.| +Smoldering Marsh|Battle for Zendikar|247|R||Land - Swamp Mountain|||Smoldering Marsh enters the battlefield tapped unless you control two or more basic lands.| +Sunken Hollow|Battle for Zendikar|248|R||Land - Island Swamp|||Sunken Hollow enters the battlefield tapped unless you control two or more basic lands.| +Plains|Battle for Zendikar|250|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|251|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|252|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|253|L||Basic Land - Forest|||W| +Plains|Battle for Zendikar|254|L||Basic Land - Forest|||W| +Island|Battle for Zendikar|255|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|256|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|257|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|258|L||Basic Land - Forest|||U| +Island|Battle for Zendikar|259|L||Basic Land - Forest|||U| +Swamp|Battle for Zendikar|260|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|261|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|262|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|263|L||Basic Land - Forest|||B| +Swamp|Battle for Zendikar|264|L||Basic Land - Forest|||B| +Mountain|Battle for Zendikar|265|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|266|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|267|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|268|L||Basic Land - Forest|||R| +Mountain|Battle for Zendikar|269|L||Basic Land - Forest|||R| +Forest|Battle for Zendikar|270|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|271|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|272|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|273|L||Basic Land - Forest|||G| +Forest|Battle for Zendikar|274|L||Basic Land - Forest|||G| \ No newline at end of file From 9e1f67fa1ad28fdf2528c2115cfe895c61757e9e Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 02:50:38 -0500 Subject: [PATCH 36/63] [BFZ] Implemented Felidar Cub, Incubator Drone, Barrage Tyrant, Mist Intruder, Gideon's Reproach, Kozilek's Channeler, and Eldrazi Scion Token. [ONS] Implemented Airdrop Condor. --- .../src/main/resources/card-pictures-tok.txt | 2 + .../sets/battleforzendikar/BarrageTyrant.java | 132 ++++++++++++++++++ .../sets/battleforzendikar/FelidarCub.java | 70 ++++++++++ .../battleforzendikar/GideonsReproach.java | 60 ++++++++ .../battleforzendikar/IncubatorDrone.java | 69 +++++++++ .../battleforzendikar/KozileksChanneler.java | 65 +++++++++ .../sets/battleforzendikar/MistIntruder.java | 71 ++++++++++ .../src/mage/sets/fatereforged/Sandblast.java | 3 +- .../mage/sets/onslaught/AirdropCondor.java | 130 +++++++++++++++++ .../permanent/token/EldraziScionToken.java | 55 ++++++++ Utils/mtg-cards-data.txt | 2 +- 11 files changed, 657 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java create mode 100644 Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java create mode 100644 Mage/src/mage/game/permanent/token/EldraziScionToken.java diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 5af245dd30..1157109223 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -1,3 +1,5 @@ +#Generate|TOK:BFZ|Eldrazi Scion| + #Generate|TOK:DDP|Eldrazi Spawn 1| #Generate|TOK:DDP|Eldrazi Spawn 2| #Generate|TOK:DDP|Eldrazi Spawn 3| diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java new file mode 100644 index 0000000000..3d245a678e --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +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.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.DevoidAbility; +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.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class BarrageTyrant extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public BarrageTyrant(UUID ownerId) { + super(ownerId, 127, "Barrage Tyrant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // {2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BarrageTyrantEffect(), new ManaCostsImpl("{2}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BarrageTyrant(final BarrageTyrant card) { + super(card); + } + + @Override + public BarrageTyrant copy() { + return new BarrageTyrant(this); + } +} + +class BarrageTyrantEffect extends OneShotEffect { + + public BarrageTyrantEffect() { + super(Outcome.Damage); + staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; + } + + public BarrageTyrantEffect(final BarrageTyrantEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = 0; + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { + amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); + break; + } + } + if (amount > 0) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(amount, source.getSourceId(), game, false, true); + return true; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.damage(amount, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public BarrageTyrantEffect copy() { + return new BarrageTyrantEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.java new file mode 100644 index 0000000000..c6afaf9d4c --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/FelidarCub.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.battleforzendikar; + +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.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetEnchantmentPermanent; + +/** + * + * @author fireshoes + */ +public class FelidarCub extends CardImpl { + + public FelidarCub(UUID ownerId) { + super(ownerId, 25, "Felidar Cub", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Cat"); + this.subtype.add("Beast"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Sacrifice Felidar Cub: Destroy target enchantment. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new SacrificeSourceCost()); + ability.addTarget(new TargetEnchantmentPermanent()); + this.addAbility(ability); + } + + public FelidarCub(final FelidarCub card) { + super(card); + } + + @Override + public FelidarCub copy() { + return new FelidarCub(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.java new file mode 100644 index 0000000000..c12411f150 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonsReproach.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.battleforzendikar; + +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.TargetAttackingOrBlockingCreature; + +/** + * + * @author fireshoes + */ +public class GideonsReproach extends CardImpl { + + public GideonsReproach(UUID ownerId) { + super(ownerId, 30, "Gideon's Reproach", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); + this.expansionSetCode = "BFZ"; + + // Gideon's Reproach deals 4 damage to target attacking or blocking creature. + getSpellAbility().addEffect(new DamageTargetEffect(4)); + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } + + public GideonsReproach(final GideonsReproach card) { + super(card); + } + + @Override + public GideonsReproach copy() { + return new GideonsReproach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.java new file mode 100644 index 0000000000..c6e27dff96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/IncubatorDrone.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.game.permanent.token.EldraziScionToken; + +/** + * + * @author fireshoes + */ +public class IncubatorDrone extends CardImpl { + + public IncubatorDrone(UUID ownerId) { + super(ownerId, 60, "Incubator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()))); + } + + public IncubatorDrone(final IncubatorDrone card) { + super(card); + } + + @Override + public IncubatorDrone copy() { + return new IncubatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.java new file mode 100644 index 0000000000..f2542a772a --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/KozileksChanneler.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class KozileksChanneler extends CardImpl { + + public KozileksChanneler(UUID ownerId) { + super(ownerId, 10, "Kozilek's Channeler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}: Add {2} to your mana pool. + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost())); + } + + public KozileksChanneler(final KozileksChanneler card) { + super(card); + } + + @Override + public KozileksChanneler copy() { + return new KozileksChanneler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.java new file mode 100644 index 0000000000..87ee253668 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MistIntruder.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author fireshoes + */ +public class MistIntruder extends CardImpl { + + public MistIntruder(UUID ownerId) { + super(ownerId, 61, "Mist Intruder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Ingest + this.addAbility(new IngestAbility()); + } + + public MistIntruder(final MistIntruder card) { + super(card); + } + + @Override + public MistIntruder copy() { + return new MistIntruder(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java index d2b497ee17..46fd1e1e28 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java +++ b/Mage.Sets/src/mage/sets/fatereforged/Sandblast.java @@ -46,7 +46,8 @@ public class Sandblast extends CardImpl { // Sandblast deals 5 damage to target attacking or blocking creature. getSpellAbility().addEffect(new DamageTargetEffect(5)); - getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); } + getSpellAbility().addTarget(new TargetAttackingOrBlockingCreature()); + } public Sandblast(final Sandblast card) { super(card); diff --git a/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java new file mode 100644 index 0000000000..b2a18e2497 --- /dev/null +++ b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.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.onslaught; + +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.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class AirdropCondor extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin creature"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public AirdropCondor(UUID ownerId) { + super(ownerId, 186, "Airdrop Condor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ONS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to target creature or player. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AirdropCondorEffect(), new ManaCostsImpl("{1}{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public AirdropCondor(final AirdropCondor card) { + super(card); + } + + @Override + public AirdropCondor copy() { + return new AirdropCondor(this); + } +} + +class AirdropCondorEffect extends OneShotEffect { + + public AirdropCondorEffect() { + super(Outcome.Damage); + staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; + } + + public AirdropCondorEffect(final AirdropCondorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + int amount = 0; + for (Cost cost : source.getCosts()) { + if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { + amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); + break; + } + } + if (amount > 0) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + permanent.damage(amount, source.getSourceId(), game, false, true); + return true; + } + Player player = game.getPlayer(source.getFirstTarget()); + if (player != null) { + player.damage(amount, source.getSourceId(), game, false, true); + return true; + } + } + return false; + } + + @Override + public AirdropCondorEffect copy() { + return new AirdropCondorEffect(this); + } +} diff --git a/Mage/src/mage/game/permanent/token/EldraziScionToken.java b/Mage/src/mage/game/permanent/token/EldraziScionToken.java new file mode 100644 index 0000000000..90074e28aa --- /dev/null +++ b/Mage/src/mage/game/permanent/token/EldraziScionToken.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.game.permanent.token; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.mana.SimpleManaAbility; +import mage.constants.CardType; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class EldraziScionToken extends Token { + + public EldraziScionToken() { + super("Eldrazi Scion", "1/1 colorless Eldrazi Scion creature with \"Sacrifice this creature: Add {1} to your mana pool.\""); + cardType.add(CardType.CREATURE); + subtype.add("Eldrazi"); + subtype.add("Scion"); + power = new MageInt(1); + toughness = new MageInt(1); + addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana, new SacrificeSourceCost())); + this.setOriginalExpansionSetCode("BFZ"); + } + +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 777b596f33..37e1fb9d5f 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27334,7 +27334,7 @@ Blight Herder|Battle for Zendikar|2|R|{5}|Creature - Eldrazi Processor|4|5|When Eldrazi Devastator|Battle for Zendikar|7|C|{8}|Creature - Eldrazi|8|9|Trample| Kozilek's Channeler|Battle for Zendikar|10|C|{5}|Creature - Eldrazi|4|4|{T}: Add {2} to your mana pool.| Titan's Presence|Battle for Zendikar|14|U|{3}|Instant|||As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand.$Exile target creature if its power is less than or equal to the revealed card's power.| -Ulamog, the Ceaseless Hunger|Battle for Zendikar|15||M|{10}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| +Ulamog, the Ceaseless Hunger|Battle for Zendikar|15|M|{10}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice Felidar Cub: Destroy target enchantment.| Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|||+1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| From 1d8c3949be84f7c48ce70af7d55ce46b6cee1378 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 10:01:26 +0200 Subject: [PATCH 37/63] * Fixed test after fix of emblem ability. --- .../java/org/mage/test/cards/emblems/EmblemsTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java index 0c211862d2..103cd62881 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/emblems/EmblemsTest.java @@ -125,11 +125,11 @@ public class EmblemsTest extends CardTestPlayerBase { /** * Liliana, Defiant Necromancer: -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."; + * creature dies, return it to the battlefield under your control at the + * beginning of the next end step."; * - * Tests "Whenever a creature you control dies, return it to the battlefield - * under your control at the beginning of the next end step." + * Tests "Whenever a creature dies, return it to the battlefield under your + * control at the beginning of the next end step." */ @Test public void testLilianaDefiantNecromancer() { @@ -152,7 +152,7 @@ public class EmblemsTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1); assertPermanentCount(playerA, "Elite Vanguard", 1); - assertGraveyardCount(playerB, "Silvercoat Lion", 1); + assertPermanentCount(playerA, "Silvercoat Lion", 1); assertHandCount(playerA, 0); From eb3aef7ee5c05a7aece32b556b2df55b6bd759e7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 10:04:36 +0200 Subject: [PATCH 38/63] * Fixed that the new early way to add counters to permanents entering the battlefield (e.g. used for Undying) checked effects while the permanents was not already set to Zone battlefield. That caused e.g. the ability of Tatterkite not to work at that time. --- .../src/mage/sets/shadowmoor/Tatterkite.java | 18 ++--- .../cards/abilities/keywords/UndyingTest.java | 68 ++++++++++++++----- .../AddingCountersToPermanentsTest.java | 12 ++-- Mage/src/mage/cards/CardImpl.java | 4 +- 4 files changed, 64 insertions(+), 38 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java index 781d2d7608..27c846f33a 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Tatterkite.java @@ -32,7 +32,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.ruleModifying.CantRegenerateTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,10 +58,10 @@ public class Tatterkite extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // Tatterkite can't have counters placed on it. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield, "it"))); - + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantHaveCountersSourceEffect(Duration.WhileOnBattlefield))); + } public Tatterkite(final Tatterkite card) { @@ -77,7 +76,7 @@ public class Tatterkite extends CardImpl { class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { - public CantHaveCountersSourceEffect(Duration duration, String objectText) { + public CantHaveCountersSourceEffect(Duration duration) { super(duration, Outcome.Detriment); staticText = "{this} can't have counters placed on it"; } @@ -91,14 +90,9 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { return new CantHaveCountersSourceEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return true; - } - @Override public boolean checksEventType(GameEvent event, Game game) { - return event.getType() == EventType.ADD_COUNTER; + return event.getType() == EventType.ADD_COUNTERS; } @Override @@ -109,4 +103,4 @@ class CantHaveCountersSourceEffect extends ContinuousRuleModifyingEffectImpl { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java index eca34b84cd..31fc57868b 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java @@ -11,7 +11,8 @@ import org.mage.test.serverside.base.CardTestPlayerBase; public class UndyingTest extends CardTestPlayerBase { /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithBoost() { @@ -29,7 +30,8 @@ public class UndyingTest extends CardTestPlayerBase { } /** - * Tests boost weren't be applied second time when creature back to battlefield + * Tests boost weren't be applied second time when creature back to + * battlefield */ @Test public void testWithMassBoost() { @@ -62,7 +64,7 @@ public class UndyingTest extends CardTestPlayerBase { // Target creature gets -3/-3 until end of turn. addCard(Zone.HAND, playerA, "Last Gasp"); // Undying Evil - // Target creature gains undying until end of turn. + // Target creature gains undying until end of turn. // When it 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.) addCard(Zone.HAND, playerA, "Undying Evil"); @@ -76,9 +78,9 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Elite Vanguard", 3, 2); } - /** - * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist died it returns to the bf under opponent's control." + * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist + * died it returns to the bf under opponent's control." */ @Test public void testUndyingControlledReturnsToOwner() { @@ -105,18 +107,20 @@ public class UndyingTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.END_TURN); execute(); - assertGraveyardCount(playerB, "Threads of Disloyalty", 1); - assertGraveyardCount(playerA, "Lightning Bolt",1); + assertGraveyardCount(playerB, "Threads of Disloyalty", 1); + assertGraveyardCount(playerA, "Lightning Bolt", 1); assertPermanentCount(playerB, "Strangleroot Geist", 0); assertPermanentCount(playerA, "Strangleroot Geist", 1); assertPowerToughness(playerA, "Strangleroot Geist", 3, 2); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield + * + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndying() { @@ -125,7 +129,7 @@ public class UndyingTest extends CardTestPlayerBase { // Creature - Zombie, 1/1 {1}{B} // 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.) addCard(Zone.HAND, playerA, "Butcher Ghoul"); - + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.HAND, playerB, "Lightning Bolt"); // Anafenza, the Foremost @@ -141,17 +145,18 @@ public class UndyingTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Anafenza, the Foremost", 1); assertGraveyardCount(playerB, "Lightning Bolt", 1); - + assertPermanentCount(playerA, "Butcher Ghoul", 0); assertExileCount("Butcher Ghoul", 1); } /** - * Tests "Target creature with Undying will be exiled by Anafenza before it returns to battlefield - * if both leave the battlefield at the same time + * Tests "Target creature with Undying will be exiled by Anafenza before it + * returns to battlefield if both leave the battlefield at the same time * - * Anafenza the foremost doesn't exile an undying creature when dying at the same time as - * that undying one. The undying comes back to the field when he shouldn't. + * Anafenza the foremost doesn't exile an undying creature when dying at the + * same time as that undying one. The undying comes back to the field when + * he shouldn't. */ @Test public void testReplacementEffectPreventsReturnOfUndyingWrath() { @@ -208,4 +213,33 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); } + + /** + * Tatterkite is getting counters on it, i have him in a edh deck with + * Mikaeus, the Lunarch and when Tatterkite dies it triggers the undying and + * he gets the +1/+1 counters + */ + @Test + public void testUndyingMikaeusAndTatterkite() { + addCard(Zone.HAND, playerA, "Lightning Bolt", 1); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + // Whenever a Human deals damage to you, destroy it. + // Other non-Human creatures you control get +1/+1 and have undying. + addCard(Zone.BATTLEFIELD, playerA, "Mikaeus, the Unhallowed", 1); + + addCard(Zone.BATTLEFIELD, playerA, "Tatterkite", 1); // Artifact Creature - Scarecrow 2/1 + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Tatterkite"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + execute(); + + assertGraveyardCount(playerA, "Lightning Bolt", 1); + + assertPermanentCount(playerA, "Tatterkite", 1); + assertPermanentCount(playerA, "Mikaeus, the Unhallowed", 1); + assertPowerToughness(playerA, "Tatterkite", 3, 2); + + } + } 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 index ecd169b327..599b9f7f0a 100644 --- 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 @@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class AddingCountersToPermanentsTest extends CardTestPlayerBase { @Test @@ -47,7 +46,7 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { // 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); @@ -59,14 +58,13 @@ public class AddingCountersToPermanentsTest extends CardTestPlayerBase { assertGraveyardCount(playerA, "Silvercoat Lion", 1); assertGraveyardCount(playerB, "Silvercoat Lion", 1); - - assertPermanentCount(playerA, "Witch's Familiar", 1); + + assertPermanentCount(playerA, "Witch's Familiar", 1); assertPowerToughness(playerA, "Witch's Familiar", 0, 1); - assertPermanentCount(playerB, "Witch's Familiar", 1); + assertPermanentCount(playerB, "Witch's Familiar", 1); assertPowerToughness(playerB, "Witch's Familiar", 0, 1); - } -} \ No newline at end of file +} diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index b72b534d44..56a2e90a13 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -602,10 +602,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card { PermanentCard permanent = new PermanentCard(this, event.getPlayerId(), game); // make sure the controller of all continuous effects of this card are switched to the current controller game.getContinuousEffects().setController(objectId, event.getPlayerId()); - // check if there are counters to add to the permanent (e.g. from non replacement effects like Persist) - checkForCountersToAdd(permanent, game); game.addPermanent(permanent); setZone(Zone.BATTLEFIELD, game); + // check if there are counters to add to the permanent (e.g. from non replacement effects like Persist) + checkForCountersToAdd(permanent, game); game.setScopeRelevant(true); permanent.setTapped(tapped); permanent.setFaceDown(facedown, game); From 826b65628e62755570a3fc3f69c002f97996374c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 10:12:28 +0200 Subject: [PATCH 39/63] * Aven Windreader - Fixed that the reveal ability did only show the card to the controller of the ability and that the card was removed from libraray instead only shown. --- .../sets/ninthedition/AvenWindreader.java | 37 ++----------------- .../RevealTargetPlayerLibraryEffect.java | 25 ++++--------- 2 files changed, 10 insertions(+), 52 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java index 1c4b2d5ec6..f2df72e840 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java +++ b/Mage.Sets/src/mage/sets/ninthedition/AvenWindreader.java @@ -32,16 +32,12 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.RevealTargetPlayerLibraryEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -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; import mage.target.TargetPlayer; /** @@ -62,8 +58,9 @@ public class AvenWindreader extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); + // {1}{U}: Target player reveals the top card of his or her library. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTopCardTargetPlayerEffect(), new ManaCostsImpl("{1}{U}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealTargetPlayerLibraryEffect(1), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } @@ -77,31 +74,3 @@ public class AvenWindreader extends CardImpl { return new AvenWindreader(this); } } - -class RevealTopCardTargetPlayerEffect extends OneShotEffect { - - public RevealTopCardTargetPlayerEffect() { - super(Outcome.Benefit); - this.staticText = "Target player reveals the top card of his or her library."; - } - - public RevealTopCardTargetPlayerEffect(final RevealTopCardTargetPlayerEffect effect) { - super(effect); - } - - @Override - public RevealTopCardTargetPlayerEffect copy() { - return new RevealTopCardTargetPlayerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - CardsImpl cards = new CardsImpl(); - cards.add(player.getLibrary().removeFromTop(game)); - player.revealCards("Top card of target player's library", cards, game); - } - return false; - } -} diff --git a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java index c2a40e7970..5fb44e5849 100644 --- a/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java +++ b/Mage/src/mage/abilities/effects/common/RevealTargetPlayerLibraryEffect.java @@ -27,11 +27,11 @@ */ package mage.abilities.effects.common; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.Outcome; @@ -42,9 +42,8 @@ import mage.util.CardUtil; /** * - * @author anonymous + * @author Luna Skyrise */ - public class RevealTargetPlayerLibraryEffect extends OneShotEffect { private DynamicValue amountCards; @@ -73,28 +72,18 @@ public class RevealTargetPlayerLibraryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - - if (player == null || targetPlayer == null) { + MageObject sourceObject = source.getSourceObject(game); + if (player == null || targetPlayer == null || sourceObject == null) { return false; } Cards cards = new CardsImpl(Zone.LIBRARY); - int count = Math.min(targetPlayer.getLibrary().size(), amountCards.calculate(game, source, this)); - for (int i = 0; i < count; i++) { - Card card = targetPlayer.getLibrary().removeFromTop(game); - if (card != null) { - cards.add(card); - } - } - - player.lookAtCards("Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); - + cards.addAll(player.getLibrary().getTopCards(game, amountCards.calculate(game, source, this))); + player.revealCards(sourceObject.getIdName() + " - Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game); return true; } private String setText() { - StringBuilder sb = new StringBuilder("Reveal the top "); - sb.append(CardUtil.numberToText(amountCards.toString())).append(" cards of target player's library."); - return sb.toString(); + return "Reveal the top " + CardUtil.numberToText(amountCards.toString()) + " cards of target player's library."; } } From f2bb7470cf97155fa12707312bb8faae014be417 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 12:32:00 -0500 Subject: [PATCH 40/63] Implemented [BFZ] Ulamog, the Ceaseless Hunger and [S99] Wicked Pact. Updated some cards to use SacrificeCostCreaturesPower. --- .../sets/battleforzendikar/BarrageTyrant.java | 55 +---- .../UlamogTheCeaselessHunger.java | 191 +++++++++++++++++ .../sets/masterseditioniv/WickedPact.java | 54 +++++ .../mage/sets/onslaught/AirdropCondor.java | 55 +---- .../src/mage/sets/portal/WickedPact.java | 72 +++++++ .../src/mage/sets/starter1999/WickedPact.java | 52 +++++ .../sets/urzasdestiny/BloodshotCyclops.java | 198 +++++++----------- 7 files changed, 456 insertions(+), 221 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java create mode 100644 Mage.Sets/src/mage/sets/portal/WickedPact.java create mode 100644 Mage.Sets/src/mage/sets/starter1999/WickedPact.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java index 3d245a678e..d7214310ba 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BarrageTyrant.java @@ -31,22 +31,18 @@ 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.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.DevoidAbility; 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.filter.predicate.mageobject.ColorlessPredicate; import mage.filter.predicate.permanent.AnotherPredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -55,7 +51,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author fireshoes */ public class BarrageTyrant extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature"); static { @@ -72,9 +68,9 @@ public class BarrageTyrant extends CardImpl { // Devoid this.addAbility(new DevoidAbility(this.color)); - + // {2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BarrageTyrantEffect(), new ManaCostsImpl("{2}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{2}{R}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -89,44 +85,3 @@ public class BarrageTyrant extends CardImpl { return new BarrageTyrant(this); } } - -class BarrageTyrantEffect extends OneShotEffect { - - public BarrageTyrantEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } - - public BarrageTyrantEffect(final BarrageTyrantEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BarrageTyrantEffect copy() { - return new BarrageTyrantEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java new file mode 100644 index 0000000000..5b6d8c45eb --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogTheCeaselessHunger.java @@ -0,0 +1,191 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +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.FilterPermanent; +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.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class UlamogTheCeaselessHunger extends CardImpl { + + public UlamogTheCeaselessHunger(UUID ownerId) { + super(ownerId, 15, "Ulamog, the Ceaseless Hunger", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{10}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(10); + + // When you cast Ulamog, the Ceaseless Hunger, exile two target permanents. + this.addAbility(new UlamogExilePermanentsOnCastAbility()); + + // Indestructible + this.addAbility(IndestructibleAbility.getInstance()); + + // Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library. + Effect effect = new UlamogExileLibraryEffect(); + effect.setText("defending player exiles the top twenty cards of his or her library"); + this.addAbility(new UlamogAttackTriggeredAbility(effect)); + } + + public UlamogTheCeaselessHunger(final UlamogTheCeaselessHunger card) { + super(card); + } + + @Override + public UlamogTheCeaselessHunger copy() { + return new UlamogTheCeaselessHunger(this); + } +} + +class UlamogExilePermanentsOnCastAbility extends TriggeredAbilityImpl { + + UlamogExilePermanentsOnCastAbility() { + super(Zone.STACK, new ExileTargetEffect("exile two target permanents")); + this.addTarget(new TargetPermanent(2, new FilterPermanent())); + } + + UlamogExilePermanentsOnCastAbility(UlamogExilePermanentsOnCastAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Spell spell = (Spell) game.getObject(event.getTargetId()); + return this.getSourceId().equals(spell.getSourceId()); + } + + @Override + public UlamogExilePermanentsOnCastAbility copy() { + return new UlamogExilePermanentsOnCastAbility(this); + } + + @Override + public String getRule() { + return "When you cast {this}, " + super.getRule(); + } +} + +class UlamogAttackTriggeredAbility extends TriggeredAbilityImpl { + + public UlamogAttackTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public UlamogAttackTriggeredAbility(final UlamogAttackTriggeredAbility ability) { + super(ability); + } + + @Override + public UlamogAttackTriggeredAbility copy() { + return new UlamogAttackTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent sourcePermanent = game.getPermanent(this.getSourceId()); + if (sourcePermanent != null && event.getSourceId() == this.getSourceId()) { + UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game); + this.getEffects().get(0).setTargetPointer(new FixedTarget(defender)); + return true; + } + return false; + } + + @Override + public String getRule() { + return new StringBuilder("Whenever {this} attacks, ").append(super.getRule()).toString(); + } +} + +class UlamogExileLibraryEffect extends OneShotEffect { + + public UlamogExileLibraryEffect() { + super(Outcome.Exile); + this.staticText = "defending player exiles the top twenty cards of his or her library"; + } + + public UlamogExileLibraryEffect(final UlamogExileLibraryEffect effect) { + super(effect); + } + + @Override + public UlamogExileLibraryEffect copy() { + return new UlamogExileLibraryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player defender = game.getPlayer(targetPointer.getFirst(game, source)); + if (defender != null) { + int count = Math.min(defender.getLibrary().size(), 20); + for (int i = 0; i < count; i++) { + Card card = defender.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToExile(null, null, source.getSourceId(), game); + } + } + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.java new file mode 100644 index 0000000000..50d791d1f0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/WickedPact.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 fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 102; + this.expansionSetCode = "ME4"; + this.rarity = Rarity.UNCOMMON; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java index b2a18e2497..433fb6e541 100644 --- a/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java +++ b/Mage.Sets/src/mage/sets/onslaught/AirdropCondor.java @@ -31,21 +31,17 @@ 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.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +import mage.abilities.effects.common.DamageTargetEffect; 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.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -54,7 +50,7 @@ import mage.target.common.TargetCreatureOrPlayer; * @author fireshoes */ public class AirdropCondor extends CardImpl { - + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin creature"); static { @@ -70,9 +66,9 @@ public class AirdropCondor extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - + // {1}{R}, Sacrifice a Goblin creature: Airdrop Condor deals damage equal to the sacrificed creature's power to target creature or player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AirdropCondorEffect(), new ManaCostsImpl("{1}{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SacrificeCostCreaturesPower()), new ManaCostsImpl("{1}{R}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -87,44 +83,3 @@ public class AirdropCondor extends CardImpl { return new AirdropCondor(this); } } - -class AirdropCondorEffect extends OneShotEffect { - - public AirdropCondorEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } - - public AirdropCondorEffect(final AirdropCondorEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public AirdropCondorEffect copy() { - return new AirdropCondorEffect(this); - } -} diff --git a/Mage.Sets/src/mage/sets/portal/WickedPact.java b/Mage.Sets/src/mage/sets/portal/WickedPact.java new file mode 100644 index 0000000000..814ac4a641 --- /dev/null +++ b/Mage.Sets/src/mage/sets/portal/WickedPact.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.portal; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.LoseLifeSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class WickedPact extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public WickedPact(UUID ownerId) { + super(ownerId, 40, "Wicked Pact", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); + this.expansionSetCode = "POR"; + + // Destroy two target nonblack creatures. You lose 5 life. + this.getSpellAbility().addEffect(new DestroyTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, filter, false)); + this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(5)); + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/starter1999/WickedPact.java b/Mage.Sets/src/mage/sets/starter1999/WickedPact.java new file mode 100644 index 0000000000..0812593a4e --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/WickedPact.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 fireshoes + */ +public class WickedPact extends mage.sets.portal.WickedPact { + + public WickedPact(UUID ownerId) { + super(ownerId); + this.cardNumber = 92; + this.expansionSetCode = "S99"; + } + + public WickedPact(final WickedPact card) { + super(card); + } + + @Override + public WickedPact copy() { + return new WickedPact(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java index 1fa8d58f38..b760233b1b 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/BloodshotCyclops.java @@ -1,121 +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.urzasdestiny; - -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.common.SimpleActivatedAbility; -import mage.abilities.costs.Cost; -import mage.abilities.costs.common.SacrificeTargetCost; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; -import mage.target.common.TargetCreatureOrPlayer; - -/** - * - * @author Backfir3 - */ -public class BloodshotCyclops extends CardImpl { - - public BloodshotCyclops(UUID ownerId) { - super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); - this.expansionSetCode = "UDS"; - this.subtype.add("Cyclops"); - this.subtype.add("Giant"); - - this.power = new MageInt(4); - this.toughness = new MageInt(4); - - // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed - // creature's power to target creature or player. - SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BloodshotCyclopsEffect(), new TapSourceCost()); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); - ability.addTarget(new TargetCreatureOrPlayer()); - this.addAbility(ability); - } - - public BloodshotCyclops(final BloodshotCyclops card) { - super(card); - } - - @Override - public BloodshotCyclops copy() { - return new BloodshotCyclops(this); - } -} - -class BloodshotCyclopsEffect extends OneShotEffect { - - public BloodshotCyclopsEffect() { - super(Outcome.Damage); - staticText = "{this} deals damage equal to the sacrificed creature's power to target creature or player"; - } - - public BloodshotCyclopsEffect(final BloodshotCyclopsEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - int amount = 0; - for (Cost cost : source.getCosts()) { - if (cost instanceof SacrificeTargetCost && ((SacrificeTargetCost) cost).getPermanents().size() > 0) { - amount = ((SacrificeTargetCost) cost).getPermanents().get(0).getPower().getValue(); - break; - } - } - if (amount > 0) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.damage(amount, source.getSourceId(), game, false, true); - return true; - } - Player player = game.getPlayer(source.getFirstTarget()); - if (player != null) { - player.damage(amount, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public BloodshotCyclopsEffect copy() { - return new BloodshotCyclopsEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those 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.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.SacrificeCostCreaturesPower; +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.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Backfir3 + */ +public class BloodshotCyclops extends CardImpl { + + public BloodshotCyclops(UUID ownerId) { + super(ownerId, 77, "Bloodshot Cyclops", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Cyclops"); + this.subtype.add("Giant"); + + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // {T}, Sacrifice a creature: Bloodshot Cyclops deals damage equal to the sacrificed + // creature's power to target creature or player. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new DamageTargetEffect(new SacrificeCostCreaturesPower()), + new TapSourceCost()); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BloodshotCyclops(final BloodshotCyclops card) { + super(card); + } + + @Override + public BloodshotCyclops copy() { + return new BloodshotCyclops(this); + } +} From a6662b5dccac3564b00044a21054ca4941676532 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 21:14:11 +0200 Subject: [PATCH 41/63] * Spellskite - Fixed a bug of log message. Fixed a bug that multiple targets from different target instances could be changed with one activation. --- .../src/mage/sets/newphyrexia/Spellskite.java | 57 +++++++++++-------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java index ba7b8ebc63..5a9ee31b04 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Spellskite.java @@ -120,33 +120,44 @@ class SpellskiteEffect extends OneShotEffect { target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); } } else { - Player player = game.getPlayer(source.getControllerId()); - for (Target target : targets) { - for (UUID targetId : target.getTargets()) { - MageObject object = game.getObject(targetId); - String name; - if (object == null) { - Player targetPlayer = game.getPlayer(targetId); - name = targetPlayer.getLogName(); - } else { - name = object.getLogName(); - } - if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { - // you can't change this target to Spellskite because Spellskite is already another targetId of that target. - twoTimesTarget = true; - continue; - } - if (name != null && player.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + Player controller = game.getPlayer(source.getControllerId()); + boolean validTargets = false; + do { + for (Target target : targets) { + for (UUID targetId : target.getTargets()) { + MageObject object = game.getObject(targetId); + String name; + if (object == null) { + Player targetPlayer = game.getPlayer(targetId); + name = targetPlayer.getLogName(); + } else { + name = object.getLogName(); + } + if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) { + // you can't change this target to Spellskite because Spellskite is already another targetId of that target. + twoTimesTarget = true; + continue; + } if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) { - oldTarget = game.getObject(targets.getFirstTarget()); - target.remove(targetId); - // The source is still the spell on the stack - target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); - break; + validTargets = true; + if (name != null + && controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) { + oldTarget = game.getObject(targetId); + target.remove(targetId); + // The source is still the spell on the stack + target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game); + break; + } } } + if (oldTarget != null) { + break; + } } - } + if (oldTarget == null) { + game.informPlayer(controller, "You have to select at least one target to change to spellskite!"); + } + } while (validTargets && oldTarget == null); } if (oldTarget != null) { game.informPlayers(sourceObject.getLogName() + ": Changed target of " + stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName()); From a09eb2f94e017b9156a4a856905dfe305b8a8c3d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 21:15:09 +0200 Subject: [PATCH 42/63] * Leeching Bite - Fixed target handling to use correctly two target instances. --- .../mage/sets/newphyrexia/LeechingBite.java | 58 +++++-------------- .../effects/common/DestroyAllEffect.java | 57 +++++++++--------- 2 files changed, 43 insertions(+), 72 deletions(-) diff --git a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java index 7ab4a6277b..54869297d2 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/LeechingBite.java @@ -28,18 +28,15 @@ package mage.sets.newphyrexia; import java.util.UUID; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +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.abilities.Ability; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; +import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.SecondTargetPointer; /** * @@ -51,9 +48,16 @@ public class LeechingBite extends CardImpl { super(ownerId, 113, "Leeching Bite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}"); this.expansionSetCode = "NPH"; - - this.getSpellAbility().addEffect(new LeechingBiteEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2)); + // Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn. + Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn); + effect.setText("Target creature gets +1/+1 until end of turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the +1/+1 counter)"))); + effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn); + effect.setText("Another target creature gets -1/-1 until end of turn"); + effect.setTargetPointer(new SecondTargetPointer()); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (getting the -1/-1 counter)"))); } public LeechingBite(final LeechingBite card) { @@ -65,35 +69,3 @@ public class LeechingBite extends CardImpl { return new LeechingBite(this); } } - -class LeechingBiteEffect extends ContinuousEffectImpl { - - public LeechingBiteEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature); - this.staticText = "Target creature gets +1/+1 until end of turn. Another target creature gets -1/-1 until end of turn"; - } - - public LeechingBiteEffect(final LeechingBiteEffect effect) { - super(effect); - } - - @Override - public LeechingBiteEffect copy() { - return new LeechingBiteEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - permanent.addPower(1); - permanent.addToughness(1); - } - permanent = game.getPermanent(source.getTargets().get(0).getTargets().get(1)); - if (permanent != null) { - permanent.addPower(-1); - permanent.addToughness(-1); - } - return true; - } -} diff --git a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java index f9199f9372..6546b17f8a 100644 --- a/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/DestroyAllEffect.java @@ -1,31 +1,30 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common; import mage.abilities.Ability; @@ -49,8 +48,7 @@ public class DestroyAllEffect extends OneShotEffect { this.noRegen = noRegen; if (noRegen) { staticText = "destroy all " + filter.getMessage() + ". They can't be regenerated"; - } - else { + } else { staticText = "destroy all " + filter.getMessage(); } } @@ -72,6 +70,7 @@ public class DestroyAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, noRegen); } From 5f7f04be654dc5358fe029620ece951e0822af8a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 21:30:58 +0200 Subject: [PATCH 43/63] * Master of the Wild Hunt - Fixed that the damage that the controller of the targeted creature could assign was handled targeted and so hexproof could wrongly block that assignment. --- .../src/mage/player/human/HumanPlayer.java | 1 + .../sets/magic2010/MasterOfTheWildHunt.java | 75 ++++++++++--------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 0c25eaffc7..4246c91652 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -1080,6 +1080,7 @@ public class HumanPlayer extends PlayerImpl { int remainingDamage = damage; while (remainingDamage > 0 && canRespond()) { Target target = new TargetCreatureOrPlayer(); + target.setNotTarget(true); if (singleTargetName != null) { target.setTargetName(singleTargetName); } diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index 3d0c31b8d2..1e626c76a5 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -1,37 +1,35 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.sets.magic2010; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; @@ -40,6 +38,10 @@ import mage.abilities.costs.common.TapSourceCost; 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.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -51,10 +53,6 @@ import mage.game.permanent.token.WolfToken; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -72,7 +70,10 @@ public class MasterOfTheWildHunt extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); + // At the beginning of your upkeep, put a 2/2 green Wolf creature token onto the battlefield. this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new CreateTokenEffect(wolfToken))); + + // {T}: Tap all untapped Wolf creatures you control. Each Wolf tapped this way deals damage equal to its power to target creature. That creature deals damage equal to its power divided as its controller chooses among any number of those Wolves. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterOfTheWildHuntEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -116,7 +117,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { List wolves = new ArrayList<>(); Permanent target = game.getPermanent(source.getFirstTarget()); if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { permanent.tap(game); target.damage(permanent.getToughness().getValue(), permanent.getId(), game, false, true); wolves.add(permanent.getId()); @@ -128,4 +129,4 @@ class MasterOfTheWildHuntEffect extends OneShotEffect { return false; } -} \ No newline at end of file +} From 525da15640e7df3f1315c61a1072eed4535657d6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 21:47:18 +0200 Subject: [PATCH 44/63] * Diluvian Primordial - Fixed that the spells cast were not moved to exile. --- .../sets/gatecrash/DiluvianPrimordial.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java index b97e56ead7..21565e11e5 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java +++ b/Mage.Sets/src/mage/sets/gatecrash/DiluvianPrimordial.java @@ -73,20 +73,20 @@ public class DiluvianPrimordial extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // When Diluvian Primordial enters the battlefield, for each opponent, you may cast up to one target instant or sorcery card from that player's graveyard without paying its mana cost. If a card cast this way would be put into a graveyard this turn, exile it instead. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(),false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DiluvianPrimordialEffect(), false)); } @Override public void adjustTargets(Ability ability, Game game) { if (ability instanceof EntersBattlefieldTriggeredAbility) { ability.getTargets().clear(); - for(UUID opponentId : game.getOpponents(ability.getControllerId())) { + for (UUID opponentId : game.getOpponents(ability.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null) { FilterCard filter = new FilterCard("instant or sorcery card from " + opponent.getLogName() + "'s graveyard"); filter.add(new OwnerIdPredicate(opponentId)); - filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT),new CardTypePredicate(CardType.SORCERY))); - TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0,1, filter); + filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); + TargetCardInOpponentsGraveyard target = new TargetCardInOpponentsGraveyard(0, 1, filter); ability.addTarget(target); } } @@ -123,17 +123,16 @@ class DiluvianPrimordialEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Target target: source.getTargets()) { + for (Target target : source.getTargets()) { if (target instanceof TargetCardInOpponentsGraveyard) { Card targetCard = game.getCard(target.getFirstTarget()); if (targetCard != null) { - if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() +"?", source, game)) { - // TODO: Handle the case if the cast is not possible, so the replacement effect shouldn't be active - ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); - effect.setTargetPointer(new FixedTarget(targetCard.getId())); - game.addEffect(effect, source); - - controller.cast(targetCard.getSpellAbility(), game, true); + if (controller.chooseUse(outcome, "Cast " + targetCard.getLogName() + "?", source, game)) { + if (controller.cast(targetCard.getSpellAbility(), game, true)) { + ContinuousEffect effect = new DiluvianPrimordialReplacementEffect(); + effect.setTargetPointer(new FixedTarget(targetCard.getId(), game.getState().getZoneChangeCounter(targetCard.getId()))); + game.addEffect(effect, source); + } } } } @@ -169,7 +168,7 @@ class DiluvianPrimordialReplacementEffect extends ReplacementEffectImpl { public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Card card = game.getCard(((FixedTarget)getTargetPointer()).getTarget()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { controller.moveCards(card, Zone.STACK, Zone.EXILED, source, game); return true; From cb01b0ee05387e3a80ab6808e2857d9e7b7c2f19 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 14:47:21 -0500 Subject: [PATCH 45/63] Implemented [BFZ] Omnath, Locus of Rage, [MRD] Dross Scorpion, and[SCG] Vengeful Dead. Changed some cards from using DiesCreatureTriggedAbility to DiesThisOrAnotherCreatureAbility. --- .../src/main/resources/card-pictures-tok.txt | 1 + .../battleforzendikar/OmnathLocusOfRage.java | 98 +++++++ .../elvesvsgoblins/SkirkDrillSergeant.java | 266 +++++++++--------- .../src/mage/sets/mirrodin/DrossScorpion.java | 75 +++++ .../sets/onslaught/RotlungReanimator.java | 4 +- .../src/mage/sets/scourge/VengefulDead.java | 71 +++++ 6 files changed, 380 insertions(+), 135 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java create mode 100644 Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java create mode 100644 Mage.Sets/src/mage/sets/scourge/VengefulDead.java diff --git a/Mage.Client/src/main/resources/card-pictures-tok.txt b/Mage.Client/src/main/resources/card-pictures-tok.txt index 1157109223..ce5970f682 100644 --- a/Mage.Client/src/main/resources/card-pictures-tok.txt +++ b/Mage.Client/src/main/resources/card-pictures-tok.txt @@ -1,4 +1,5 @@ #Generate|TOK:BFZ|Eldrazi Scion| +#Generate|TOK:BFZ|Elemental| #Generate|TOK:DDP|Eldrazi Spawn 1| #Generate|TOK:DDP|Eldrazi Spawn 2| diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.java new file mode 100644 index 0000000000..cbfc4eefa5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OmnathLocusOfRage.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.Token; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author fireshoes + */ +public class OmnathLocusOfRage extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Elemental"); + + static { + filter.add(new SubtypePredicate("Elemental")); + } + + public OmnathLocusOfRage(UUID ownerId) { + super(ownerId, 217, "Omnath, Locus of Rage", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{R}{R}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.supertype.add("Legendary"); + this.subtype.add("Elemental"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield. + this.addAbility(new LandfallAbility(new CreateTokenEffect(new OmnathElementalToken()), false)); + + // Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new DamageTargetEffect(3), false, filter); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public OmnathLocusOfRage(final OmnathLocusOfRage card) { + super(card); + } + + @Override + public OmnathLocusOfRage copy() { + return new OmnathLocusOfRage(this); + } +} + +class OmnathElementalToken extends Token { + + OmnathElementalToken() { + super("Elemental", "5/5 red and green Elemental creature token"); + setTokenType(1); + setOriginalExpansionSetCode("BFZ"); + cardType.add(CardType.CREATURE); + subtype.add("Elemental"); + + color.setRed(true); + color.setGreen(true); + power = new MageInt(5); + toughness = new MageInt(5); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java index fc751e6524..55756cd3db 100644 --- a/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java +++ b/Mage.Sets/src/mage/sets/elvesvsgoblins/SkirkDrillSergeant.java @@ -1,133 +1,133 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.elvesvsgoblins; - -import java.util.UUID; -import mage.MageInt; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.common.DiesCreatureTriggeredAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DoIfCostPaid; -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.common.FilterCreaturePermanent; -import mage.filter.common.FilterPermanentCard; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.players.Player; - -/** - * - * @author LevelX2 - */ -public class SkirkDrillSergeant extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeant(UUID ownerId) { - super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); - this.expansionSetCode = "EVG"; - this.subtype.add("Goblin"); - - this.power = new MageInt(2); - this.toughness = new MageInt(1); - - // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. - this.addAbility(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); - - } - - public SkirkDrillSergeant(final SkirkDrillSergeant card) { - super(card); - } - - @Override - public SkirkDrillSergeant copy() { - return new SkirkDrillSergeant(this); - } -} - -class SkirkDrillSergeantEffect extends OneShotEffect { - - private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); - - static { - filter.add(new SubtypePredicate("Goblin")); - } - - public SkirkDrillSergeantEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; - } - - public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { - super(effect); - } - - @Override - public SkirkDrillSergeantEffect copy() { - return new SkirkDrillSergeantEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - MageObject sourceObject = game.getObject(source.getSourceId()); - if (player == null || sourceObject == null) { - return false; - } - - if (player.getLibrary().size() > 0) { - Card card = player.getLibrary().getFromTop(game); - Cards cards = new CardsImpl(); - cards.add(card); - player.revealCards(sourceObject.getName(), cards, game); - - if (card != null) { - if (filter.match(card, game)) { - player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); - } else { - player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); - } - } - } - return true; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.elvesvsgoblins; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +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.common.FilterCreaturePermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author LevelX2 + */ +public class SkirkDrillSergeant extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Goblin"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeant(UUID ownerId) { + super(ownerId, 49, "Skirk Drill Sergeant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "EVG"; + this.subtype.add("Goblin"); + + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Whenever Skirk Drill Sergeant or another Goblin dies, you may pay {2}{R}. If you do, reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new DoIfCostPaid(new SkirkDrillSergeantEffect(), new ManaCostsImpl("{2}{R}")), false, filter)); + + } + + public SkirkDrillSergeant(final SkirkDrillSergeant card) { + super(card); + } + + @Override + public SkirkDrillSergeant copy() { + return new SkirkDrillSergeant(this); + } +} + +class SkirkDrillSergeantEffect extends OneShotEffect { + + private static final FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + + public SkirkDrillSergeantEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "reveal the top card of your library. If it's a Goblin permanent card, put it onto the battlefield. Otherwise, put it into your graveyard"; + } + + public SkirkDrillSergeantEffect(final SkirkDrillSergeantEffect effect) { + super(effect); + } + + @Override + public SkirkDrillSergeantEffect copy() { + return new SkirkDrillSergeantEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (player == null || sourceObject == null) { + return false; + } + + if (player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + Cards cards = new CardsImpl(); + cards.add(card); + player.revealCards(sourceObject.getName(), cards, game); + + if (card != null) { + if (filter.match(card, game)) { + player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + } else { + player.moveCards(card, Zone.LIBRARY, Zone.GRAVEYARD, source, game); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.java new file mode 100644 index 0000000000..727d367e7f --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/DrossScorpion.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.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class DrossScorpion extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public DrossScorpion(UUID ownerId) { + super(ownerId, 164, "Dross Scorpion", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Scorpion"); + this.power = new MageInt(3); + this.toughness = new MageInt(1); + + // Whenever Dross Scorpion or another artifact creature dies, you may untap target artifact. + Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new UntapTargetEffect(), true, filter); + ability.addTarget(new TargetArtifactPermanent()); + this.addAbility(ability); + } + + public DrossScorpion(final DrossScorpion card) { + super(card); + } + + @java.lang.Override + public DrossScorpion copy() { + return new DrossScorpion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java index 15ec38fc4d..38ce5a39a6 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java +++ b/Mage.Sets/src/mage/sets/onslaught/RotlungReanimator.java @@ -29,7 +29,7 @@ package mage.sets.onslaught; import java.util.UUID; import mage.MageInt; -import mage.abilities.common.DiesCreatureTriggeredAbility; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; @@ -59,7 +59,7 @@ public class RotlungReanimator extends CardImpl { this.toughness = new MageInt(2); // Whenever Rotlung Reanimator or another Cleric dies, put a 2/2 black Zombie creature token onto the battlefield. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken()), false, filter)); } public RotlungReanimator(final RotlungReanimator card) { diff --git a/Mage.Sets/src/mage/sets/scourge/VengefulDead.java b/Mage.Sets/src/mage/sets/scourge/VengefulDead.java new file mode 100644 index 0000000000..702ee27ee9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/VengefulDead.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.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesThisOrAnotherCreatureTriggeredAbility; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author fireshoes + */ +public class VengefulDead extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("{this} or another Zombie"); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + + public VengefulDead(UUID ownerId) { + super(ownerId, 80, "Vengeful Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "SCG"; + this.subtype.add("Zombie"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Whenever Vengeful Dead or another Zombie dies, each opponent loses 1 life. + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter)); + } + + public VengefulDead(final VengefulDead card) { + super(card); + } + + @Override + public VengefulDead copy() { + return new VengefulDead(this); + } +} From 8d683a7e5c5ca21a9aa5b62767ced34a3e4d0b18 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 30 Aug 2015 23:49:38 +0200 Subject: [PATCH 46/63] * Split cards - Fixed a bug when split cards get copied (e.g. by Isochron Scepter) refering still to the copied card. --- .../cards/abilities/keywords/InfectTest.java | 73 +++++++++++-------- Mage/src/mage/cards/CardImpl.java | 2 +- Mage/src/mage/cards/SplitCard.java | 26 +++++-- Mage/src/mage/cards/SplitCardHalf.java | 4 +- Mage/src/mage/cards/SplitCardHalfImpl.java | 9 ++- Mage/src/mage/cards/mock/MockSplitCard.java | 4 +- Mage/src/mage/game/Exile.java | 2 +- Mage/src/mage/game/GameImpl.java | 4 + 8 files changed, 80 insertions(+), 44 deletions(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java index 4b8729e65f..d1f5ab3848 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/InfectTest.java @@ -37,21 +37,23 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class InfectTest extends CardTestPlayerBase { /** - - 702.89. Infect - 702.89a Infect is a static ability. - 702.89b Damage dealt to a player by a source with infect doesn’t cause that player to lose life. Rather, it causes the player to get that many poison counters. See rule 119.3. - 702.89c Damage dealt to a creature by a source with infect isn’t marked on that creature. Rather, it causes that many -1/-1 counters to be put on that creature. See rule 119.3. - 702.89d If a permanent leaves the battlefield before an effect causes it to deal damage, its last known information is used to determine whether it had infect. - 702.89e The infect rules function no matter what zone an object with infect deals damage from. - 702.89f Multiple instances of infect on the same object are redundant. - + * + * 702.89. Infect 702.89a Infect is a static ability. 702.89b Damage dealt + * to a player by a source with infect doesn’t cause that player to lose + * life. Rather, it causes the player to get that many poison counters. See + * rule 119.3. 702.89c Damage dealt to a creature by a source with infect + * isn’t marked on that creature. Rather, it causes that many -1/-1 counters + * to be put on that creature. See rule 119.3. 702.89d If a permanent leaves + * the battlefield before an effect causes it to deal damage, its last known + * information is used to determine whether it had infect. 702.89e The + * infect rules function no matter what zone an object with infect deals + * damage from. 702.89f Multiple instances of infect on the same object are + * redundant. + * */ - @Test public void testNormalUse() { addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect @@ -64,16 +66,15 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 2); assertLife(playerA, 20); - assertLife(playerB, 20); - + assertLife(playerB, 20); + } - @Test public void testLoseInfectUse() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + addCard(Zone.BATTLEFIELD, playerB, "Tine Shrike"); // 2/1 Infect attack(2, playerB, "Tine Shrike"); @@ -84,23 +85,29 @@ public class InfectTest extends CardTestPlayerBase { assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 18); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + /** - * Inkmoth Nexus has no effect it he attacks becaus it has infect but there are no counters added + * Inkmoth Nexus has no effect it he attacks becaus it has infect but there + * are no counters added * http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/296553-melira-sylvok-outcast-vs-inkmoth-nexus */ @Test public void testInkmothNexusLoseInfect() { - // Creatures your opponents control lose infect. - addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); - - addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); - addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + // Creatures your opponents control lose infect. + // Creatures you control can't have -1/-1 counters placed on them. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast"); + // Put a -1/-1 counter on target creature. When that creature dies this turn, its controller gets a poison counter. + addCard(Zone.HAND, playerA, "Virulent Wound"); // Instant {B} + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1); - // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. + addCard(Zone.BATTLEFIELD, playerB, "Plains", 1); + addCard(Zone.BATTLEFIELD, playerB, "Inkmoth Nexus"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Virulent Wound", "Melira, Sylvok Outcast"); + // {1}: Inkmoth Nexus becomes a 1/1 Blinkmoth artifact creature with flying and infect until end of turn. It's still a land. // (It deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.) activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: {this} becomes"); attack(2, playerB, "Inkmoth Nexus"); @@ -108,13 +115,15 @@ public class InfectTest extends CardTestPlayerBase { setStopAt(2, PhaseStep.POSTCOMBAT_MAIN); execute(); + assertGraveyardCount(playerA, "Virulent Wound", 1); + assertPowerToughness(playerA, "Melira, Sylvok Outcast", 2, 2); assertTapped("Plains", true); assertTapped("Inkmoth Nexus", true); assertCounterCount(playerA, CounterType.POISON, 0); assertLife(playerA, 20); - assertLife(playerB, 20); - - } - + assertLife(playerB, 20); + + } + } diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index 56a2e90a13..54db7c4463 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -366,7 +366,7 @@ 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 + if (stackObject == null && (this instanceof SplitCard)) { // handle if half of 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()); diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index 7aef9b2756..27b093adee 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -60,16 +60,32 @@ public abstract class SplitCard extends CardImpl { public SplitCard(SplitCard card) { super(card); - this.leftHalfCard = card.leftHalfCard.copy(); + this.leftHalfCard = card.getLeftHalfCard().copy(); + ((SplitCardHalf) leftHalfCard).setParentCard(this); this.rightHalfCard = card.rightHalfCard.copy(); + ((SplitCardHalf) rightHalfCard).setParentCard(this); } - public Card getLeftHalfCard() { - return leftHalfCard; + public SplitCardHalf getLeftHalfCard() { + return (SplitCardHalf) leftHalfCard; } - public Card getRightHalfCard() { - return rightHalfCard; + public SplitCardHalf getRightHalfCard() { + return (SplitCardHalf) rightHalfCard; + } + + @Override + public void assignNewId() { + super.assignNewId(); + leftHalfCard.assignNewId(); + rightHalfCard.assignNewId(); + } + + @Override + public void setCopy(boolean isCopy) { + super.setCopy(isCopy); + leftHalfCard.setCopy(isCopy); + rightHalfCard.setCopy(isCopy); } @Override diff --git a/Mage/src/mage/cards/SplitCardHalf.java b/Mage/src/mage/cards/SplitCardHalf.java index 52fa1086bb..f1ec397660 100644 --- a/Mage/src/mage/cards/SplitCardHalf.java +++ b/Mage/src/mage/cards/SplitCardHalf.java @@ -12,5 +12,7 @@ package mage.cards; public interface SplitCardHalf extends Card { @Override - Card copy(); + SplitCardHalf copy(); + + void setParentCard(SplitCard card); } diff --git a/Mage/src/mage/cards/SplitCardHalfImpl.java b/Mage/src/mage/cards/SplitCardHalfImpl.java index af6cc3f6ab..818d539c4a 100644 --- a/Mage/src/mage/cards/SplitCardHalfImpl.java +++ b/Mage/src/mage/cards/SplitCardHalfImpl.java @@ -62,7 +62,7 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public Card getMainCard() { + public SplitCard getMainCard() { return splitCardParent; } @@ -74,8 +74,13 @@ public class SplitCardHalfImpl extends CardImpl implements SplitCardHalf { } @Override - public SplitCardHalfImpl copy() { + public SplitCardHalf copy() { return new SplitCardHalfImpl(this); } + @Override + public void setParentCard(SplitCard card) { + this.splitCardParent = card; + } + } diff --git a/Mage/src/mage/cards/mock/MockSplitCard.java b/Mage/src/mage/cards/mock/MockSplitCard.java index fd9e8a0618..3eb271bdad 100644 --- a/Mage/src/mage/cards/mock/MockSplitCard.java +++ b/Mage/src/mage/cards/mock/MockSplitCard.java @@ -50,12 +50,12 @@ public class MockSplitCard extends SplitCard { } CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card)); - if(leftHalf != null) { + if (leftHalf != null) { this.leftHalfCard = new MockCard(leftHalf); } CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card)); - if(rightHalf != null) { + if (rightHalf != null) { this.rightHalfCard = new MockCard(rightHalf); } } diff --git a/Mage/src/mage/game/Exile.java b/Mage/src/mage/game/Exile.java index 688a272758..42b513092f 100644 --- a/Mage/src/mage/game/Exile.java +++ b/Mage/src/mage/game/Exile.java @@ -100,7 +100,7 @@ public class Exile implements Serializable, Copyable { } public List getAllCards(Game game) { - List cards = new ArrayList(); + List cards = new ArrayList<>(); for (ExileZone exile : exileZones.values()) { cards.addAll(exile.getCards(game)); } diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index b8ad5577fe..dbaf208508 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -67,6 +67,7 @@ import mage.cards.Card; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; import mage.cards.decks.Deck; import mage.choices.Choice; import mage.constants.CardType; @@ -1525,6 +1526,9 @@ public abstract class GameImpl implements Game, Serializable { Iterator copiedCards = this.getState().getCopiedCards().iterator(); while (copiedCards.hasNext()) { Card card = copiedCards.next(); + if (card instanceof SplitCardHalf) { + continue; // only the main card is moves, not the halves + } Zone zone = state.getZone(card.getId()); if (zone != Zone.BATTLEFIELD && zone != Zone.STACK) { switch (zone) { From cb0e4a84ce702c3de63ac4001fe4b6b740f437aa Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 18:10:42 -0500 Subject: [PATCH 47/63] [BFZ] Implemented Oran-Rief Hydra and Nissa's Renewal. --- .../sets/battleforzendikar/NissasRenewal.java | 62 +++++++ .../sets/battleforzendikar/OranRiefHydra.java | 155 ++++++++++++++++++ Utils/mtg-cards-data.txt | 1 + 3 files changed, 218 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.java new file mode 100644 index 0000000000..c1fd2e8648 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/NissasRenewal.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.battleforzendikar; + +import java.util.UUID; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterBasicLandCard; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author fireshoes + */ +public class NissasRenewal extends CardImpl { + + public NissasRenewal(UUID ownerId) { + super(ownerId, 180, "Nissa's Renewal", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}"); + this.expansionSetCode = "BFZ"; + + // Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life. + this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 3, new FilterBasicLandCard()), true)); + this.getSpellAbility().addEffect(new GainLifeEffect(7)); + } + + public NissasRenewal(final NissasRenewal card) { + super(card); + } + + @Override + public NissasRenewal copy() { + return new NissasRenewal(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java new file mode 100644 index 0000000000..b3f7679d29 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/OranRiefHydra.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +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.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author fireshoes + */ +public class OranRiefHydra extends CardImpl { + + public OranRiefHydra(UUID ownerId) { + super(ownerId, 181, "Oran-Rief Hydra", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Hydra"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. + // If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead. + this.addAbility(new OranRiefHydraTriggeredAbility()); + } + + public OranRiefHydra(final OranRiefHydra card) { + super(card); + } + + @Override + public OranRiefHydra copy() { + return new OranRiefHydra(this); + } +} + +class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl { + + private static final String text = "Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. " + + "If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead."; + + public OranRiefHydraTriggeredAbility() { + super(Zone.BATTLEFIELD, new OranRiefHydraEffect()); + } + + public OranRiefHydraTriggeredAbility(final OranRiefHydraTriggeredAbility ability) { + super(ability); + } + + @Override + public OranRiefHydraTriggeredAbility copy() { + return new OranRiefHydraTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null + && permanent.getCardType().contains(CardType.LAND) + && permanent.getControllerId().equals(getControllerId())) { + Permanent sourcePermanent = game.getPermanent(getSourceId()); + if (sourcePermanent != null) + for (Effect effect : getEffects()) { + if (effect instanceof OranRiefHydraEffect) { + effect.setTargetPointer(new FixedTarget(permanent, game)); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return text; + } +} + +class OranRiefHydraEffect extends OneShotEffect { + + public OranRiefHydraEffect() { + super(Outcome.BoostCreature); + } + + public OranRiefHydraEffect(final OranRiefHydraEffect effect) { + super(effect); + } + + @Override + public OranRiefHydraEffect copy() { + return new OranRiefHydraEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (land != null && sourcePermanent != null) { + if (land.hasSubtype("Forest")) { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(2), game); + } else { + sourcePermanent.addCounters(CounterType.P1P1.createInstance(), game); + } + return true; + } + return false; + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 37e1fb9d5f..572370bc00 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27347,6 +27347,7 @@ Ruinous Path|Battle for Zendikar|123|R|{1}{B}{B}|Sorcery|||Destroy target creatu Barrage Tyrant|Battle for Zendikar|127|R|{4}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)${2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player.| Radiant Flames|Battle for Zendikar|151|R|{2}{R}|Sorcery||Converge - Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.| Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players.| +Nissa's Renewal|Battle for Zendikar|180|R|{5}{G}|Sorcery|||Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life.| Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| Hedron Archive|Battle for Zendikar|223|U|{4}|Artifact|||{T}: Add {2} to your mana pool.${2}, {T}, Sacrifice Hedron Archive: Draw two cards.| From 9188fe20881768b829261333030b3cfb9f373655 Mon Sep 17 00:00:00 2001 From: Paulo L F Casaretto Date: Sun, 30 Aug 2015 22:09:19 -0300 Subject: [PATCH 48/63] Test and fix Harsh Mercy --- .../src/mage/sets/onslaught/HarshMercy.java | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java index 62af91dd4c..bd1478b37c 100644 --- a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java +++ b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java @@ -27,9 +27,7 @@ */ package mage.sets.onslaught; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Set; import java.util.UUID; import mage.MageObject; @@ -60,6 +58,7 @@ public class HarshMercy extends CardImpl { super(ownerId, 39, "Harsh Mercy", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}"); this.expansionSetCode = "ONS"; + // Each player chooses a creature type. Destroy all creatures that aren't of a type chosen this way. They can't be regenerated. this.getSpellAbility().addEffect(new HarshMercyEffect()); } @@ -90,36 +89,35 @@ class HarshMercyEffect extends OneShotEffect { } @Override - public boolean apply(Game game, Ability ability) { - Player controller = game.getPlayer(ability.getControllerId()); - MageObject sourceObject = game.getObject(ability.getSourceId()); - if (controller != null) { + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { Set chosenTypes = new HashSet<>(); - for (UUID playerId : controller.getInRange()) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game) ) { Player player = game.getPlayer(playerId); Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose a creature type"); typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { if (!player.canRespond()) { - break; + continue; } } String chosenType = typeChoice.getChoice(); if (chosenType != null) { - game.informPlayers(sourceObject.getName() + ": " + player.getLogName() + " has chosen " + chosenType); + game.informPlayers(sourceObject.getIdName() + ": " + player.getLogName() + " has chosen " + chosenType); chosenTypes.add(chosenType); } } - - List predicates = new ArrayList<>(); - for (String type : chosenTypes) { - predicates.add((SubtypePredicate) Predicates.not(new SubtypePredicate(type))); - } + FilterPermanent filter = new FilterCreaturePermanent("creatures"); - filter.add(Predicates.or(predicates)); - - return (new DestroyAllEffect(filter, true)).apply(game, ability); + for (String type : chosenTypes) { + filter.add(Predicates.not(new SubtypePredicate(type))); + } + + + return (new DestroyAllEffect(filter, true)).apply(game, source); } return false; } From b7db163a09c4201a756528593288abff21da785a Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 30 Aug 2015 20:31:23 -0500 Subject: [PATCH 49/63] [BFZ] Implemented Gideon, Ally of Zendikar --- .../GideonAllyOfZendikar.java | 126 ++++++++++++++++++ .../sets/riseoftheeldrazi/GideonJura.java | 12 +- 2 files changed, 132 insertions(+), 6 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java new file mode 100644 index 0000000000..fca8342170 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +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.Zone; +import mage.counters.CounterType; +import mage.game.command.Emblem; +import mage.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class GideonAllyOfZendikar extends CardImpl { + + public GideonAllyOfZendikar(UUID ownerId) { + super(ownerId, 29, "Gideon, Ally of Zendikar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Gideon"); + + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false)); + + // +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. + LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), "planeswalker", Duration.EndOfTurn), 1); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); + effect.setText("Prevent all damage that would be dealt to him this turn"); + ability.addEffect(effect); + this.addAbility(ability); + + // 0: Put a 2/2 white Knight Ally creature token onto the battlefield. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new KnightAllyToken()), 0)); + + // -4: You get an emblem with "Creatures you control get +1/+1." + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GideonAllyOfZendikarEmblem()), -4)); + } + + public GideonAllyOfZendikar(final GideonAllyOfZendikar card) { + super(card); + } + + @Override + public GideonAllyOfZendikar copy() { + return new GideonAllyOfZendikar(this); + } +} + +class GideonAllyOfZendikarEmblem extends Emblem { + + public GideonAllyOfZendikarEmblem() { + this.setName("EMBLEM: Gideon, Ally of Zendikar"); + BoostControlledEffect effect = new BoostControlledEffect(1, 1, Duration.EndOfGame); + Ability ability = new SimpleStaticAbility(Zone.COMMAND, effect); + this.getAbilities().add(ability); + } +} + +class GideonAllyOfZendikarToken extends Token { + + public GideonAllyOfZendikarToken() { + super("", "5/5 Human Soldier Ally creature with indestructible"); + cardType.add(CardType.CREATURE); + subtype.add("Human"); + subtype.add("Soldier"); + subtype.add("Ally"); + power = new MageInt(5); + toughness = new MageInt(5); + + addAbility(IndestructibleAbility.getInstance()); + } +} + +class KnightAllyToken extends Token { + + public KnightAllyToken() { + super("Knight Ally", "2/2 white Knight Ally creature"); + cardType.add(CardType.CREATURE); + subtype.add("Knight"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(2); + toughness = new MageInt(2); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index d01d66c596..45fdec326b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -29,10 +29,6 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.TurnPhase; import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; @@ -40,11 +36,15 @@ 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; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +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.TurnPhase; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.TappedPredicate; From fbb02760aa1429f720a0494be1451526b52e6859 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 31 Aug 2015 07:55:59 +0200 Subject: [PATCH 50/63] * Harsh Mercy - Fixed useless continue statement. --- Mage.Sets/src/mage/sets/onslaught/HarshMercy.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java index bd1478b37c..d0dce29fb3 100644 --- a/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java +++ b/Mage.Sets/src/mage/sets/onslaught/HarshMercy.java @@ -94,14 +94,15 @@ class HarshMercyEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { Set chosenTypes = new HashSet<>(); - for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game) ) { + PlayerIteration: + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose a creature type"); typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); while (!player.choose(Outcome.DestroyPermanent, typeChoice, game)) { if (!player.canRespond()) { - continue; + continue PlayerIteration; } } String chosenType = typeChoice.getChoice(); @@ -115,9 +116,8 @@ class HarshMercyEffect extends OneShotEffect { for (String type : chosenTypes) { filter.add(Predicates.not(new SubtypePredicate(type))); } - - return (new DestroyAllEffect(filter, true)).apply(game, source); + return new DestroyAllEffect(filter, true).apply(game, source); } return false; } From be485dc8109225155d09ae1da3925ce4984bc514 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 31 Aug 2015 17:06:22 +0200 Subject: [PATCH 51/63] Added a test. --- .../cards/abilities/keywords/PersistTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java index a5c8ac0099..f776867528 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/PersistTest.java @@ -198,4 +198,34 @@ public class PersistTest extends CardTestPlayerBase { assertPermanentCount(playerA, "Glen Elendra Archmage", 1); assertPowerToughness(playerA, "Glen Elendra Archmage", 1, 1); } + + @Test + public void testMeliraSylvokOutcast() { + + // You can't get poison counters. + // Creatures you control can't have -1/-1 counters placed on them. + // Creatures your opponents control lose infect. + addCard(Zone.BATTLEFIELD, playerA, "Melira, Sylvok Outcast", 1); // 2/2 + // When Murderous Redcap enters the battlefield, it deals damage equal to its power to target creature or player. + // Persist + addCard(Zone.HAND, playerA, "Murderous Redcap", 1); // 2/2 + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); + addCard(Zone.HAND, playerB, "Lightning Bolt", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Murderous Redcap"); + addTarget(playerA, "Silvercoat Lion"); + + setStopAt(1, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Lightning Bolt", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 2); + assertPowerToughness(playerA, "Murderous Redcap", 2, 2); // Got no -1/-1 after returning because of Melira in play + } } From 6979d2ce5ebb9ef31212596e44370b62e35c9a27 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 31 Aug 2015 17:07:43 +0200 Subject: [PATCH 52/63] * Momir Vig, Simic Visionary - Fixed, that the revealed card was wrongly moved to bottom of library if it's not creature instead of staying at top of library. --- .../dissension/MomirVigSimicVisionary.java | 57 +++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java index 0492eea149..8a23b3a442 100644 --- a/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java +++ b/Mage.Sets/src/mage/sets/dissension/MomirVigSimicVisionary.java @@ -27,20 +27,30 @@ */ package mage.sets.dissension; +import java.util.Set; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.ObjectColor; +import mage.abilities.Ability; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; +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.FilterSpell; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; import mage.target.common.TargetCardInLibrary; /** @@ -76,9 +86,7 @@ public class MomirVigSimicVisionary extends CardImpl { this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true)); // Whenever you cast a blue creature spell, reveal the top card of your library. If it's a creature card, put that card into your hand. - Effect effect2 = new RevealLibraryPutIntoHandEffect(1, new FilterCreatureCard(), false); - effect2.setText("reveal the top card of your library. If it's a creature card, put that card into your hand"); - this.addAbility(new SpellCastControllerTriggeredAbility(effect2, filter2, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new MomirVigSimicVisionaryEffect(), filter2, false)); } @@ -91,3 +99,44 @@ public class MomirVigSimicVisionary extends CardImpl { return new MomirVigSimicVisionary(this); } } + +class MomirVigSimicVisionaryEffect extends OneShotEffect { + + public MomirVigSimicVisionaryEffect() { + super(Outcome.DrawCard); + this.staticText = "reveal the top card of your library. If it's a creature card, put that card into your hand"; + } + + public MomirVigSimicVisionaryEffect(final MomirVigSimicVisionaryEffect effect) { + super(effect); + } + + @Override + public MomirVigSimicVisionaryEffect copy() { + return new MomirVigSimicVisionaryEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller == null || sourceObject == null) { + return false; + } + + CardsImpl cards = new CardsImpl(); + cards.addAll(controller.getLibrary().getTopCards(game, 1)); + controller.revealCards(sourceObject.getIdName(), cards, game); + + Set cardsList = cards.getCards(game); + Cards cardsToHand = new CardsImpl(); + for (Card card : cardsList) { + if (card.getCardType().contains(CardType.CREATURE)) { + cardsToHand.add(card); + cards.remove(card); + } + } + controller.moveCards(cardsToHand, null, Zone.HAND, source, game); + return true; + } +} From b4083a9110a79daa8d9eb78a140ce307224626db Mon Sep 17 00:00:00 2001 From: fireshoes Date: Mon, 31 Aug 2015 11:51:55 -0500 Subject: [PATCH 53/63] [BFZ] Added 8/31 spoilers and updated some collector numbers. --- .../battleforzendikar/DominatorDrone.java | 184 +++++++++--------- .../ForerunnerOfSlaughter.java | 104 +++++----- .../battleforzendikar/RetreatToKazandu.java | 2 +- .../battleforzendikar/VeteranWarleader.java | 2 +- Utils/mtg-cards-data.txt | 16 +- 5 files changed, 156 insertions(+), 152 deletions(-) diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java index 58ec8320c0..c577d070c3 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/DominatorDrone.java @@ -1,92 +1,92 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.battleforzendikar; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.TriggeredAbility; -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.common.DamagePlayersEffect; -import mage.abilities.keyword.DevoidAbility; -import mage.abilities.keyword.IngestAbility; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.constants.TargetController; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorlessPredicate; -import mage.filter.predicate.permanent.AnotherPredicate; - -/** - * - * @author LevelX2 - */ -public class DominatorDrone extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("another colorless creature"); - - static { - filter.add(new AnotherPredicate()); - filter.add(new ColorlessPredicate()); - } - - public DominatorDrone(UUID ownerId) { - super(ownerId, 997, "Dominator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); - this.expansionSetCode = "BFZ"; - this.subtype.add("Eldrazi"); - this.subtype.add("Drone"); - this.power = new MageInt(3); - this.toughness = new MageInt(2); - - // Devoid - this.addAbility(new DevoidAbility(this.color)); - - // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) - this.addAbility(new IngestAbility()); - - // When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life. - TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT)); - this.addAbility(new ConditionalTriggeredAbility( - triggeredAbility, - new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), - "When {this} enters the battlefield, if you control another colorless creature, each opponent loses 2 life.")); - - } - - public DominatorDrone(final DominatorDrone card) { - super(card); - } - - @Override - public DominatorDrone copy() { - return new DominatorDrone(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbility; +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.common.DamagePlayersEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.abilities.keyword.IngestAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LevelX2 + */ +public class DominatorDrone extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public DominatorDrone(UUID ownerId) { + super(ownerId, 92, "Dominator Drone", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.) + this.addAbility(new IngestAbility()); + + // When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life. + TriggeredAbility triggeredAbility = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT)); + this.addAbility(new ConditionalTriggeredAbility( + triggeredAbility, + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0), + "When {this} enters the battlefield, if you control another colorless creature, each opponent loses 2 life.")); + + } + + public DominatorDrone(final DominatorDrone card) { + super(card); + } + + @Override + public DominatorDrone copy() { + return new DominatorDrone(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java index a9f1dff920..45bdcdabc9 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/ForerunnerOfSlaughter.java @@ -1,52 +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.battleforzendikar; - -import java.util.UUID; - -/** - * - * @author LevelX2 - */ -public class ForerunnerOfSlaughter extends mage.sets.zendikarvseldrazi.ForerunnerOfSlaughter { - - public ForerunnerOfSlaughter(UUID ownerId) { - super(ownerId); - this.cardNumber = 998; - this.expansionSetCode = "BFZ"; - } - - public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { - super(card); - } - - @Override - public ForerunnerOfSlaughter copy() { - return new ForerunnerOfSlaughter(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.battleforzendikar; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class ForerunnerOfSlaughter extends mage.sets.zendikarvseldrazi.ForerunnerOfSlaughter { + + public ForerunnerOfSlaughter(UUID ownerId) { + super(ownerId); + this.cardNumber = 204; + this.expansionSetCode = "BFZ"; + } + + public ForerunnerOfSlaughter(final ForerunnerOfSlaughter card) { + super(card); + } + + @Override + public ForerunnerOfSlaughter copy() { + return new ForerunnerOfSlaughter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java index 9e6a22241c..8d767821c6 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToKazandu.java @@ -37,7 +37,7 @@ public class RetreatToKazandu extends mage.sets.zendikarvseldrazi.RetreatToKazan public RetreatToKazandu(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 186; this.expansionSetCode = "BFZ"; } diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java index d3c4b53ea7..e46455b609 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/VeteranWarleader.java @@ -37,7 +37,7 @@ public class VeteranWarleader extends mage.sets.zendikarvseldrazi.VeteranWarlead public VeteranWarleader(UUID ownerId) { super(ownerId); - this.cardNumber = 999; + this.cardNumber = 221; this.expansionSetCode = "BFZ"; } diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 572370bc00..104234f939 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27324,24 +27324,25 @@ Swamp|Duel Decks: Zendikar vs. Eldrazi|72|L||Basic Land - Swamp|||B| Mountain|Duel Decks: Zendikar vs. Eldrazi|73|L||Basic Land - Mountain|||M| Mountain|Duel Decks: Zendikar vs. Eldrazi|74|L||Basic Land - Mountain|||M| Mountain|Duel Decks: Zendikar vs. Eldrazi|75|L||Basic Land - Mountain|||M| -Sheer Drop|Battle for Zendikar|999|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| -Dominator Drone|Battle for Zendikar|999|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| -Retreat to Kazandu|Battle for Zendikar|999||U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| -Forerunner of Slaughter|Battle for Zendikar|999|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| -Veteran Warleader|Battle for Zendikar|999|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| -Oblivion Sower|Battle for Zendikar|999|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| Blight Herder|Battle for Zendikar|2|R|{5}|Creature - Eldrazi Processor|4|5|When you cast Blight Herder, you may put two cards your opponents own from exile into their owners' graveyards. If you do, put three 1/1 colorless Eldrazi Scion creature tokens onto the battlefield. They have "Sacrifice this creature: Add {1} to your mana pool."| +Breaker of Armies|Battle for Zendikar|3|U|{8}|Creature - Eldrazi|10|8|All creatures able to block Breaker of Armies do so.| Eldrazi Devastator|Battle for Zendikar|7|C|{8}|Creature - Eldrazi|8|9|Trample| Kozilek's Channeler|Battle for Zendikar|10|C|{5}|Creature - Eldrazi|4|4|{T}: Add {2} to your mana pool.| +Oblivion Sower|Battle for Zendikar|11|M|{6}|Creature - Eldrazi|5|8|When you cast Oblivion Sower, target opponent exiles the top four cards of his or her library, then you may put any number of land cards that player owns from exile onto the battlefield under your control.| Titan's Presence|Battle for Zendikar|14|U|{3}|Instant|||As an additional cost to cast Titan's Presence, reveal a colorless creature card from your hand.$Exile target creature if its power is less than or equal to the revealed card's power.| Ulamog, the Ceaseless Hunger|Battle for Zendikar|15|M|{10}|Legendary Creature - Eldrazi|10|10|When you cast Ulamog, the Ceaseless Hunger, exile two target permanents.$Indestructible$Whenever Ulamog attacks, defending player exiles the top twenty cards of his or her library.| Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice Felidar Cub: Destroy target enchantment.| Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|||+1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4|3|Rally - Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn.| +Retreat to Emeria|Battle for Zendikar|44|U|{3}{W}|Enchantment|||Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn.| +Sheer Drop|Battle for Zendikar|48|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| Incubator Drone|Battle for Zendikar|60|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| Mist Intruder|Battle for Zendikar|61|C|{1}{U}|Creature - Eldrazi Drone|1|2|Devoid (This card has no color.)$Flying$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)| +Coastal Discovery|Battle for Zendikar|73|U|{3}{U}|Sorcery|||Draw two cards.$Awaken 4 - {5}U} If you cast this spell for {5}{U}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| Guardian of Tazeem|Battle for Zendikar|78|R|{3}{U}{U}|Creature - Sphinx|4|5|Flying$Landfall - Whenever a land enters the battlefield under your control, tap target creature an opponent controls. If that land is an Island, that creature doesn't untap during its controller's next untap step.| +Dominator Drone|Battle for Zendikar|92|C|{2}{B}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)$Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)$When Dominator Drone enters the battlefield, if you control another colorless creature, each opponent loses 2 life.| +Skitterskin|Battle for Zendikar|97|U|{3}{B}|Creature - Eldrazi Drone|4|3|Devoid (This card has no color.)$Skitterskin can't block.${1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature.| Defiant Bloodlord|Battle for Zendikar|107|R|{5}{B}{B}|Creature - Vampire|4|5|Flying$Whenever you gain life, target opponent loses that much life.| Ruinous Path|Battle for Zendikar|123|R|{1}{B}{B}|Sorcery|||Destroy target creature or planeswalker.$Awaken 4-{5}{B}{B} (If you cast this spell for {5}{B}{B}, also put four +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| Barrage Tyrant|Battle for Zendikar|127|R|{4}{R}|Creature - Eldrazi|5|3|Devoid (This card has no color.)${2}{R}, Sacrifice another colorless creature: Barrage Tyrant deals damage equal to the sacrificed creature's power to target creature or player.| @@ -27349,7 +27350,10 @@ Radiant Flames|Battle for Zendikar|151|R|{2}{R}|Sorcery||Converge - Radia Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder deals X damage divided as you choose among any number of target creatures and/or players.| Nissa's Renewal|Battle for Zendikar|180|R|{5}{G}|Sorcery|||Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life.| Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| +Retreat to Kazandu|Battle for Zendikar|186||U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| +Forerunner of Slaughter|Battle for Zendikar|204|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| +Veteran Warleader|Battle for Zendikar|221|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| Hedron Archive|Battle for Zendikar|223|U|{4}|Artifact|||{T}: Add {2} to your mana pool.${2}, {T}, Sacrifice Hedron Archive: Draw two cards.| Canopy Vista|Battle for Zendikar|234|R||Land - Forest Plains|||Canopy Vista enters the battlefield tapped unless you control two or more basic lands.| Cinder Glade|Battle for Zendikar|235|R||Land - Mountain Forest|||Cinder Glade enters the battlefield tapped unless you control two or more basic lands.| From b1b3465bb4a0fe6aac4246dff2d909a7eeca8161 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Mon, 31 Aug 2015 13:49:29 -0500 Subject: [PATCH 54/63] [BFZ] Implemented Breaker of Armies, Skitterskin, and Retreat to Emeria. --- .../battleforzendikar/BreakerOfArmies.java | 65 ++++++++++++++ .../GideonAllyOfZendikar.java | 2 +- .../battleforzendikar/RetreatToEmeria.java | 81 +++++++++++++++++ .../sets/battleforzendikar/Skitterskin.java | 90 +++++++++++++++++++ 4 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.java new file mode 100644 index 0000000000..2ab9d9d736 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BreakerOfArmies.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.MustBeBlockedByAllSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author fireshoes + */ +public class BreakerOfArmies extends CardImpl { + + public BreakerOfArmies(UUID ownerId) { + super(ownerId, 3, "Breaker of Armies", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{8}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.power = new MageInt(10); + this.toughness = new MageInt(8); + + // All creatures able to block Breaker of Armies do so. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MustBeBlockedByAllSourceEffect(Duration.WhileOnBattlefield))); + } + + public BreakerOfArmies(final BreakerOfArmies card) { + super(card); + } + + @Override + public BreakerOfArmies copy() { + return new BreakerOfArmies(this); + } +} diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java index fca8342170..eb6e52d3e8 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/GideonAllyOfZendikar.java @@ -115,7 +115,7 @@ class GideonAllyOfZendikarToken extends Token { class KnightAllyToken extends Token { public KnightAllyToken() { - super("Knight Ally", "2/2 white Knight Ally creature"); + super("Knight Ally", "2/2 white Knight Ally creature token"); cardType.add(CardType.CREATURE); subtype.add("Knight"); subtype.add("Ally"); diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.java new file mode 100644 index 0000000000..6aa51bd4f3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/RetreatToEmeria.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.sets.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Mode; +import mage.abilities.common.LandfallAbility; +import mage.abilities.effects.common.CreateTokenEffect; +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.game.permanent.token.Token; + +/** + * + * @author fireshoes + */ +public class RetreatToEmeria extends CardImpl { + + public RetreatToEmeria(UUID ownerId) { + super(ownerId, 44, "Retreat to Emeria", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); + this.expansionSetCode = "BFZ"; + + // Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn. + LandfallAbility ability = new LandfallAbility(new CreateTokenEffect(new KorAllyToken()), false); + Mode mode = new Mode(); + mode.getEffects().add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); + ability.addMode(mode); + this.addAbility(ability); + } + + public RetreatToEmeria(final RetreatToEmeria card) { + super(card); + } + + @Override + public RetreatToEmeria copy() { + return new RetreatToEmeria(this); + } +} + +class KorAllyToken extends Token { + + public KorAllyToken() { + super("Kor Ally", "1/1 white Kor Ally creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Kor"); + subtype.add("Ally"); + color.setWhite(true); + power = new MageInt(1); + toughness = new MageInt(1); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.java new file mode 100644 index 0000000000..02439832d6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/Skitterskin.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.battleforzendikar; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.CantBlockAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.keyword.DevoidAbility; +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.mageobject.ColorlessPredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class Skitterskin extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("you control another colorless creature"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new ColorlessPredicate()); + } + + public Skitterskin(UUID ownerId) { + super(ownerId, 97, "Skitterskin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // Skitterskin can't block. + this.addAbility(new CantBlockAbility()); + + // {1}{B}: Regenerate Skitterskin. Activate this ability only if you control another colorless creature. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new RegenerateSourceEffect(), + new ManaCostsImpl("{1}{B}"), + new PermanentsOnTheBattlefieldCondition(filter)); + this.addAbility(ability); + } + + public Skitterskin(final Skitterskin card) { + super(card); + } + + @Override + public Skitterskin copy() { + return new Skitterskin(this); + } +} From 4da225475f1ef32788cc322aeda2e49d3fdd3dcf Mon Sep 17 00:00:00 2001 From: fireshoes Date: Mon, 31 Aug 2015 18:58:45 -0500 Subject: [PATCH 55/63] Changed some existing cards to use PermanentsOnTheBattlefieldCondition instead of adding a cost.[BFZ] Implemented Brood Butcher.[CSP] Implemented Heidar Rimewind Master, Rimewind Cryomancer, and Rimewind Taskmage.[LEG] Implemented Hyperion Blacksmith. --- .../sets/battleforzendikar/BroodButcher.java | 87 ++++++ .../championsofkamigawa/BloodthirstyOgre.java | 24 +- .../sets/coldsnap/HeidarRimewindMaster.java | 86 ++++++ .../sets/coldsnap/RimewindCryomancer.java | 85 ++++++ .../mage/sets/coldsnap/RimewindTaskmage.java | 85 ++++++ .../src/mage/sets/futuresight/NimbusMaze.java | 37 +-- .../mage/sets/innistrad/BloodlineKeeper.java | 237 +++++++-------- .../mage/sets/legends/HyperionBlacksmith.java | 79 +++++ .../sets/shadowmoor/LeechriddenSwamp.java | 271 ++++++++---------- .../sets/shadowmoor/MadblindMountain.java | 175 +++++------ .../mage/sets/shadowmoor/MoonringIsland.java | 179 ++++++------ .../mage/sets/shadowmoor/SapseepForest.java | 175 +++++------ .../permanent/token/EldraziScionToken.java | 2 +- Utils/mtg-cards-data.txt | 2 + 14 files changed, 957 insertions(+), 567 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java create mode 100644 Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java create mode 100644 Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java create mode 100644 Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java create mode 100644 Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.java new file mode 100644 index 0000000000..15f532eb8d --- /dev/null +++ b/Mage.Sets/src/mage/sets/battleforzendikar/BroodButcher.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.battleforzendikar; + +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.continuous.BoostTargetEffect; +import mage.abilities.keyword.DevoidAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.permanent.token.EldraziScionToken; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class BroodButcher extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature"); + + public BroodButcher(UUID ownerId) { + super(ownerId, 199, "Brood Butcher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{G}"); + this.expansionSetCode = "BFZ"; + this.subtype.add("Eldrazi"); + this.subtype.add("Drone"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Devoid + this.addAbility(new DevoidAbility(this.color)); + + // When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool." + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new EldraziScionToken()), false)); + + // {B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{B}{G}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public BroodButcher(final BroodButcher card) { + super(card); + } + + @Override + public BroodButcher copy() { + return new BroodButcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index ac0d7e7614..d1a0b5dda3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -28,14 +28,11 @@ package mage.sets.championsofkamigawa; 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.common.ActivateIfConditionActivatedAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.common.ControlPermanentCost; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; @@ -43,6 +40,10 @@ import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; 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.counters.CounterType; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -54,7 +55,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class BloodthirstyOgre extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control a Demon"); + static { filter.add(new SubtypePredicate("Demon")); } @@ -71,11 +73,13 @@ public class BloodthirstyOgre extends CardImpl { // {T}: Put a devotion counter on Bloodthirsty Ogre this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.DEVOTION.createInstance()),new TapSourceCost())); + // {T}: Target creature gets -X/-X until end of turn, where X is the number of devotion counters on Bloodthirsty Ogre. Activate this ability only if you control a Demon. DynamicValue devotionCounters = new SignInversionDynamicValue(new CountersCount(CounterType.DEVOTION)); - Ability ability; - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true),new TapSourceCost()); - ability.addCost(new ControlPermanentCost(filter)); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new BoostTargetEffect(devotionCounters,devotionCounters, Duration.EndOfTurn, true), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(filter)); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } @@ -87,6 +91,6 @@ public class BloodthirstyOgre extends CardImpl { @Override public BloodthirstyOgre copy() { return new BloodthirstyOgre(this); - } + } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.java new file mode 100644 index 0000000000..6011ac418d --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/HeidarRimewindMaster.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.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +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.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class HeidarRimewindMaster extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public HeidarRimewindMaster(UUID ownerId) { + super(ownerId, 36, "Heidar, Rimewind Master", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {2}, {tap}: Return target permanent to its owner's hand. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new ReturnToHandTargetEffect(), + new GenericManaCost(2), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public HeidarRimewindMaster(final HeidarRimewindMaster card) { + super(card); + } + + @Override + public HeidarRimewindMaster copy() { + return new HeidarRimewindMaster(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.java new file mode 100644 index 0000000000..41775a35a3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindCryomancer.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.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.CounterTargetEffect; +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.SupertypePredicate; +import mage.target.common.TargetActivatedAbility; + +/** + * + * @author fireshoes + */ +public class RimewindCryomancer extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindCryomancer(UUID ownerId) { + super(ownerId, 43, "Rimewind Cryomancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {1}, {tap}: Counter target activated ability. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new CounterTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetActivatedAbility()); + this.addAbility(ability); + } + + public RimewindCryomancer(final RimewindCryomancer card) { + super(card); + } + + @Override + public RimewindCryomancer copy() { + return new RimewindCryomancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.java new file mode 100644 index 0000000000..420ca2ecc6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimewindTaskmage.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.coldsnap; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.MayTapOrUntapTargetEffect; +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.SupertypePredicate; +import mage.target.TargetPermanent; + +/** + * + * @author fireshoes + */ +public class RimewindTaskmage extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control four or more snow permanents"); + + static { + filter.add(new SupertypePredicate("Snow")); + } + + public RimewindTaskmage(UUID ownerId) { + super(ownerId, 44, "Rimewind Taskmage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "CSP"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {1}, {tap}: You may tap or untap target permanent. Activate this ability only if you control four or more snow permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new MayTapOrUntapTargetEffect(), + new GenericManaCost(1), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 3)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + } + + public RimewindTaskmage(final RimewindTaskmage card) { + super(card); + } + + @Override + public RimewindTaskmage copy() { + return new RimewindTaskmage(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java index a5c250207e..75026f82f2 100644 --- a/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java +++ b/Mage.Sets/src/mage/sets/futuresight/NimbusMaze.java @@ -28,20 +28,21 @@ package mage.sets.futuresight; import java.util.UUID; - +import mage.Mana; import mage.abilities.Ability; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.costs.CostImpl; -import mage.abilities.mana.BlueManaAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.ActivateIfConditionManaAbility; import mage.abilities.mana.ColorlessManaAbility; -import mage.abilities.mana.WhiteManaAbility; 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.mageobject.CardTypePredicate; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; /** @@ -50,14 +51,12 @@ import mage.game.Game; */ public class NimbusMaze extends CardImpl { - private static final FilterPermanent controlIsland = new FilterPermanent("you control an Island"); - private static final FilterPermanent controlPlains = new FilterPermanent("you control a Plains"); + private static final FilterControlledPermanent controlIsland = new FilterControlledPermanent("you control an Island"); + private static final FilterControlledPermanent controlPlains = new FilterControlledPermanent("you control a Plains"); + static { controlIsland.add(new SubtypePredicate("Island")); - controlIsland.add(new ControllerPredicate(TargetController.YOU)); - controlPlains.add(new SubtypePredicate("Plains")); - controlPlains.add(new ControllerPredicate(TargetController.YOU)); } public NimbusMaze(UUID ownerId) { @@ -67,13 +66,17 @@ public class NimbusMaze extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); // {tap}: Add {W} to your mana pool. Activate this ability only if you control an Island. - Ability addW = new WhiteManaAbility(); - addW.addCost(new FilterPermanentCost(controlIsland)); - this.addAbility(addW); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.WhiteMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlIsland))); // {tap}: Add {U} to your mana pool. Activate this ability only if you control a Plains. - Ability addU = new BlueManaAbility(); - addU.addCost(new FilterPermanentCost(controlPlains)); - this.addAbility(addU); + this.addAbility(new ActivateIfConditionManaAbility( + Zone.BATTLEFIELD, + new BasicManaEffect(Mana.BlueMana), + new TapSourceCost(), + new PermanentsOnTheBattlefieldCondition(controlPlains))); } public NimbusMaze(final NimbusMaze card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index 94a3961d9d..90391f49bf 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -1,131 +1,106 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.innistrad; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ColoredManaCost; -import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.effects.common.TransformSourceEffect; -import mage.abilities.keyword.FlyingAbility; -import mage.abilities.keyword.TransformAbility; -import mage.cards.CardImpl; -import mage.constants.ColoredManaSymbol; -import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.Game; -import mage.game.permanent.token.Token; - -/** - * - * @author Loki - */ -public class BloodlineKeeper extends CardImpl { - - public BloodlineKeeper(UUID ownerId) { - super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); - this.expansionSetCode = "ISD"; - this.subtype.add("Vampire"); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - - this.canTransform = true; - this.secondSideCard = new LordOfLineage(ownerId); - - this.addAbility(FlyingAbility.getInstance()); - // {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()); - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ColoredManaCost(ColoredManaSymbol.B)); - ability.addCost(new ControlFiveVampiresCost()); - this.addAbility(ability); - } - - public BloodlineKeeper(final BloodlineKeeper card) { - super(card); - } - - @Override - public BloodlineKeeper copy() { - return new BloodlineKeeper(this); - } -} - -class VampireToken extends Token { - VampireToken() { - super("Vampire", "a 2/2 black Vampire creature token with flying"); - cardType.add(CardType.CREATURE); - color.setBlack(true); - subtype.add("Vampire"); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(FlyingAbility.getInstance()); - } -} - -class ControlFiveVampiresCost extends CostImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - - static { - filter.add(new SubtypePredicate("Vampire")); - } - - public ControlFiveVampiresCost() { - this.text = "Activate this ability only if you control five or more Vampires"; - } - - public ControlFiveVampiresCost(final ControlFiveVampiresCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 5, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlFiveVampiresCost copy() { - return new ControlFiveVampiresCost(this); - } -} \ No newline at end of file +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.innistrad; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TransformSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TransformAbility; +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.SubtypePredicate; +import mage.game.permanent.token.Token; + +/** + * + * @author Loki + */ +public class BloodlineKeeper extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control five or more Vampires"); + + static { + filter.add(new SubtypePredicate("Vampire")); + } + + public BloodlineKeeper(UUID ownerId) { + super(ownerId, 90, "Bloodline Keeper", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "ISD"; + this.subtype.add("Vampire"); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + this.canTransform = true; + this.secondSideCard = new LordOfLineage(ownerId); + + this.addAbility(FlyingAbility.getInstance()); + // {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()); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new TransformSourceEffect(true), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 4)); + this.addAbility(ability); + } + + public BloodlineKeeper(final BloodlineKeeper card) { + super(card); + } + + @Override + public BloodlineKeeper copy() { + return new BloodlineKeeper(this); + } +} + +class VampireToken extends Token { + VampireToken() { + super("Vampire", "a 2/2 black Vampire creature token with flying"); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add("Vampire"); + power = new MageInt(2); + toughness = new MageInt(2); + addAbility(FlyingAbility.getInstance()); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.java new file mode 100644 index 0000000000..6eca10aafc --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/HyperionBlacksmith.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.legends; + +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.MayTapOrUntapTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetArtifactPermanent; + +/** + * + * @author fireshoes + */ +public class HyperionBlacksmith extends CardImpl { + + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public HyperionBlacksmith(UUID ownerId) { + super(ownerId, 150, "Hyperion Blacksmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Human"); + this.subtype.add("Artificer"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {tap}: You may tap or untap target artifact an opponent controls. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MayTapOrUntapTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetArtifactPermanent(filter)); + this.addAbility(ability); + } + + public HyperionBlacksmith(final HyperionBlacksmith card) { + super(card); + } + + @Override + public HyperionBlacksmith copy() { + return new HyperionBlacksmith(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index fdbce5bbd6..900fb98760 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -1,148 +1,123 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.Mana; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.costs.CostImpl; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.mana.SimpleManaAbility; -import mage.cards.CardImpl; -import mage.constants.Zone; -import mage.filter.common.FilterControlledPermanent; -import mage.filter.predicate.mageobject.ColorPredicate; -import mage.game.Game; -import mage.players.Player; -import mage.players.Players; - -/** - * - * @author jeffwadsworth - */ -public class LeechriddenSwamp extends CardImpl { - - public LeechriddenSwamp(UUID ownerId) { - super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Swamp"); - - // ({tap}: Add {B} to your mana pool.) - this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); - - // Leechridden Swamp enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LeechriddenSwampLoseLifeEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new TapSourceCost()); - ability.addCost(new ControlTwoOrMoreBlackPermanentsCost()); - this.addAbility(ability); - } - - public LeechriddenSwamp(final LeechriddenSwamp card) { - super(card); - } - - @Override - public LeechriddenSwamp copy() { - return new LeechriddenSwamp(this); - } -} - -class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); - - static { - filter.add(new ColorPredicate(ObjectColor.BLACK)); - } - - public ControlTwoOrMoreBlackPermanentsCost() { - this.text = "Activate this ability only if you control two or more black permanents"; - } - - public ControlTwoOrMoreBlackPermanentsCost(final ControlTwoOrMoreBlackPermanentsCost cost) { - super(cost); - } - - @Override - public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - return game.getBattlefield().contains(filter, controllerId, 2, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public ControlTwoOrMoreBlackPermanentsCost copy() { - return new ControlTwoOrMoreBlackPermanentsCost(this); - } -} - -class LeechriddenSwampLoseLifeEffect extends OneShotEffect { - - private static final String effectText = "each opponent loses 1 life"; - - LeechriddenSwampLoseLifeEffect ( ) { - super(Outcome.Damage); - staticText = effectText; - } - - LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Players players = game.getPlayers(); - for ( Player player : players.values() ) { - if ( !player.getId().equals(source.getControllerId()) ) { - player.loseLife(1, game); - } - } - return true; - } - - @Override - public LeechriddenSwampLoseLifeEffect copy() { - return new LeechriddenSwampLoseLifeEffect(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.Mana; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.ActivateIfConditionActivatedAbility; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.players.Players; + +/** + * + * @author jeffwadsworth + */ +public class LeechriddenSwamp extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("you control two or more black permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLACK)); + } + + public LeechriddenSwamp(UUID ownerId) { + super(ownerId, 273, "Leechridden Swamp", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Swamp"); + + // ({tap}: Add {B} to your mana pool.) + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.BlackMana, new TapSourceCost())); + + // Leechridden Swamp enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {B}, {tap}: Each opponent loses 1 life. Activate this ability only if you control two or more black permanents. + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, + new LeechriddenSwampLoseLifeEffect(), + new ManaCostsImpl("{B}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public LeechriddenSwamp(final LeechriddenSwamp card) { + super(card); + } + + @Override + public LeechriddenSwamp copy() { + return new LeechriddenSwamp(this); + } +} + +class LeechriddenSwampLoseLifeEffect extends OneShotEffect { + + private static final String effectText = "each opponent loses 1 life"; + + LeechriddenSwampLoseLifeEffect ( ) { + super(Outcome.Damage); + staticText = effectText; + } + + LeechriddenSwampLoseLifeEffect ( LeechriddenSwampLoseLifeEffect effect ) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Players players = game.getPlayers(); + for ( Player player : players.values() ) { + if ( !player.getId().equals(source.getControllerId()) ) { + player.loseLife(1, game); + } + } + return true; + } + + @Override + public LeechriddenSwampLoseLifeEffect copy() { + return new LeechriddenSwampLoseLifeEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java index eb94b65c28..b106cfe9c9 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MadblindMountain.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.ShuffleLibrarySourceEffect; -import mage.abilities.mana.RedManaAbility; -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.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class MadblindMountain extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.RED)); - } - - public MadblindMountain(UUID ownerId) { - super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Mountain"); - - // ({tap}: Add {R} to your mana pool.) - this.addAbility(new RedManaAbility()); - - // Madblind Mountain enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new ShuffleLibrarySourceEffect(), new ManaCostsImpl("{R}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public MadblindMountain(final MadblindMountain card) { - super(card); - } - - @Override - public MadblindMountain copy() { - return new MadblindMountain(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.ShuffleLibrarySourceEffect; +import mage.abilities.mana.RedManaAbility; +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.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class MadblindMountain extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more red permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.RED)); + } + + public MadblindMountain(UUID ownerId) { + super(ownerId, 274, "Madblind Mountain", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Mountain"); + + // ({tap}: Add {R} to your mana pool.) + this.addAbility(new RedManaAbility()); + + // Madblind Mountain enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {R}, {tap}: Shuffle your library. Activate this ability only if you control two or more red permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new ShuffleLibrarySourceEffect(), + new ManaCostsImpl("{R}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public MadblindMountain(final MadblindMountain card) { + super(card); + } + + @Override + public MadblindMountain copy() { + return new MadblindMountain(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java index 4f087d879c..4dc1458dcb 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MoonringIsland.java @@ -1,88 +1,91 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; -import mage.abilities.mana.BlueManaAbility; -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.ColorPredicate; -import mage.target.TargetPlayer; - -/** - * - * @author jeffwadsworth - */ -public class MoonringIsland extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.BLUE)); - } - - public MoonringIsland(UUID ownerId) { - super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Island"); - - // ({tap}: Add {U} to your mana pool.) - this.addAbility(new BlueManaAbility()); - - // Moonring Island enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new LookLibraryTopCardTargetPlayerEffect(), new ManaCostsImpl("{U}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetPlayer()); - this.addAbility(ability); - - } - - public MoonringIsland(final MoonringIsland card) { - super(card); - } - - @Override - public MoonringIsland copy() { - return new MoonringIsland(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect; +import mage.abilities.mana.BlueManaAbility; +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.ColorPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author jeffwadsworth + */ +public class MoonringIsland extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more blue permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.BLUE)); + } + + public MoonringIsland(UUID ownerId) { + super(ownerId, 276, "Moonring Island", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Island"); + + // ({tap}: Add {U} to your mana pool.) + this.addAbility(new BlueManaAbility()); + + // Moonring Island enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {U}, {tap}: Look at the top card of target player's library. Activate this ability only if you control two or more blue permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new LookLibraryTopCardTargetPlayerEffect(), + new ManaCostsImpl("{U}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + + } + + public MoonringIsland(final MoonringIsland card) { + super(card); + } + + @Override + public MoonringIsland copy() { + return new MoonringIsland(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java index 9ae7bb434c..96f78b9329 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SapseepForest.java @@ -1,86 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.shadowmoor; - -import java.util.UUID; -import mage.ObjectColor; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTappedAbility; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalActivatedAbility; -import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.mana.GreenManaAbility; -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.ColorPredicate; - -/** - * - * @author jeffwadsworth - */ -public class SapseepForest extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); - - static { - filter.add(new ColorPredicate(ObjectColor.GREEN)); - } - - public SapseepForest(UUID ownerId) { - super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); - this.expansionSetCode = "SHM"; - this.subtype.add("Forest"); - - // ({tap}: Add {G} to your mana pool.) - this.addAbility(new GreenManaAbility()); - - // Sapseep Forest enters the battlefield tapped. - this.addAbility(new EntersBattlefieldTappedAbility()); - - // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. - Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), new ManaCostsImpl("{G}"), new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); - ability.addCost(new TapSourceCost()); - this.addAbility(ability); - - } - - public SapseepForest(final SapseepForest card) { - super(card); - } - - @Override - public SapseepForest copy() { - return new SapseepForest(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.shadowmoor; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.mana.GreenManaAbility; +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.ColorPredicate; + +/** + * + * @author jeffwadsworth + */ +public class SapseepForest extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("if you control two or more green permanents"); + + static { + filter.add(new ColorPredicate(ObjectColor.GREEN)); + } + + public SapseepForest(UUID ownerId) { + super(ownerId, 279, "Sapseep Forest", Rarity.UNCOMMON, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "SHM"; + this.subtype.add("Forest"); + + // ({tap}: Add {G} to your mana pool.) + this.addAbility(new GreenManaAbility()); + + // Sapseep Forest enters the battlefield tapped. + this.addAbility(new EntersBattlefieldTappedAbility()); + + // {G}, {tap}: You gain 1 life. Activate this ability only if you control two or more green permanents. + Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, + new GainLifeEffect(1), + new ManaCostsImpl("{G}"), + new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 1)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + + } + + public SapseepForest(final SapseepForest card) { + super(card); + } + + @Override + public SapseepForest copy() { + return new SapseepForest(this); + } +} diff --git a/Mage/src/mage/game/permanent/token/EldraziScionToken.java b/Mage/src/mage/game/permanent/token/EldraziScionToken.java index 90074e28aa..1b8e1cd6a7 100644 --- a/Mage/src/mage/game/permanent/token/EldraziScionToken.java +++ b/Mage/src/mage/game/permanent/token/EldraziScionToken.java @@ -42,7 +42,7 @@ import mage.constants.Zone; public class EldraziScionToken extends Token { public EldraziScionToken() { - super("Eldrazi Scion", "1/1 colorless Eldrazi Scion creature with \"Sacrifice this creature: Add {1} to your mana pool.\""); + super("Eldrazi Scion", "1/1 colorless Eldrazi Scion creature token with \"Sacrifice this creature: Add {1} to your mana pool.\""); cardType.add(CardType.CREATURE); subtype.add("Eldrazi"); subtype.add("Scion"); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 104234f939..21372f8ee9 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -27335,6 +27335,7 @@ Felidar Cub|Battle for Zendikar|25|C|{1}{W}|Creature - Cat Beast|2|2|Sacrifice F Gideon, Ally of Zendikar|Battle for Zendikar|29|M|{2}{W}{W}|Planeswalker - Gideon|||+1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.$0: Put a 2/2 white Knight Ally creature token onto the battlefield.$-4: You get an emblem with "Creatures you control get +1/+1."| Gideon's Reproach|Battle for Zendikar|30|C|{1}{W}|Instant|||Gideon's Reproach deals 4 damage to target attacking or blocking creature.| Hero of Goma Fada|Battle for Zendikar|31|R|{4}{W}|Creature - Human Knight Ally|4|3|Rally - Whenever Hero of Goma Fada or another Ally enters the battlefield under your control, creatures you control gain indestructible until end of turn.| +Lantern Scout|Battle for Zendikar|37|R|{2}{W}|Creature - Human Scout Ally|3|2|Rally - Whenever Lantern Scout or another Ally enters the battlefield under your control, creatures you control gain lifelink until end of turn.| Retreat to Emeria|Battle for Zendikar|44|U|{3}{W}|Enchantment|||Landfall - Whenever a land enters the battlefield under you control, choose one - Put a 1/1 white Kor Ally creature token onto the battlefield; or Creatures you control get +1/+1 until end of turn.| Sheer Drop|Battle for Zendikar|48|C|{2}{W}|Sorcery|||Destroy target tapped creature.$Awaken 3-{5}{W} (If you cast this spell for {5}{W}, also put three +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)| Incubator Drone|Battle for Zendikar|60|C|{3}{U}|Creature - Eldrazi Drone|2|3|Devoid (This card has no color.)$Whenever Incubator Drone enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."| @@ -27351,6 +27352,7 @@ Rolling Thunder|Battle for Zendikar|154|U|{X}{R}{R}|Sorcery|||Rolling Thunder de Nissa's Renewal|Battle for Zendikar|180|R|{5}{G}|Sorcery|||Search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. You gain 7 life.| Oran-Rief Hydra|Battle for Zendikar|181|R|{4}{G}{G}|Creature - Hydra|5|5|Trample$Landfall - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.| Retreat to Kazandu|Battle for Zendikar|186||U|{2}{G}|Enchantment|||Landfall-Whenever a land enters the battlefield under your control, choose one - Put a +1/+1 counter on target creature; or You gain 2 life.| +Brood Butcher|Battle for Zendikar|199|R|{3}{B}{G}|Creature - Eldrazi Drone|3|3|Devoid (This card has no color.)$When Brood Butcher enters the battlefield, put a 1/1 colorless Eldrazi Scion creature token onto the battlefield. It has "Sacrifice this creature: Add {1} to your mana pool."${B}{G}, Sacrifice a creature: Target creature gets -2/-2 until end of turn.| Forerunner of Slaughter|Battle for Zendikar|204|U|{B}{R}|Creature - Eldrazi Drone|3|2|Devoid (This card has no color.)${1}: Target colorless creature gains haste until end of turn.| Omnath, Locus of Rage|Battle for Zendikar|217|M|{3}{R}{R}{G}{G}|Legendary Creature - Elemental|5|5|Landfall - Whenever a land enters the battlefield under your control, put a 5/5 red and green Elemental creature token onto the battlefield.$Whenever Omnath, Locus of Rage or another Elemental you control dies, Omnath deals 3 damage to target creature or player.| Veteran Warleader|Battle for Zendikar|221|R|{1}{G}{W}|Creature - Human Soldier Ally|0|0|Veteran Warleader's power and toughness are each equal to the number of creatures you control.$Tap another untapped Ally you control: Veteran Warleader gains your choice of first strike, vigilance, or trample until end of turn.| From 545b0c8fc5674b3f3f9846d1719d160e56219426 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Mon, 31 Aug 2015 22:37:42 -0500 Subject: [PATCH 56/63] [CSP] Implemented Legions of Lim-Dul and Rime Transfusion. --- .../mage/sets/coldsnap/RimeTransfusion.java | 97 ++++++++++ .../src/mage/sets/iceage/LegionsOfLimDul.java | 72 +++++++ .../sets/returntoravnica/DeviantGlee.java | 176 +++++++++--------- 3 files changed, 257 insertions(+), 88 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java create mode 100644 Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java diff --git a/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.java new file mode 100644 index 0000000000..8bef2a6f1e --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/RimeTransfusion.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 mage.sets.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleEvasionAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +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.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author fireshoes + */ +public class RimeTransfusion extends CardImpl { + + static final String rule = "and has \"{snow}: This creature can't be blocked this turn except by snow creatures.\""; + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by snow creatures until end of turn"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Snow"))); + } + + public RimeTransfusion(UUID ownerId) { + super(ownerId, 68, "Rime Transfusion", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "CSP"; + this.supertype.add("Snow"); + 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 +2/+1 and has "{snow}: This creature can't be blocked this turn except by snow creatures." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.EndOfTurn))),new ManaCostsImpl("{snow}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public RimeTransfusion(final RimeTransfusion card) { + super(card); + } + + @Override + public RimeTransfusion copy() { + return new RimeTransfusion(this); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.java new file mode 100644 index 0000000000..9a72158927 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/LegionsOfLimDul.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.keyword.LandwalkAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; + +/** + * + * @author fireshoes + */ +public class LegionsOfLimDul extends CardImpl { + + private static final FilterLandPermanent filter = new FilterLandPermanent("snow swamp"); + + static { + filter.add(new SupertypePredicate("Snow")); + filter.add(new SubtypePredicate("Swamp")); + } + + public LegionsOfLimDul(UUID ownerId) { + super(ownerId, 30, "Legions of Lim-Dul", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Snow swampwalk + this.addAbility(new LandwalkAbility(filter)); + } + + public LegionsOfLimDul(final LegionsOfLimDul card) { + super(card); + } + + @Override + public LegionsOfLimDul copy() { + return new LegionsOfLimDul(this); + } +} diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java index 8aaa3abe55..2470858d5d 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/DeviantGlee.java @@ -1,88 +1,88 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.sets.returntoravnica; - -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.common.SimpleActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.BoostEnchantedEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.TrampleAbility; -import mage.cards.CardImpl; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class DeviantGlee extends CardImpl { - - static final String rule = "and has \"{R}: This creature gains trample until end of turn"; - - public DeviantGlee (UUID ownerId) { - super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); - this.expansionSetCode = "RTR"; - this.subtype.add("Aura"); - this.color.setBlack(true); - - // 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 +2/+1 and has "{R}: This creature gains trample until end of turn." - SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); - Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); - ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); - this.addAbility(ability2); - } - - public DeviantGlee (final DeviantGlee card) { - super(card); - } - - @Override - public DeviantGlee copy() { - return new DeviantGlee(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ + +package mage.sets.returntoravnica; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.TrampleAbility; +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 LevelX2 + */ +public class DeviantGlee extends CardImpl { + + static final String rule = "and has \"{R}: This creature gains trample until end of turn.\""; + + public DeviantGlee (UUID ownerId) { + super(ownerId, 65, "Deviant Glee", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + this.expansionSetCode = "RTR"; + this.subtype.add("Aura"); + this.color.setBlack(true); + + // 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 +2/+1 and has "{R}: This creature gains trample until end of turn." + SimpleStaticAbility ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 1, Duration.WhileOnBattlefield)); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn),new ManaCostsImpl("{R}")); + ability2.addEffect(new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, rule)); + this.addAbility(ability2); + } + + public DeviantGlee (final DeviantGlee card) { + super(card); + } + + @Override + public DeviantGlee copy() { + return new DeviantGlee(this); + } +} From e0d9678b99243a2a4202202ff440ff4c16a30b4b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 11:22:04 +0200 Subject: [PATCH 57/63] * Fixed split card handling in deck editor. --- Mage/src/mage/cards/mock/MockSplitCard.java | 4 +- .../mage/cards/mock/MockSplitCardHalf.java | 58 +++++++++++++++++++ Mage/src/mage/filter/FilterCard.java | 27 +++++---- 3 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 Mage/src/mage/cards/mock/MockSplitCardHalf.java diff --git a/Mage/src/mage/cards/mock/MockSplitCard.java b/Mage/src/mage/cards/mock/MockSplitCard.java index 3eb271bdad..e1c03601f4 100644 --- a/Mage/src/mage/cards/mock/MockSplitCard.java +++ b/Mage/src/mage/cards/mock/MockSplitCard.java @@ -51,12 +51,12 @@ public class MockSplitCard extends SplitCard { CardInfo leftHalf = CardRepository.instance.findCard(getLeftHalfName(card)); if (leftHalf != null) { - this.leftHalfCard = new MockCard(leftHalf); + this.leftHalfCard = new MockSplitCardHalf(leftHalf); } CardInfo rightHalf = CardRepository.instance.findCard(getRightHalfName(card)); if (rightHalf != null) { - this.rightHalfCard = new MockCard(rightHalf); + this.rightHalfCard = new MockSplitCardHalf(rightHalf); } } diff --git a/Mage/src/mage/cards/mock/MockSplitCardHalf.java b/Mage/src/mage/cards/mock/MockSplitCardHalf.java new file mode 100644 index 0000000000..4eefd3d0b1 --- /dev/null +++ b/Mage/src/mage/cards/mock/MockSplitCardHalf.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.cards.mock; + +import mage.cards.SplitCard; +import mage.cards.SplitCardHalf; +import mage.cards.repository.CardInfo; + +/** + * + * @author LevelX2 + */ +public class MockSplitCardHalf extends MockCard implements SplitCardHalf { + + public MockSplitCardHalf(CardInfo card) { + super(card); + } + + public MockSplitCardHalf(final MockSplitCardHalf card) { + super(card); + } + + @Override + public MockSplitCardHalf copy() { + return new MockSplitCardHalf(this); + } + + @Override + public void setParentCard(SplitCard card) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/Mage/src/mage/filter/FilterCard.java b/Mage/src/mage/filter/FilterCard.java index 97cb529a05..2995a69318 100644 --- a/Mage/src/mage/filter/FilterCard.java +++ b/Mage/src/mage/filter/FilterCard.java @@ -64,30 +64,29 @@ public class FilterCard extends FilterObject { } //20130711 708.6c - /* If anything performs a comparison involving multiple characteristics or - * values of one or more split cards in any zone other than the stack or - * involving multiple characteristics or values of one or more fused split - * spells, each characteristic or value is compared separately. If each of - * the individual comparisons would return a “yes” answer, the whole + /* If anything performs a comparison involving multiple characteristics or + * values of one or more split cards in any zone other than the stack or + * involving multiple characteristics or values of one or more fused split + * spells, each characteristic or value is compared separately. If each of + * the individual comparisons would return a “yes” answer, the whole * comparison returns a “yes” answer. The individual comparisons may involve * different halves of the same split card. */ - @Override public boolean match(Card card, Game game) { - if(card.isSplitCard()){ - return super.match(((SplitCard)card).getLeftHalfCard(), game) || - super.match(((SplitCard)card).getRightHalfCard(), game); - } - else{ - return super.match(card, game); + if (card.isSplitCard()) { + return super.match(((SplitCard) card).getLeftHalfCard(), game) + || super.match(((SplitCard) card).getRightHalfCard(), game); + } else { + return super.match(card, game); } } + public boolean match(Card card, UUID playerId, Game game) { if (!this.match(card, game)) { return false; } - + return Predicates.and(extraPredicates).apply(new ObjectPlayer(card, playerId), game); } @@ -111,7 +110,7 @@ public class FilterCard extends FilterObject { } return filtered; } - + public boolean hasPredicates() { return predicates.size() > 0; } From 1213fd22c871bbe8ea7ebdce92b3383434740f25 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 17:34:21 +0200 Subject: [PATCH 58/63] * Followed Footsteps - Fixed that the token copy was not working correctly if the target was already copying something (e.g. a Cryptoplasm). --- .../mage/sets/ravnica/FollowedFootsteps.java | 14 ++++---- .../mage/test/cards/copy/CryptoplasmTest.java | 36 +++++++++++++++++++ .../util/functions/CopyTokenFunction.java | 18 +++++----- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java index 4ab45ecce4..76703050bb 100644 --- a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java +++ b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java @@ -30,8 +30,10 @@ package mage.sets.ravnica; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.constants.CardType; @@ -40,15 +42,14 @@ 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; +import mage.target.targetpointer.FixedTarget; /** * * @author LoneFox - + * */ public class FollowedFootsteps extends CardImpl { @@ -99,10 +100,9 @@ class FollowedFootstepsEffect extends OneShotEffect { 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; + Effect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); + effect.setTargetPointer(new FixedTarget(enchantment.getAttachedTo())); + return effect.apply(game, source); } return false; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java index 1242402d45..1f8926e2cf 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java @@ -19,4 +19,40 @@ public class CryptoplasmTest extends CardTestPlayerBase { assertLife(playerB, 20); assertPermanentCount(playerA, "Craw Wurm", 2); } + + /** + * I have a Cryptoplasm in play, currently copying a Sigiled Paladin, and I + * enchant it with a Followed Footsteps. Next turn the aura triggers (the + * Crypto is still copying the same creature) and places a token on the + * battlefield, except the token is an untransformed Cryptoplasm, when it + * should be a Sigiled Paladin with Cryptoplasm's ability (as per rule + * 706.3), since that's what the enchanted creature currently is. + * + * 6/1/2011 If another creature becomes a copy of Cryptoplasm, it will + * become a copy of whatever Cryptoplasm is currently copying (if anything), + * plus it will have Cryptoplasm's triggered ability. + */ + @Test + public void testFollowedFootsteps() { + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Sigiled Paladin", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // Enchant creature + // At the beginning of your upkeep, put a token that's a copy of enchanted creature onto the battlefield. + addCard(Zone.HAND, playerB, "Followed Footsteps", 1); // {3}{U}{U} + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 1); // {1}{U}{U} + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Followed Footsteps"); + addTarget(playerB, "Sigiled Paladin[only copy]"); + + setStopAt(4, PhaseStep.END_TURN); + execute(); + + assertPermanentCount(playerB, "Followed Footsteps", 1); + assertPermanentCount(playerB, "Cryptoplasm", 0); + assertPermanentCount(playerB, "Sigiled Paladin", 2); + } } diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java index 001c818820..0c1e2957d0 100644 --- a/Mage/src/mage/util/functions/CopyTokenFunction.java +++ b/Mage/src/mage/util/functions/CopyTokenFunction.java @@ -61,24 +61,24 @@ public class CopyTokenFunction implements Function { if (source instanceof PermanentToken) { sourceObj = ((PermanentToken) source).getToken(); // to show the source image, the original values have to be used - target.setOriginalExpansionSetCode(((Token)sourceObj).getOriginalExpansionSetCode()); - target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber()); - target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard()); + target.setOriginalExpansionSetCode(((Token) sourceObj).getOriginalExpansionSetCode()); + target.setOriginalCardNumber(((Token) sourceObj).getOriginalCardNumber()); + target.setCopySourceCard(((PermanentToken) source).getToken().getCopySourceCard()); } else if (source instanceof PermanentCard) { - if (((PermanentCard)source).isMorphed() || ((PermanentCard)source).isManifested()) { + if (((PermanentCard) source).isMorphed() || ((PermanentCard) source).isManifested()) { MorphAbility.setPermanentToFaceDownCreature(target); return target; } else { - sourceObj = ((PermanentCard) source).getCard(); - target.setOriginalExpansionSetCode(source.getExpansionSetCode()); - target.setOriginalCardNumber(source.getCardNumber()); - target.setCopySourceCard((Card)sourceObj); + sourceObj = ((PermanentCard) source).getCard(); + target.setOriginalExpansionSetCode(source.getExpansionSetCode()); + target.setOriginalCardNumber(source.getCardNumber()); + target.setCopySourceCard((Card) sourceObj); } } else { target.setOriginalExpansionSetCode(source.getExpansionSetCode()); target.setOriginalCardNumber(source.getCardNumber()); if (source instanceof Card) { - target.setCopySourceCard((Card)source); + target.setCopySourceCard((Card) source); } } From df4dfc16d7ebc85439fbc474172d3f2a4dcc65ac Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 21:39:34 +0200 Subject: [PATCH 59/63] * Cipher - Fixed that the selection of the creature was handled targeted (e.g. checking for protection) fixes #1240). --- .../effects/common/CipherEffect.java | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/Mage/src/mage/abilities/effects/common/CipherEffect.java b/Mage/src/mage/abilities/effects/common/CipherEffect.java index d4bbdb20a2..89e6b39112 100644 --- a/Mage/src/mage/abilities/effects/common/CipherEffect.java +++ b/Mage/src/mage/abilities/effects/common/CipherEffect.java @@ -28,8 +28,6 @@ package mage.abilities.effects.common; import java.util.UUID; -import mage.constants.Duration; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -38,6 +36,9 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.cards.Card; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -46,37 +47,37 @@ import mage.target.targetpointer.FixedTarget; /** * FAQ 2013/01/11 - * + * * 702.97. Cipher * - * 702.97a Cipher appears on some instants and sorceries. It represents two static - * abilities, one that functions while the spell is on the stack and one that functions - * while the card with cipher is in the exile zone. "Cipher" means "If this spell is - * represented by a card, you may exile this card encoded on a creature you control" - * and "As long as this card is encoded on that creature, that creature has 'Whenever - * this creature deals combat damage to a player, you may copy this card and you may - * cast the copy without paying its mana cost.'" + * 702.97a Cipher appears on some instants and sorceries. It represents two + * static abilities, one that functions while the spell is on the stack and one + * that functions while the card with cipher is in the exile zone. "Cipher" + * means "If this spell is represented by a card, you may exile this card + * encoded on a creature you control" and "As long as this card is encoded on + * that creature, that creature has 'Whenever this creature deals combat damage + * to a player, you may copy this card and you may cast the copy without paying + * its mana cost.'" * - * 702.97b The term "encoded" describes the relationship between the card with cipher - * while in the exile zone and the creature chosen when the spell represented by that - * card resolves. + * 702.97b The term "encoded" describes the relationship between the card with + * cipher while in the exile zone and the creature chosen when the spell + * represented by that card resolves. * - * 702.97c The card with cipher remains encoded on the chosen creature as long as the - * card with cipher remains exiled and the creature remains on the battlefield. The - * card remains encoded on that object even if it changes controller or stops being - * a creature, as long as it remains on the battlefield. + * 702.97c The card with cipher remains encoded on the chosen creature as long + * as the card with cipher remains exiled and the creature remains on the + * battlefield. The card remains encoded on that object even if it changes + * controller or stops being a creature, as long as it remains on the + * battlefield. * * TODO: Implement Cipher as two static abilities concerning the rules. * * @author LevelX2 */ - - public class CipherEffect extends OneShotEffect { public CipherEffect() { super(Outcome.Copy); - staticText ="

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; + staticText = "

Cipher (Then you may exile this spell card encoded on a creature you control. Whenever that creature deals combat damage to a player, its controller may cast a copy of the encoded card without paying its mana cost.)"; } public CipherEffect(final CipherEffect effect) { @@ -86,10 +87,11 @@ public class CipherEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); if (controller != null) { + TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(); + target.setNotTarget(true); if (target.canChoose(source.getControllerId(), game) - && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { + && controller.chooseUse(outcome, "Cipher this spell to a creature?", source, game)) { controller.chooseTarget(outcome, target, source, game); Card sourceCard = game.getCard(source.getSourceId()); Permanent targetCreature = game.getPermanent(target.getFirstTarget()); @@ -99,9 +101,10 @@ public class CipherEffect extends OneShotEffect { ContinuousEffect effect = new GainAbilityTargetEffect(ability, Duration.Custom); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); - if (!game.isSimulation()) + if (!game.isSimulation()) { game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": Spell ciphered to ").append(targetCreature.getLogName()).toString()); - return sourceCard.moveToExile(null, "", source.getSourceId(), game); + } + return controller.moveCards(sourceCard, null, Zone.EXILED, source, game); } else { return false; } @@ -119,7 +122,7 @@ public class CipherEffect extends OneShotEffect { class CipherStoreEffect extends OneShotEffect { - private UUID cipherCardId; + private final UUID cipherCardId; public CipherStoreEffect(UUID cipherCardId, String ruleText) { super(Outcome.Copy); @@ -141,13 +144,13 @@ class CipherStoreEffect extends OneShotEffect { SpellAbility ability = copyCard.getSpellAbility(); // remove the cipher effect from the copy Effect cipherEffect = null; - for (Effect effect :ability.getEffects()) { + for (Effect effect : ability.getEffects()) { if (effect instanceof CipherEffect) { cipherEffect = effect; } } ability.getEffects().remove(cipherEffect); - if (ability != null && ability instanceof SpellAbility) { + if (ability instanceof SpellAbility) { controller.cast(ability, game, true); } } From 5545aa02b54aba0174a2d1695c5c9195901c72a2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 21:52:52 +0200 Subject: [PATCH 60/63] Added LoseAbilityAllEffect. --- .../continuous/LoseAbilityAllEffect.java | 57 +++++++++++++++++ .../continuous/LoseAllAbilitiesAllEffect.java | 64 +++++++++---------- 2 files changed, 88 insertions(+), 33 deletions(-) create mode 100644 Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java new file mode 100644 index 0000000000..0ee881c377 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAbilityAllEffect.java @@ -0,0 +1,57 @@ +/* + * 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.continuous; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.filter.FilterPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LevelX2 + */ +public class LoseAbilityAllEffect extends ContinuousEffectImpl { + + protected final FilterPermanent filter; + protected final Ability ability; + + public LoseAbilityAllEffect(FilterPermanent filter, Ability ability, Duration duration) { + super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); + this.filter = filter; + this.ability = ability; + staticText = filter.getMessage() + " lose " + ability.toString() + (duration.toString().isEmpty() ? "" : " " + duration.toString()); + } + + public LoseAbilityAllEffect(final LoseAbilityAllEffect effect) { + super(effect); + this.filter = effect.filter.copy(); + this.ability = effect.ability; + } + + @Override + public LoseAbilityAllEffect copy() { + return new LoseAbilityAllEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + if (permanent != null) { + while (permanent.getAbilities().contains(ability)) { + permanent.getAbilities().remove(ability); + } + } + } + return true; + } + +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java index 54115e932f..2e2020eda6 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/LoseAllAbilitiesAllEffect.java @@ -1,52 +1,50 @@ /* -* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. -* -* Redistribution and use in source and binary forms, with or without modification, are -* permitted provided that the following conditions are met: -* -* 1. Redistributions of source code must retain the above copyright notice, this list of -* conditions and the following disclaimer. -* -* 2. Redistributions in binary form must reproduce the above copyright notice, this list -* of conditions and the following disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED -* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR -* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -* The views and conclusions contained in the software and documentation are those of the -* authors and should not be interpreted as representing official policies, either expressed -* or implied, of BetaSteward_at_googlemail.com. -*/ - + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ package mage.abilities.effects.common.continuous; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.ContinuousEffectImpl; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.ContinuousEffectImpl; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; - /** * * @author LevelX2 */ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { - private FilterPermanent filter; + private final FilterPermanent filter; public LoseAllAbilitiesAllEffect(FilterPermanent filter, Duration duration) { super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility); @@ -65,7 +63,7 @@ public class LoseAllAbilitiesAllEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { if (permanent != null) { permanent.removeAllAbilities(source.getSourceId(), game); } From fa14128486604a32c9ff831edc09eb607327e078 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 22:52:00 +0200 Subject: [PATCH 61/63] * SOURCE_CAST_SPELL_ABILITY check for sourceId added. --- .../sets/bornofthegods/AstralCornucopia.java | 9 +-- .../championsofkamigawa/OrochiHatchery.java | 9 +-- .../sets/commander2014/LifebloodHydra.java | 9 +-- .../mage/sets/conflux/ApocalypseHydra.java | 9 +-- .../mage/sets/conspiracy/AcademyElite.java | 7 +- .../sets/conspiracy/GrenzoDungeonWarden.java | 10 +-- .../sets/dragonsmaze/SavagebornHydra.java | 12 ++-- .../mage/sets/gatecrash/NimbusSwimmer.java | 9 +-- .../sets/innistrad/MikaeusTheLunarch.java | 9 +-- .../mage/sets/khansoftarkir/BribersPurse.java | 9 +-- .../mage/sets/khansoftarkir/HoodedHydra.java | 9 +-- .../src/mage/sets/magic2010/ProteanHydra.java | 9 +-- .../mage/sets/magic2012/PrimordialHydra.java | 9 +-- .../mage/sets/magic2014/VastwoodHydra.java | 9 +-- .../src/mage/sets/magic2015/GenesisHydra.java | 8 +-- .../sets/magicorigins/HangarbackWalker.java | 9 +-- .../mage/sets/mirrodin/ChaliceOfTheVoid.java | 9 +-- .../modernmasters2015/WorldheartPhoenix.java | 9 +-- .../mage/sets/planechase/IvyElemental.java | 8 +-- .../src/mage/sets/planeshift/DralnusPet.java | 9 +-- .../mage/sets/returntoravnica/ManaBloom.java | 9 +-- .../MagaTraitorToMortals.java | 9 +-- .../sets/scarsofmirrodin/ChimericMass.java | 9 +-- .../mage/sets/shardsofalara/FeralHydra.java | 10 +-- .../shardsofalara/SigilOfDistinction.java | 9 +-- Mage.Sets/src/mage/sets/tempest/Krakilin.java | 10 +-- .../src/mage/sets/theros/MistcutterHydra.java | 10 +-- .../mage/sets/visions/PhyrexianMarauder.java | 9 +-- .../asthough/PlayFromNonHandZoneTest.java | 69 +++++++++++-------- 29 files changed, 183 insertions(+), 141 deletions(-) diff --git a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java index def4ee17b9..d371e9adcc 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/AstralCornucopia.java @@ -90,10 +90,11 @@ class AstralCornucopiaEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java index 56a0e0acb1..1e2e16c741 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/OrochiHatchery.java @@ -91,10 +91,11 @@ class OrochiHatcheryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) {; - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java index fe68627ce7..8922851882 100644 --- a/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java +++ b/Mage.Sets/src/mage/sets/commander2014/LifebloodHydra.java @@ -94,10 +94,11 @@ class LifebloodHydraComesIntoPlayEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java index 2996412edd..a195c86159 100644 --- a/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java +++ b/Mage.Sets/src/mage/sets/conflux/ApocalypseHydra.java @@ -96,10 +96,11 @@ class ApocalypseHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { if (amount < 5) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); diff --git a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java index 9a249cfa5b..97809e2431 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java +++ b/Mage.Sets/src/mage/sets/conspiracy/AcademyElite.java @@ -100,9 +100,10 @@ class AcademyEliteEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards")); int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this); if (instantsAndSorceriesCount > 0) { diff --git a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java index 5195b3ef39..e583ec71ad 100644 --- a/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java +++ b/Mage.Sets/src/mage/sets/conspiracy/GrenzoDungeonWarden.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; @@ -94,10 +95,11 @@ class GrenzoDungeonWardenEtBEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((Ability) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java index 294084fe22..1ed4e842ea 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/SavagebornHydra.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.DoubleStrikeAbility; @@ -95,12 +96,11 @@ class SavageBornHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - // delete to prevent using it again if put into battlefield from other effect - setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java index a47c15bc88..e7dbf68a9c 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java +++ b/Mage.Sets/src/mage/sets/gatecrash/NimbusSwimmer.java @@ -87,10 +87,11 @@ class NimbusSwimmerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java index b2e510508a..c87a6c44bc 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java +++ b/Mage.Sets/src/mage/sets/innistrad/MikaeusTheLunarch.java @@ -110,10 +110,11 @@ class MikaeusTheLunarchEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java index ae267ccc25..ac166275b3 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/BribersPurse.java @@ -94,10 +94,11 @@ class BribersPurseEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(new Counter("gem", amount), game); } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java index 701624c57f..9f577aba4d 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/HoodedHydra.java @@ -111,10 +111,11 @@ class HoodedHydraEffect1 extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java index 29285cf79c..e84b732672 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java +++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java @@ -102,10 +102,11 @@ public class ProteanHydra extends CardImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java index 420d7def57..76a4fe38a7 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java +++ b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java @@ -98,10 +98,11 @@ class PrimordialHydraEntersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java index 1face40591..128e2d989f 100644 --- a/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java +++ b/Mage.Sets/src/mage/sets/magic2014/VastwoodHydra.java @@ -102,10 +102,11 @@ class VastwoodHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java index 39a891f900..af7a92c7e1 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java +++ b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java @@ -101,10 +101,10 @@ class GenesisHydraEntersBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - SpellAbility spellAbility = (SpellAbility) obj; + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java index f438ef8f52..0b0a72bf05 100644 --- a/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java +++ b/Mage.Sets/src/mage/sets/magicorigins/HangarbackWalker.java @@ -101,10 +101,11 @@ class HangarbackWalkerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java index e36d852e5b..afab045802 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ChaliceOfTheVoid.java @@ -88,10 +88,11 @@ class ChaliceOfTheVoidEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java index 3eb2340d63..31277520f3 100644 --- a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java +++ b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java @@ -136,11 +136,12 @@ public class WorldheartPhoenix extends CardImpl { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { // TODO: No perfect solution because there could be other effects that allow to cast the card for this mana cost - if (((SpellAbility) obj).getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { + if (spellAbility.getManaCosts().getText().equals("{W}{U}{B}{R}{G}")) { permanent.addCounters(CounterType.P1P1.createInstance(2), game); } } diff --git a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java index ab427c6c98..757482edb4 100644 --- a/Mage.Sets/src/mage/sets/planechase/IvyElemental.java +++ b/Mage.Sets/src/mage/sets/planechase/IvyElemental.java @@ -85,10 +85,10 @@ class IvyElementalEntersBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - SpellAbility spellAbility = (SpellAbility) obj; + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { if (spellAbility.getSourceId().equals(source.getSourceId())) { // put into play by normal cast int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { diff --git a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java index c8c9218dbd..5a94ca0d4e 100644 --- a/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java +++ b/Mage.Sets/src/mage/sets/planeshift/DralnusPet.java @@ -112,11 +112,12 @@ class DralnusPetEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { int cmc = 0; - for (Cost cost : ((SpellAbility) obj).getCosts()) { + for (Cost cost : spellAbility.getCosts()) { if (cost instanceof DiscardCardCost && ((DiscardCardCost) cost).getCards().size() > 0) { cmc = ((DiscardCardCost) cost).getCards().get(0).getManaCost().convertedManaCost(); } diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java index 155244c026..f0d423cd6f 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java @@ -100,12 +100,13 @@ class ManaBloomEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { // delete to prevent using it again if put into battlefield from other effect setValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY, null); - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); return true; diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java index fa2c2afda1..028f929959 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/MagaTraitorToMortals.java @@ -97,10 +97,11 @@ class MagaTraitorToMortalsEnterBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java index e554b7b6c3..6ca59c6d7b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java @@ -92,10 +92,11 @@ class ChimericMassEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java index c79740b735..a6d8eeda83 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/FeralHydra.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.InfoEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -96,10 +97,11 @@ class FeralHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java index a5c433e594..dc7aa39b6e 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/SigilOfDistinction.java @@ -93,10 +93,11 @@ class SigilOfDistinctionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.CHARGE.createInstance(amount), game); return true; diff --git a/Mage.Sets/src/mage/sets/tempest/Krakilin.java b/Mage.Sets/src/mage/sets/tempest/Krakilin.java index 5b7ee1a1c4..55ac185a0e 100644 --- a/Mage.Sets/src/mage/sets/tempest/Krakilin.java +++ b/Mage.Sets/src/mage/sets/tempest/Krakilin.java @@ -34,6 +34,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; @@ -90,10 +91,11 @@ class KrakilinEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java index 501b8084e9..7fa563f676 100644 --- a/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java +++ b/Mage.Sets/src/mage/sets/theros/MistcutterHydra.java @@ -34,6 +34,7 @@ import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.common.CantBeCounteredAbility; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.ProtectionAbility; @@ -102,10 +103,11 @@ class MistcutterHydraEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - Object obj = getValue(mage.abilities.effects.EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((SpellAbility) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java index 96c5998fc5..e06229d3ab 100644 --- a/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java +++ b/Mage.Sets/src/mage/sets/visions/PhyrexianMarauder.java @@ -96,10 +96,11 @@ class PhyrexianMarauderEntersEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && !permanent.isFaceDown(game)) { - Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); - if (obj != null && obj instanceof SpellAbility - && permanent.getZoneChangeCounter(game) - 1 == ((SpellAbility) obj).getSourceObjectZoneChangeCounter()) { - int amount = ((Ability) obj).getManaCostsToPay().getX(); + SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); + if (spellAbility != null + && spellAbility.getSourceId().equals(source.getSourceId()) + && permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) { + int amount = spellAbility.getManaCostsToPay().getX(); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), game); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java index 0c2a691248..395b217c58 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java @@ -36,14 +36,31 @@ import org.mage.test.serverside.base.CardTestPlayerBase; * * @author LevelX2 */ - public class PlayFromNonHandZoneTest extends CardTestPlayerBase { + @Test + public void testWorldheartPhoenixNormal() { + // Creature - Phoenix {3}{R} + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // If you do, it enters the battlefield with two +1/+1 counters on it. + addCard(Zone.HAND, playerA, "Worldheart Phoenix"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Worldheart Phoenix"); // can only be cast by {W}{U}{B}{R}{G} + + setStopAt(1, PhaseStep.END_COMBAT); + execute(); + + assertPowerToughness(playerA, "Worldheart Phoenix", 2, 2); + + } + @Test public void testWorldheartPhoenixNoMana() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); @@ -53,16 +70,15 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 0); - - } + assertPermanentCount(playerA, "Worldheart Phoenix", 0); + } @Test public void testWorldheartPhoenix() { // Creature - Phoenix {3}{R} - // Flying - // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. + // Flying + // You may cast Worldheart Phoenix from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost. // If you do, it enters the battlefield with two +1/+1 counters on it. addCard(Zone.GRAVEYARD, playerA, "Worldheart Phoenix"); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); @@ -76,11 +92,10 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { setStopAt(1, PhaseStep.END_COMBAT); execute(); - assertPermanentCount(playerA, "Worldheart Phoenix", 1); - - } - - + assertPermanentCount(playerA, "Worldheart Phoenix", 1); + + } + @Test public void testNarsetEnlightenedMaster() { // First strike @@ -90,38 +105,36 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { skipInitShuffling(); addCard(Zone.LIBRARY, playerB, "Silvercoat Lion"); - addCard(Zone.LIBRARY, playerB, "Abzan Banner"); + addCard(Zone.LIBRARY, playerB, "Abzan Banner"); // Ferocious - If you control a creature with power 4 or greater, you may cast Dragon Grip as though it had flash. (You may cast it any time you could cast an instant.) // Enchant creature // Enchanted creature gets +2/+0 and has first strike. - addCard(Zone.LIBRARY, playerB, "Dragon Grip"); + addCard(Zone.LIBRARY, playerB, "Dragon Grip"); // You gain 2 life for each creature you control. - addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); - addCard(Zone.LIBRARY, playerB, "Plains"); - + addCard(Zone.LIBRARY, playerB, "Peach Garden Oath"); + addCard(Zone.LIBRARY, playerB, "Plains"); + attack(2, playerB, "Narset, Enlightened Master"); castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Silvercoat Lion"); // can't be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Abzan Banner"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Dragon Grip", "Narset, Enlightened Master"); // can be cast from exile castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Peach Garden Oath"); // can be cast from exile - + setStopAt(2, PhaseStep.END_TURN); execute(); assertExileCount("Silvercoat Lion", 1); - assertPermanentCount(playerB, "Abzan Banner", 1); - assertPermanentCount(playerB, "Dragon Grip", 1); + assertPermanentCount(playerB, "Abzan Banner", 1); + assertPermanentCount(playerB, "Dragon Grip", 1); assertGraveyardCount(playerB, "Peach Garden Oath", 1); - + assertPowerToughness(playerB, "Narset, Enlightened Master", 5, 2); - + assertHandCount(playerB, "Plains", 1); assertLife(playerA, 17); assertLife(playerB, 22); - - - } - - + + } + } From 774b7bdb0aa2f544debc1cf1a92365da28027eb0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 23:50:34 +0200 Subject: [PATCH 62/63] * Oloro, Ageless Ascetic - Fixe dthat the life loss was wrongly dealt as damage to the opponents. --- .../commander2013/OloroAgelessAscetic.java | 41 +++++-------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java index 569209b09f..766fb5bd62 100644 --- a/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java +++ b/Mage.Sets/src/mage/sets/commander2013/OloroAgelessAscetic.java @@ -29,23 +29,20 @@ package mage.sets.commander2013; import java.util.UUID; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.GainLifeControllerTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.StaticValue; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DamagePlayersEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; 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; /** * @@ -65,11 +62,17 @@ public class OloroAgelessAscetic extends CardImpl { // At the beginning of your upkeep, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new GainLifeEffect(2), TargetController.YOU, false)); + // Whenever you gain life, you may pay {1}. If you do, draw a card and each opponent loses 1 life. - this.addAbility(new GainLifeControllerTriggeredAbility(new DoIfCostPaid(new OloroAgelessAsceticEffect(), new GenericManaCost(1)),false)); + DoIfCostPaid effect = new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new GenericManaCost(1)); + Effect effectToAdd = new LoseLifeOpponentsEffect(1); + effectToAdd.setText("and each opponent loses 1 life"); + effect.addEffect(effectToAdd); + this.addAbility(new GainLifeControllerTriggeredAbility(effect, false)); + // At the beginning of your upkeep, if Oloro, Ageless Ascetic is in the command zone, you gain 2 life. this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, - new GainLifeEffect(new StaticValue(2), "if Oloro, Ageless Ascetic is in the command zone, you gain 2 life"),TargetController.YOU, false)); + new GainLifeEffect(new StaticValue(2), "if {this} is in the command zone, you gain 2 life"), TargetController.YOU, false)); } public OloroAgelessAscetic(final OloroAgelessAscetic card) { @@ -81,27 +84,3 @@ public class OloroAgelessAscetic extends CardImpl { return new OloroAgelessAscetic(this); } } - -class OloroAgelessAsceticEffect extends OneShotEffect { - - public OloroAgelessAsceticEffect() { - super(Outcome.Benefit); - this.staticText = "draw a card and each opponent loses 1 life"; - } - - public OloroAgelessAsceticEffect(final OloroAgelessAsceticEffect effect) { - super(effect); - } - - @Override - public OloroAgelessAsceticEffect copy() { - return new OloroAgelessAsceticEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - new DrawCardSourceControllerEffect(1).apply(game, source); - new DamagePlayersEffect(1, TargetController.OPPONENT).apply(game, source); - return false; - } -} From bb1839f79bb03abe09aad16159939d1b9c6c22f5 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 1 Sep 2015 23:54:56 +0200 Subject: [PATCH 63/63] Added a test. --- .../mage/sets/eventide/DivinityOfPride.java | 21 +++--- .../sets/mirrodinbesieged/Cryptoplasm.java | 69 +++++++++---------- .../mage/test/AI/basic/CastCreaturesTest.java | 4 ++ .../mage/test/cards/copy/CryptoplasmTest.java | 59 ++++++++++++++++ 4 files changed, 108 insertions(+), 45 deletions(-) diff --git a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java index 19558dcc7f..19190e1ec5 100644 --- a/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java +++ b/Mage.Sets/src/mage/sets/eventide/DivinityOfPride.java @@ -28,11 +28,6 @@ package mage.sets.eventide; 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.common.SimpleStaticAbility; @@ -42,6 +37,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; 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.players.Player; @@ -57,15 +56,19 @@ public class DivinityOfPride extends CardImpl { this.subtype.add("Spirit"); this.subtype.add("Avatar"); - this.power = new MageInt(4); this.toughness = new MageInt(4); + // Flying this.addAbility(FlyingAbility.getInstance()); + + // Lifelink this.addAbility(LifelinkAbility.getInstance()); + + // Divinity of Pride gets +4/+4 as long as you have 25 or more life. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(new BoostSourceEffect(4, 4, Duration.WhileOnBattlefield), - new DivinityOfPrideCondition(), - "Divinity of Pride gets +4/+4 as long as you have 25 or more life"))); + new DivinityOfPrideCondition(), + "{this} gets +4/+4 as long as you have 25 or more life"))); } public DivinityOfPride(final DivinityOfPride card) { @@ -85,4 +88,4 @@ class DivinityOfPrideCondition implements Condition { Player player = game.getPlayer(source.getControllerId()); return player != null && player.getLife() >= 25; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java index 64202e88ca..3f02879da6 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Cryptoplasm.java @@ -25,17 +25,19 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.mirrodinbesieged; -import mage.constants.CardType; -import mage.constants.Rarity; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CopyEffect; 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.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; @@ -43,12 +45,11 @@ import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.util.functions.ApplyToPermanent; -import java.util.UUID; - /** * @author Loki */ public class Cryptoplasm extends CardImpl { + final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { @@ -64,7 +65,7 @@ public class Cryptoplasm extends CardImpl { this.toughness = new MageInt(2); // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } @@ -80,43 +81,39 @@ public class Cryptoplasm extends CardImpl { } -class CryptoplasmTransformEffect extends ContinuousEffectImpl { +class CryptoplasmEffect extends OneShotEffect { - CryptoplasmTransformEffect() { - super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.Copy); - staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; + public CryptoplasmEffect() { + super(Outcome.Copy); + this.staticText = "you may have {this} become a copy of another target creature. If you do, {this} gains this ability"; } - CryptoplasmTransformEffect(final CryptoplasmTransformEffect effect) { + public CryptoplasmEffect(final CryptoplasmEffect effect) { super(effect); } @Override - public boolean apply(Game game, final Ability source) { - Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); - Permanent permanent = game.getPermanent(source.getSourceId()); - - if (creature == null || permanent == null) { - return false; - } - - game.copyPermanent(creature, permanent, source, new ApplyToPermanent() { - @Override - public Boolean apply(Game game, Permanent permanent) { - Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmTransformEffect(), TargetController.YOU, true); - upkeepAbility.addTarget(new TargetCreaturePermanent()); - permanent.addAbility(upkeepAbility, source.getSourceId(), game); - return true; - } - }); - - - return true; + public CryptoplasmEffect copy() { + return new CryptoplasmEffect(this); } @Override - public CryptoplasmTransformEffect copy() { - return new CryptoplasmTransformEffect(this); - } + public boolean apply(Game game, final Ability source) { + Permanent creatureToCopy = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (creatureToCopy != null) { + CopyEffect effect = new CopyEffect(creatureToCopy, source.getSourceId()); + effect.setApplier(new ApplyToPermanent() { + @Override + public Boolean apply(Game game, Permanent permanent) { + Ability upkeepAbility = new BeginningOfUpkeepTriggeredAbility(new CryptoplasmEffect(), TargetController.YOU, true); + upkeepAbility.addTarget(new TargetCreaturePermanent()); + permanent.addAbility(upkeepAbility, source.getSourceId(), game); + return true; + } + }); + game.addEffect(effect, source); + } + return true; + } } diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java index 565fc57e36..7ec428cced 100644 --- a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CastCreaturesTest.java @@ -52,6 +52,10 @@ public class CastCreaturesTest extends CardTestPlayerBaseAI { assertPermanentCount(playerA, "Silvercoat Lion", 1); } + /** + * This test fails sometimes, probably because two plains are tapped for the + * first creature + */ @Test public void testSimpleCast2() { addCard(Zone.HAND, playerA, "Silvercoat Lion"); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java index 1f8926e2cf..f57e5f9342 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CryptoplasmTest.java @@ -55,4 +55,63 @@ public class CryptoplasmTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Cryptoplasm", 0); assertPermanentCount(playerB, "Sigiled Paladin", 2); } + + /** + * I'm at 8 life, opponent (AI) is at 21. I have a Cryptoplasm currently + * copying my opponent's Divinity of Pride, the Crypto also has my Followed + * Footsteps attached to it. Additionally, I have another Cryptoplasm on the + * battlefield also copying the same Divinity, and a Clever Impersonator + * that ETB copying the first Cryptoplasm and is currently also a copy of + * the Divinity. + * + * Opponent attacks with his only Divinity of Pride (4/4) and a Serra + * Avenger (3/3). I block the Divinity with two of my Divinity copies (the + * Clever Impersonator and unenchanted Cryptoplasm) and the Avenger with the + * enchanted Divinity (originally a Cryptoplasm). My opponent's Divinity + * kills my two copies and dies, and then his Avenger dies and kills the + * Divinity blocking it, also sending my Followed Footsteps down with it. + * + * How does any of that add up? Not only should his Divinity only kill one + * of mine since it was a 4/4 and only becomes an 8/8 after dealing its + * damage (at which point it should be too late to go back and say the 4 + * damage are now 8, since it was that exact damage that put him at 25 + * life), but even more confusing is how the Serra Avenger, which is a 3/3, + * somehow kills my 4/4 that had suffered no other damage that turn. + * + * No other permanents in play at that moment had any influence in this + * either, they were only basic lands and a couple of creatures with no + * relevant abilities. + * + * I won't put aside me completely missing something here, but I really + * can't see any other explanation to this other than a game bug. + */ + @Test + public void testDamageLifelink() { + setLife(playerA, 21); + setLife(playerB, 8); + // First strike + // Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.) + addCard(Zone.BATTLEFIELD, playerA, "Divinity of Pride", 1); // {W}{W} + + addCard(Zone.BATTLEFIELD, playerB, "Island", 5); + // At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability. + addCard(Zone.BATTLEFIELD, playerB, "Cryptoplasm", 2); // {1}{U}{U} + addTarget(playerB, "Divinity of Pride"); + addTarget(playerB, "Divinity of Pride"); + + attack(3, playerA, "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + block(3, playerB, "Divinity of Pride", "Divinity of Pride"); + + setStopAt(3, PhaseStep.POSTCOMBAT_MAIN); + execute(); + + assertPermanentCount(playerB, "Cryptoplasm", 0); + + assertPermanentCount(playerA, "Divinity of Pride", 0); + assertPermanentCount(playerB, "Divinity of Pride", 1); + + assertLife(playerB, 16); + assertLife(playerA, 25); + } }