From ad8358a495b8c8a63917067e72416af41909c2ee Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 12:10:05 +0300 Subject: [PATCH 1/8] Implement cards: Devouring Strossus, Samite Elder, and Waterspout Elemental --- .../mage/sets/invasion/DevouringStrossus.java | 83 +++++++++++++ .../src/mage/sets/planeshift/SamiteElder.java | 110 ++++++++++++++++++ .../sets/planeshift/WaterspoutElemental.java | 83 +++++++++++++ 3 files changed, 276 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/SamiteElder.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/WaterspoutElemental.java diff --git a/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java b/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java new file mode 100644 index 00000000000..94644acdf1b --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DevouringStrossus extends CardImpl { + + public DevouringStrossus(UUID ownerId) { + super(ownerId, 101, "Devouring Strossus", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}{B}"); + this.expansionSetCode = "INV"; + this.subtype.add("Horror"); + this.power = new MageInt(9); + this.toughness = new MageInt(9); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Trample + this.addAbility(TrampleAbility.getInstance()); + // At the beginning of your upkeep, sacrifice a creature. + Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), + TargetController.YOU, false); + ability.addTarget(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true)); + this.addAbility(ability); + // Sacrifice a creature: Regenerate Devouring Strossus. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("a creature"), true)))); + } + + public DevouringStrossus(final DevouringStrossus card) { + super(card); + } + + @Override + public DevouringStrossus copy() { + return new DevouringStrossus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/SamiteElder.java b/Mage.Sets/src/mage/sets/planeshift/SamiteElder.java new file mode 100644 index 00000000000..50cd28ade0e --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/SamiteElder.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class SamiteElder extends CardImpl { + + public SamiteElder(UUID ownerId) { + super(ownerId, 14, "Samite Elder", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // {T}: Creatures you control gain protection from the colors of target permanent you control until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SamiteElderEffect(), new TapSourceCost()); + ability.addTarget(new TargetControlledPermanent()); + this.addAbility(ability); + } + + public SamiteElder(final SamiteElder card) { + super(card); + } + + @Override + public SamiteElder copy() { + return new SamiteElder(this); + } +} + +class SamiteElderEffect extends OneShotEffect { + + public SamiteElderEffect() { + super(Outcome.Protect); + staticText = "Creatures you control gain protection from the colors of target permanent you control until end of turn"; + } + + public SamiteElderEffect(final SamiteElderEffect effect) { + super(effect); + } + + public SamiteElderEffect copy() { + return new SamiteElderEffect(this); + } + + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getFirstTarget()); + if(target != null) { + for(ObjectColor color : target.getColor(game).getColors()) { + FilterCard filter = new FilterCard(color.getDescription()); + filter.add(new ColorPredicate(color)); + game.addEffect(new GainAbilityControlledEffect(new ProtectionAbility(filter), + Duration.EndOfTurn, new FilterControlledCreaturePermanent()), source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/WaterspoutElemental.java b/Mage.Sets/src/mage/sets/planeshift/WaterspoutElemental.java new file mode 100644 index 00000000000..787126a6ccd --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/WaterspoutElemental.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.KickedCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.abilities.effects.common.turn.SkipNextTurnSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.KickerAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class WaterspoutElemental extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures"); + + static { + filter.add(new AnotherPredicate()); + } + + public WaterspoutElemental(UUID ownerId) { + super(ownerId, 38, "Waterspout Elemental", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Elemental"); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Kicker {U} + this.addAbility(new KickerAbility("{U}")); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Waterspout Elemental enters the battlefield, if it was kicked, return all other creatures to their owners' hands and you skip your next turn. + EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandFromBattlefieldAllEffect(filter)); + ability.addEffect(new SkipNextTurnSourceEffect()); + this.addAbility(new ConditionalTriggeredAbility(ability, KickedCondition.getInstance(), + "When {this} enters the battlefield, if it was kicked, return all other creatures to their owners' hands and you skip your next turn")); + } + + public WaterspoutElemental(final WaterspoutElemental card) { + super(card); + } + + @Override + public WaterspoutElemental copy() { + return new WaterspoutElemental(this); + } +} From daf875050ca8f02260e9baa80434481d68218356 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 12:10:58 +0300 Subject: [PATCH 2/8] Ass BecomesTargetAttachedTriggeredAbility and use it for existing cards. Implement card: Sleeping Potion --- .../src/mage/sets/magic2010/IceCage.java | 56 ++---------- .../mage/sets/magic2014/IllusionaryArmor.java | 49 +---------- .../mage/sets/planeshift/SleepingPotion.java | 84 ++++++++++++++++++ ...BecomesTargetAttachedTriggeredAbility.java | 87 +++++++++++++++++++ 4 files changed, 181 insertions(+), 95 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java create mode 100644 Mage/src/mage/abilities/common/BecomesTargetAttachedTriggeredAbility.java diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java index 911d57ec0d6..9c8f2b22653 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java +++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.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,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. @@ -30,7 +30,7 @@ package mage.sets.magic2010; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTargetAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroySourceEffect; @@ -41,10 +41,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -71,7 +67,7 @@ public class IceCage extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBlockAttackActivateAttachedEffect())); // When enchanted creature becomes the target of a spell or ability, destroy Ice Cage. - this.addAbility(new IceCageAbility()); + this.addAbility(new BecomesTargetAttachedTriggeredAbility(new DestroySourceEffect())); } public IceCage(final IceCage card) { @@ -83,41 +79,3 @@ public class IceCage extends CardImpl { return new IceCage(this); } } - -class IceCageAbility extends TriggeredAbilityImpl { - - public IceCageAbility() { - super(Zone.BATTLEFIELD, new DestroySourceEffect()); - } - - public IceCageAbility(final IceCageAbility ability) { - super(ability); - } - - @Override - public IceCageAbility copy() { - return new IceCageAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TARGETED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "When enchanted creature becomes the target of a spell or ability, destroy {this}."; - } - -} diff --git a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java index 07129d69f2f..d536c5102cc 100644 --- a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java +++ b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java @@ -28,10 +28,10 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BecomesTargetAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.DestroySourceEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; @@ -40,10 +40,6 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -67,7 +63,7 @@ public class IllusionaryArmor extends CardImpl { // Enchanted creature gets +4/+4. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(4, 4, Duration.WhileOnBattlefield))); // When enchanted creature becomes the target of a spell or ability, sacrifice Illusionary Armor. - this.addAbility(new IllusionaryArmorAbility()); + this.addAbility(new BecomesTargetAttachedTriggeredAbility(new SacrificeSourceEffect())); } public IllusionaryArmor(final IllusionaryArmor card) { @@ -79,42 +75,3 @@ public class IllusionaryArmor extends CardImpl { return new IllusionaryArmor(this); } } - - -class IllusionaryArmorAbility extends TriggeredAbilityImpl { - - public IllusionaryArmorAbility() { - super(Zone.BATTLEFIELD, new DestroySourceEffect()); - } - - public IllusionaryArmorAbility(final IllusionaryArmorAbility ability) { - super(ability); - } - - @Override - public IllusionaryArmorAbility copy() { - return new IllusionaryArmorAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.TARGETED; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Permanent enchantment = game.getPermanent(sourceId); - if (enchantment != null && enchantment.getAttachedTo() != null) { - if (event.getTargetId().equals(enchantment.getAttachedTo())) { - return true; - } - } - return false; - } - - @Override - public String getRule() { - return "When enchanted creature becomes the target of a spell or ability, destroy {this}."; - } - -} diff --git a/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java b/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.java new file mode 100644 index 00000000000..ad0cacc5e64 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/SleepingPotion.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.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BecomesTargetAttachedTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.effects.common.TapEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SleepingPotion extends CardImpl { + + public SleepingPotion(UUID ownerId) { + super(ownerId, 34, "Sleeping Potion", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "PLS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When Sleeping Potion enters the battlefield, tap enchanted creature. + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + // Enchanted creature doesn't untap during its controller's untap step. + Effect effect = new DontUntapInControllersUntapStepEnchantedEffect(); + effect.setText("Enchanted creature doesn't untap during its controller's untap step"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // When enchanted creature becomes the target of a spell or ability, sacrifice Sleeping Potion. + this.addAbility(new BecomesTargetAttachedTriggeredAbility(new SacrificeSourceEffect())); + } + + public SleepingPotion(final SleepingPotion card) { + super(card); + } + + @Override + public SleepingPotion copy() { + return new SleepingPotion(this); + } +} diff --git a/Mage/src/mage/abilities/common/BecomesTargetAttachedTriggeredAbility.java b/Mage/src/mage/abilities/common/BecomesTargetAttachedTriggeredAbility.java new file mode 100644 index 00000000000..f7f89e62e89 --- /dev/null +++ b/Mage/src/mage/abilities/common/BecomesTargetAttachedTriggeredAbility.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.abilities.common; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class BecomesTargetAttachedTriggeredAbility extends TriggeredAbilityImpl { + + private final String enchantType; + + public BecomesTargetAttachedTriggeredAbility(Effect effect) { + this(effect, "creature"); + } + + public BecomesTargetAttachedTriggeredAbility(Effect effect, String enchantType) { + super(Zone.BATTLEFIELD, effect); + this.enchantType = enchantType; + } + + public BecomesTargetAttachedTriggeredAbility(final BecomesTargetAttachedTriggeredAbility ability) { + super(ability); + this.enchantType = ability.enchantType; + } + + @Override + public BecomesTargetAttachedTriggeredAbility copy() { + return new BecomesTargetAttachedTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent enchantment = game.getPermanent(sourceId); + if (enchantment != null && enchantment.getAttachedTo() != null) { + if (event.getTargetId().equals(enchantment.getAttachedTo())) { + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "When enchanted " + enchantType + " becomes the target of a spell or ability, " + super.getRule(); + } +} From 5872709e3e5766037bce25e7415e98e4c1c4d516 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 13:49:04 +0300 Subject: [PATCH 3/8] Add DamageEachOtherEffect and use it for existing cards. Implement cards: Karplusan Yeti; Tracker; and Tahngarth, Talruum Hero --- .../src/mage/sets/iceage/KarplusanYeti.java | 70 +++++++++++++++ .../mage/sets/masterseditioniii/Tracker.java | 71 +++++++++++++++ .../mage/sets/ninthedition/KarplusanYeti.java | 52 +++++++++++ .../sets/planeshift/TahngarthTalruumHero.java | 76 ++++++++++++++++ .../mage/sets/shardsofalara/VeinDrinker.java | 48 +--------- Mage.Sets/src/mage/sets/thedark/Tracker.java | 54 ++++++++++++ .../src/mage/sets/zendikar/PredatoryUrge.java | 66 +++----------- .../effects/common/DamageEachOtherEffect.java | 88 +++++++++++++++++++ 8 files changed, 429 insertions(+), 96 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/iceage/KarplusanYeti.java create mode 100644 Mage.Sets/src/mage/sets/masterseditioniii/Tracker.java create mode 100644 Mage.Sets/src/mage/sets/ninthedition/KarplusanYeti.java create mode 100644 Mage.Sets/src/mage/sets/planeshift/TahngarthTalruumHero.java create mode 100644 Mage.Sets/src/mage/sets/thedark/Tracker.java create mode 100644 Mage/src/mage/abilities/effects/common/DamageEachOtherEffect.java diff --git a/Mage.Sets/src/mage/sets/iceage/KarplusanYeti.java b/Mage.Sets/src/mage/sets/iceage/KarplusanYeti.java new file mode 100644 index 00000000000..6012dd2abe1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/KarplusanYeti.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.iceage; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEachOtherEffect; +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 KarplusanYeti extends CardImpl { + + public KarplusanYeti(UUID ownerId) { + super(ownerId, 197, "Karplusan Yeti", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "ICE"; + this.subtype.add("Yeti"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {T}: Karplusan Yeti deals damage equal to its power to target creature. That creature deals damage equal to its power to Karplusan Yeti. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEachOtherEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KarplusanYeti(final KarplusanYeti card) { + super(card); + } + + @Override + public KarplusanYeti copy() { + return new KarplusanYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/Tracker.java b/Mage.Sets/src/mage/sets/masterseditioniii/Tracker.java new file mode 100644 index 00000000000..1f81dac24ad --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniii/Tracker.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.masterseditioniii; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEachOtherEffect; +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 Tracker extends CardImpl { + + public Tracker(UUID ownerId) { + super(ownerId, 136, "Tracker", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}"); + this.expansionSetCode = "ME3"; + this.subtype.add("Human"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}{G}, {tap}: Tracker deals damage equal to its power to target creature. That creature deals damage equal to its power to Tracker. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEachOtherEffect(), new ManaCostsImpl("{G}{G}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public Tracker(final Tracker card) { + super(card); + } + + @Override + public Tracker copy() { + return new Tracker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ninthedition/KarplusanYeti.java b/Mage.Sets/src/mage/sets/ninthedition/KarplusanYeti.java new file mode 100644 index 00000000000..d0eaf0d4594 --- /dev/null +++ b/Mage.Sets/src/mage/sets/ninthedition/KarplusanYeti.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 KarplusanYeti extends mage.sets.iceage.KarplusanYeti { + + public KarplusanYeti(UUID ownerId) { + super(ownerId); + this.cardNumber = 198; + this.expansionSetCode = "9ED"; + } + + public KarplusanYeti(final KarplusanYeti card) { + super(card); + } + + @Override + public KarplusanYeti copy() { + return new KarplusanYeti(this); + } +} diff --git a/Mage.Sets/src/mage/sets/planeshift/TahngarthTalruumHero.java b/Mage.Sets/src/mage/sets/planeshift/TahngarthTalruumHero.java new file mode 100644 index 00000000000..876e3724c04 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/TahngarthTalruumHero.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.planeshift; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEachOtherEffect; +import mage.abilities.keyword.VigilanceAbility; +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 TahngarthTalruumHero extends CardImpl { + + public TahngarthTalruumHero(UUID ownerId) { + super(ownerId, 74, "Tahngarth, Talruum Hero", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); + this.expansionSetCode = "PLS"; + this.supertype.add("Legendary"); + this.subtype.add("Minotaur"); + this.subtype.add("Warrior"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + // {1}{R}, {tap}: Tahngarth, Talruum Hero deals damage equal to its power to target creature. That creature deals damage equal to its power to Tahngarth. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEachOtherEffect(), new ManaCostsImpl("{1}{R}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public TahngarthTalruumHero(final TahngarthTalruumHero card) { + super(card); + } + + @Override + public TahngarthTalruumHero copy() { + return new TahngarthTalruumHero(this); + } +} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java b/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java index 3248596ce07..abe026812b6 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/VeinDrinker.java @@ -29,24 +29,20 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; -import mage.abilities.effects.OneShotEffect; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageEachOtherEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.constants.Outcome; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; /** @@ -66,7 +62,7 @@ public class VeinDrinker extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // {R}, {tap}: Vein Drinker deals damage equal to its power to target creature. That creature deals damage equal to its power to Vein Drinker. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VeinDrinkerEffect(), new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEachOtherEffect(), new ManaCostsImpl("{R}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -83,39 +79,3 @@ public class VeinDrinker extends CardImpl { return new VeinDrinker(this); } } - -class VeinDrinkerEffect extends OneShotEffect { - - public VeinDrinkerEffect() { - super(Outcome.Damage); - } - - public VeinDrinkerEffect(final VeinDrinkerEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent sourceCreature = game.getPermanent(source.getSourceId()); - Permanent targetCreature = game.getPermanent(source.getTargets().get(0).getFirstTarget()); - if (sourceCreature != null && targetCreature != null) { - if (sourceCreature.getCardType().contains(CardType.CREATURE) && targetCreature.getCardType().contains(CardType.CREATURE)) { - sourceCreature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true); - targetCreature.damage(sourceCreature.getPower().getValue(), sourceCreature.getId(), game, false, true); - return true; - } - } - return false; - } - - @Override - public VeinDrinkerEffect copy() { - return new VeinDrinkerEffect(this); - } - - @Override - public String getText(Mode mode) { - return "{this} deals damage equal to its power to target creature. That creature deals damage equal to its power to {this}"; - } - -} diff --git a/Mage.Sets/src/mage/sets/thedark/Tracker.java b/Mage.Sets/src/mage/sets/thedark/Tracker.java new file mode 100644 index 00000000000..18d3bf592a5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/Tracker.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Tracker extends mage.sets.masterseditioniii.Tracker { + + public Tracker(UUID ownerId) { + super(ownerId); + this.cardNumber = 52; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.RARE; + } + + public Tracker(final Tracker card) { + super(card); + } + + @Override + public Tracker copy() { + return new Tracker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/zendikar/PredatoryUrge.java b/Mage.Sets/src/mage/sets/zendikar/PredatoryUrge.java index 76273506c4c..bf1fac671b9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PredatoryUrge.java +++ b/Mage.Sets/src/mage/sets/zendikar/PredatoryUrge.java @@ -28,22 +28,21 @@ package mage.sets.zendikar; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DamageEachOtherEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.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.common.TapSourceCost; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -67,9 +66,11 @@ public class PredatoryUrge extends CardImpl { this.addAbility(ability); // Enchanted creature has "{tap}: This creature deals damage equal to its power to target creature. // That creature deals damage equal to its power to this creature." - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PredatoryUrgeEffect(), new TapSourceCost()); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEachOtherEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability, AttachmentType.AURA))); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted creature has \"{T}: This creature deals damage equal to its power to target creature. That creature deals damage equal to its power to this creature.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } public PredatoryUrge(final PredatoryUrge card) { @@ -81,42 +82,3 @@ public class PredatoryUrge extends CardImpl { return new PredatoryUrge(this); } } - -class PredatoryUrgeEffect extends OneShotEffect { - - public PredatoryUrgeEffect() { - super(Outcome.Damage); - this.staticText = "This creature deals damage equal to its power to target creature. That creature deals damage equal to its power to this creature."; - } - - public PredatoryUrgeEffect(final PredatoryUrgeEffect effect) { - super(effect); - } - - @Override - public PredatoryUrgeEffect copy() { - return new PredatoryUrgeEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean sourceOnBattlefield = true; - Permanent targetCreature = game.getPermanent(source.getFirstTarget()); - Permanent sourceCreature = game.getPermanent(source.getSourceId()); - if (sourceCreature == null) { - sourceCreature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); - sourceOnBattlefield = false; - } - - if (sourceCreature != null && targetCreature != null - && sourceCreature.getCardType().contains(CardType.CREATURE) - && targetCreature.getCardType().contains(CardType.CREATURE)) { - targetCreature.damage(sourceCreature.getPower().getValue(), sourceCreature.getId(), game, false, true); - if (sourceOnBattlefield) { - sourceCreature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true); - } - return true; - } - return false; - } -} diff --git a/Mage/src/mage/abilities/effects/common/DamageEachOtherEffect.java b/Mage/src/mage/abilities/effects/common/DamageEachOtherEffect.java new file mode 100644 index 00000000000..4c58bf38f51 --- /dev/null +++ b/Mage/src/mage/abilities/effects/common/DamageEachOtherEffect.java @@ -0,0 +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.abilities.effects.common; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author LoneFox + */ +public class DamageEachOtherEffect extends OneShotEffect { + + public DamageEachOtherEffect() { + super(Outcome.Damage); + } + + public DamageEachOtherEffect(final DamageEachOtherEffect effect) { + super(effect); + } + + @Override + public DamageEachOtherEffect copy() { + return new DamageEachOtherEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean sourceOnBattlefield = true; + Permanent targetCreature = game.getPermanent(source.getFirstTarget()); + Permanent sourceCreature = game.getPermanent(source.getSourceId()); + if (sourceCreature == null) { + sourceCreature = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + sourceOnBattlefield = false; + } + + if (sourceCreature != null && targetCreature != null + && sourceCreature.getCardType().contains(CardType.CREATURE) + && targetCreature.getCardType().contains(CardType.CREATURE)) { + targetCreature.damage(sourceCreature.getPower().getValue(), sourceCreature.getId(), game, false, true); + if (sourceOnBattlefield) { + sourceCreature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true); + } + return true; + } + return false; + } + + @Override + public String getText(Mode mode) { + if(staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "{this} deals damage equal to its power to target creature. That creature deals damage equal to its power to {this}"; + } + +} From c3c2aa9b369b3e1c1b79630ca51d08ee00a1f4b7 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 14:04:46 +0300 Subject: [PATCH 4/8] Use plain SacrificeEffect instead of SacrificeTargetEffect for Devouring Strossus --- Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java b/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java index 94644acdf1b..96baa61d2d8 100644 --- a/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java +++ b/Mage.Sets/src/mage/sets/invasion/DevouringStrossus.java @@ -34,7 +34,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.RegenerateSourceEffect; -import mage.abilities.effects.common.SacrificeTargetEffect; +import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -63,9 +63,8 @@ public class DevouringStrossus extends CardImpl { // Trample this.addAbility(TrampleAbility.getInstance()); // At the beginning of your upkeep, sacrifice a creature. - Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeTargetEffect("sacrifice a creature"), + Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterControlledCreaturePermanent("creature"), 1, null), TargetController.YOU, false); - ability.addTarget(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true)); this.addAbility(ability); // Sacrifice a creature: Regenerate Devouring Strossus. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), From 764541d8ca05fc8fe044365aa4fcab66458e6475 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 15:35:37 +0300 Subject: [PATCH 5/8] Implement cards: Kavu Mauler, Kavu Monarch, Kavu Runner, and Skittish Kavu --- .../src/mage/sets/apocalypse/KavuMauler.java | 79 +++++++++++++++++ .../src/mage/sets/invasion/KavuMonarch.java | 85 ++++++++++++++++++ .../src/mage/sets/invasion/KavuRunner.java | 86 +++++++++++++++++++ .../src/mage/sets/invasion/SkittishKavu.java | 86 +++++++++++++++++++ 4 files changed, 336 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/apocalypse/KavuMauler.java create mode 100644 Mage.Sets/src/mage/sets/invasion/KavuMonarch.java create mode 100644 Mage.Sets/src/mage/sets/invasion/KavuRunner.java create mode 100644 Mage.Sets/src/mage/sets/invasion/SkittishKavu.java diff --git a/Mage.Sets/src/mage/sets/apocalypse/KavuMauler.java b/Mage.Sets/src/mage/sets/apocalypse/KavuMauler.java new file mode 100644 index 00000000000..131fc3391fd --- /dev/null +++ b/Mage.Sets/src/mage/sets/apocalypse/KavuMauler.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.apocalypse; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class KavuMauler extends CardImpl { + + private static final FilterAttackingCreature filter = new FilterAttackingCreature("other attacking Kavu"); + + static { + filter.add(new SubtypePredicate("Kavu")); + filter.add(new AnotherPredicate()); + } + + public KavuMauler(UUID ownerId) { + super(ownerId, 80, "Kavu Mauler", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); + this.expansionSetCode = "APC"; + this.subtype.add("Kavu"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + // Whenever Kavu Mauler attacks, it gets +1/+1 until end of turn for each other attacking Kavu. + PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter); + this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(value, value, Duration.EndOfTurn, true), false)); + } + + public KavuMauler(final KavuMauler card) { + super(card); + } + + @Override + public KavuMauler copy() { + return new KavuMauler(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/KavuMonarch.java b/Mage.Sets/src/mage/sets/invasion/KavuMonarch.java new file mode 100644 index 00000000000..1a4cd916450 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/KavuMonarch.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author LoneFox + */ +public class KavuMonarch extends CardImpl { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Kavu creatures"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("another Kavu"); + + static { + filter1.add(new SubtypePredicate("Kavu")); + filter2.add(new SubtypePredicate("Kavu")); + filter2.add(new AnotherPredicate()); + } + + public KavuMonarch(UUID ownerId) { + super(ownerId, 149, "Kavu Monarch", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Kavu creatures have trample. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(TrampleAbility.getInstance(), + Duration.WhileOnBattlefield, filter1))); + + // Whenever another Kavu enters the battlefield, put a +1/+1 counter on Kavu Monarch. + this.addAbility(new EntersBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter2)); + } + + public KavuMonarch(final KavuMonarch card) { + super(card); + } + + @Override + public KavuMonarch copy() { + return new KavuMonarch(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/KavuRunner.java b/Mage.Sets/src/mage/sets/invasion/KavuRunner.java new file mode 100644 index 00000000000..14a00fbb7b7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/KavuRunner.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class KavuRunner extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white or blue creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.BLUE))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public KavuRunner(UUID ownerId) { + super(ownerId, 150, "Kavu Runner", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Kavu Runner has haste as long as no opponent controls a white or blue creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), + Duration.WhileOnBattlefield), new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0, false)), + "{this} has haste as long as no opponent controls a white or blue creature"))); + } + + public KavuRunner(final KavuRunner card) { + super(card); + } + + @Override + public KavuRunner copy() { + return new KavuRunner(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/SkittishKavu.java b/Mage.Sets/src/mage/sets/invasion/SkittishKavu.java new file mode 100644 index 00000000000..d5d4ad43552 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/SkittishKavu.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.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +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.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; + +/** + * + * @author LoneFox + */ +public class SkittishKavu extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white or blue creature"); + + static { + filter.add(Predicates.or(new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.BLUE))); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public SkittishKavu(UUID ownerId) { + super(ownerId, 168, "Skittish Kavu", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Skittish Kavu gets +1/+1 as long as no opponent controls a white or blue creature. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), + new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter, CountType.MORE_THAN, 0, false)), + "{this} gets +1/+1 as long as no opponent controls a white or blue creature"))); + } + + public SkittishKavu(final SkittishKavu card) { + super(card); + } + + @Override + public SkittishKavu copy() { + return new SkittishKavu(this); + } +} From 8f68f2b7d521f7e97dbbcf59cb88e23ea8b39419 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 20 Jul 2015 19:34:58 +0200 Subject: [PATCH 6/8] * Fixed some exile zone names not showing the ID of the owning object. --- .../sets/avacynrestored/DarkImpostor.java | 21 +++++--- .../mage/sets/dragonsoftarkir/Silkwrap.java | 10 ++-- .../sets/journeyintonyx/BanishingLight.java | 11 ++-- .../sets/khansoftarkir/SuspensionField.java | 8 +-- .../mage/sets/magic2014/BanisherPriest.java | 3 +- .../mage/sets/magic2014/ColossalWhale.java | 2 +- .../sets/magic2015/ConstrictingSliver.java | 9 ++-- .../mage/sets/newphyrexia/KarnLiberated.java | 24 ++++----- .../sets/ravnica/SistersOfStoneDeath.java | 24 ++++----- .../mage/sets/theros/ChainedToTheRocks.java | 50 ++++++++++--------- 10 files changed, 84 insertions(+), 78 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DarkImpostor.java b/Mage.Sets/src/mage/sets/avacynrestored/DarkImpostor.java index 1748583e0db..d51cdecde77 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DarkImpostor.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DarkImpostor.java @@ -27,7 +27,7 @@ */ package mage.sets.avacynrestored; -import mage.constants.*; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.ActivatedAbility; @@ -40,17 +40,22 @@ import mage.abilities.effects.common.ImprintTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author noxx - + * */ public class DarkImpostor extends CardImpl { @@ -65,7 +70,7 @@ public class DarkImpostor extends CardImpl { // {4}{B}{B}: Exile target creature and put a +1/+1 counter on Dark Impostor.\ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ImprintTargetEffect(), new ManaCostsImpl("{4}{B}{B}")); - ability.addEffect(new ExileTargetEffect(null, "Dark Impostor")); + ability.addEffect(new ExileTargetEffect(null, this.getIdName())); ability.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance())); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); @@ -99,10 +104,10 @@ class DarkImpostorContinuousEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Permanent perm = game.getPermanent(source.getSourceId()); if (perm != null) { - for (UUID imprintedId: perm.getImprinted()) { + for (UUID imprintedId : perm.getImprinted()) { Card card = game.getCard(imprintedId); if (card != null) { - for (Ability ability: card.getAbilities()) { + for (Ability ability : card.getAbilities()) { if (ability instanceof ActivatedAbility) { perm.addAbility(ability, source.getSourceId(), game); } @@ -118,4 +123,4 @@ class DarkImpostorContinuousEffect extends ContinuousEffectImpl { return new DarkImpostorContinuousEffect(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/Silkwrap.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/Silkwrap.java index 450283ec59d..9af141380e4 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/Silkwrap.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/Silkwrap.java @@ -53,7 +53,7 @@ import mage.util.CardUtil; * @author jeffwadsworth */ public class Silkwrap extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost 3 or less an opponent controls"); static { @@ -69,8 +69,8 @@ public class Silkwrap extends CardImpl { Ability ability = new EntersBattlefieldTriggeredAbility(new SilkwrapEffect()); ability.addTarget(new TargetPermanent(filter)); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); - this.addAbility(ability); - + this.addAbility(ability); + } public Silkwrap(final Silkwrap card) { @@ -103,8 +103,8 @@ class SilkwrapEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BanishingLight.java b/Mage.Sets/src/mage/sets/journeyintonyx/BanishingLight.java index feaed29eaec..392e925c027 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/BanishingLight.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/BanishingLight.java @@ -53,21 +53,20 @@ import mage.util.CardUtil; public class BanishingLight extends CardImpl { private final static FilterNonlandPermanent filter = new FilterNonlandPermanent("nonland permanent an opponent controls"); - + static { filter.add(new ControllerPredicate(TargetController.OPPONENT)); - } - + } + public BanishingLight(UUID ownerId) { super(ownerId, 5, "Banishing Light", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.expansionSetCode = "JOU"; - // When Banishing Light enters the battlefield, exile target nonland permanent an opponent controls until Banishing Light leaves the battlefield. Ability ability = new EntersBattlefieldTriggeredAbility(new BanishingLightExileEffect()); ability.addTarget(new TargetPermanent(filter)); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); - this.addAbility(ability); + this.addAbility(ability); } public BanishingLight(final BanishingLight card) { @@ -102,7 +101,7 @@ class BanishingLightExileEffect extends OneShotEffect { // If Banishing Light leaves the battlefield before its triggered ability resolves, // the target won't be exiled. if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/SuspensionField.java b/Mage.Sets/src/mage/sets/khansoftarkir/SuspensionField.java index 419d131632d..087631b2a71 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/SuspensionField.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/SuspensionField.java @@ -53,15 +53,15 @@ import mage.util.CardUtil; public class SuspensionField extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with toughness 3 or greater"); + static { filter.add(new ToughnessPredicate(ComparisonType.GreaterThan, 2)); - } - + } + public SuspensionField(UUID ownerId) { super(ownerId, 25, "Suspension Field", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); this.expansionSetCode = "KTK"; - // When Suspension Field enters the battlefield, you may exile target creature with toughness 3 or greater until Suspension Field leaves the battlefield. Ability ability = new EntersBattlefieldTriggeredAbility(new SuspensionFieldExileEffect(), true); ability.addTarget(new TargetCreaturePermanent(filter)); @@ -101,7 +101,7 @@ class SuspensionFieldExileEffect extends OneShotEffect { Permanent sourcePermanent = game.getPermanent(source.getSourceId()); // If Suspension Field leaves the battlefield before its triggered ability resolves, the target won't be exiled. if (sourcePermanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), sourcePermanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), sourcePermanent.getIdName()).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2014/BanisherPriest.java b/Mage.Sets/src/mage/sets/magic2014/BanisherPriest.java index 6f3baeec946..f907e0226d6 100644 --- a/Mage.Sets/src/mage/sets/magic2014/BanisherPriest.java +++ b/Mage.Sets/src/mage/sets/magic2014/BanisherPriest.java @@ -54,6 +54,7 @@ import mage.util.CardUtil; public class BanisherPriest extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + static { filter.add(new ControllerPredicate(TargetController.OPPONENT)); } @@ -106,7 +107,7 @@ class BanisherPriestExileEffect extends OneShotEffect { // If Banisher Priest leaves the battlefield before its triggered ability resolves, // the target creature won't be exiled. if (permanent != null) { - return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java index 187439dba28..1838807ab83 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java +++ b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java @@ -146,7 +146,7 @@ class ColossalWhaleExileEffect extends OneShotEffect { // If Whale leaves the battlefield before its triggered ability resolves, // the target creature won't be exiled. if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/magic2015/ConstrictingSliver.java b/Mage.Sets/src/mage/sets/magic2015/ConstrictingSliver.java index 5e2e5682c94..e16e2afde9e 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ConstrictingSliver.java +++ b/Mage.Sets/src/mage/sets/magic2015/ConstrictingSliver.java @@ -64,7 +64,6 @@ public class ConstrictingSliver extends CardImpl { filterTarget.add(new ControllerPredicate(TargetController.OPPONENT)); } - public ConstrictingSliver(UUID ownerId) { super(ownerId, 7, "Constricting Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}"); this.expansionSetCode = "M15"; @@ -73,15 +72,15 @@ public class ConstrictingSliver extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - // Sliver creatures you control have "When this creature enters the battlefield, you may exile target creature an opponent controls + // Sliver creatures you control have "When this creature enters the battlefield, you may exile target creature an opponent controls // until this creature leaves the battlefield." Ability ability = new EntersBattlefieldTriggeredAbility(new ConstrictingSliverExileEffect(), true); ability.addTarget(new TargetCreaturePermanent(filterTarget)); ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, - Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver","Sliver creatures"), - "Sliver creatures you control have \"When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.\""))); + Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Sliver", "Sliver creatures"), + "Sliver creatures you control have \"When this creature enters the battlefield, you may exile target creature an opponent controls until this creature leaves the battlefield.\""))); } @@ -117,7 +116,7 @@ class ConstrictingSliverExileEffect extends OneShotEffect { // If the creature leaves the battlefield before its triggered ability resolves, // the target creature won't be exiled. if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); } return false; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java index 38deecc35fe..5b5a30d8035 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java @@ -75,12 +75,12 @@ public class KarnLiberated extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false)); // +4: Target player exiles a card from his or her hand. - LoyaltyAbility ability1 = new LoyaltyAbility(new ExileFromZoneTargetEffect(Zone.HAND, exileId, "Karn Liberated", new FilterCard()), 4); + LoyaltyAbility ability1 = new LoyaltyAbility(new ExileFromZoneTargetEffect(Zone.HAND, exileId, this.getIdName(), new FilterCard()), 4); ability1.addTarget(new TargetPlayer()); this.addAbility(ability1); // -3: Exile target permanent. - LoyaltyAbility ability2 = new LoyaltyAbility(new ExileTargetEffect(exileId, "Karn Liberated"), -3); + LoyaltyAbility ability2 = new LoyaltyAbility(new ExileTargetEffect(exileId, this.getIdName()), -3); ability2.addTarget(new TargetPermanent()); this.addAbility(ability2); @@ -120,9 +120,9 @@ class KarnLiberatedEffect extends OneShotEffect { return false; } List cards = new ArrayList<>(); - for (ExileZone zone: game.getExile().getExileZones()) { + for (ExileZone zone : game.getExile().getExileZones()) { if (zone.getId().equals(exileId)) { - for (Card card: zone.getCards(game)) { + for (Card card : zone.getCards(game)) { if (!card.getSubtype().contains("Aura") && CardUtil.isPermanentCard(card)) { cards.add(card); } @@ -130,15 +130,15 @@ class KarnLiberatedEffect extends OneShotEffect { } } game.getState().clear(); - for (Card card: game.getCards()) { + for (Card card : game.getCards()) { game.getState().addCard(card); } - for (Player player: game.getPlayers().values()) { + for (Player player : game.getPlayers().values()) { player.getGraveyard().clear(); player.getHand().clear(); player.getLibrary().clear(); - for (Card card: game.getCards()) { - if (card.getOwnerId().equals(player.getId()) && !card.isCopy() // no copies + for (Card card : game.getCards()) { + if (card.getOwnerId().equals(player.getId()) && !card.isCopy() // no copies && !player.getSideboard().contains(card.getId()) && !cards.contains(card)) { // not the exiled cards player.getLibrary().putOnTop(card, game); @@ -146,8 +146,8 @@ class KarnLiberatedEffect extends OneShotEffect { } player.init(game); } - for (Card card: cards) { - if ( CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura") ) { + for (Card card : cards) { + if (CardUtil.isPermanentCard(card) && !card.getSubtype().contains("Aura")) { game.getExile().add(exileId, sourceObject.getIdName(), card); } } @@ -215,10 +215,10 @@ class KarnLiberatedDelayedEffect extends OneShotEffect { if (exile != null) { Cards cards = new CardsImpl(); // needed because putOntoTheBattlefield removes from exile cards.addAll(exile); - for (Card card: cards.getCards(game)) { + for (Card card : cards.getCards(game)) { card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId()); Permanent permanent = game.getPermanent(card.getId()); - ((PermanentImpl)permanent).removeSummoningSickness(); + ((PermanentImpl) permanent).removeSummoningSickness(); } return true; } diff --git a/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java b/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java index 1c74a4d7b71..200188ec098 100644 --- a/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java +++ b/Mage.Sets/src/mage/sets/ravnica/SistersOfStoneDeath.java @@ -59,16 +59,14 @@ import mage.target.common.TargetCreaturePermanent; * @author jeffwadsworth */ public class SistersOfStoneDeath extends CardImpl { - + private UUID exileId = UUID.randomUUID(); - + public SistersOfStoneDeath(UUID ownerId) { super(ownerId, 231, "Sisters of Stone Death", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{G}{G}"); this.expansionSetCode = "RAV"; this.supertype.add("Legendary"); this.subtype.add("Gorgon"); - - this.power = new MageInt(7); this.toughness = new MageInt(5); @@ -79,7 +77,7 @@ public class SistersOfStoneDeath extends CardImpl { this.addAbility(ability); // {B}{G}: Exile target creature blocking or blocked by Sisters of Stone Death. - Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(exileId, "Sisters Of Stone Death"), new ManaCostsImpl("{B}{G}")); + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(exileId, this.getIdName()), new ManaCostsImpl("{B}{G}")); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature blocking or blocked by Sisters of Stone Death"); filter.add(Predicates.or(new BlockedByIdPredicate(this.getId()), new BlockingAttackerIdPredicate(this.getId()))); @@ -88,13 +86,13 @@ public class SistersOfStoneDeath extends CardImpl { // {2}{B}: Put a creature card exiled with Sisters of Stone Death onto the battlefield under your control. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SistersOfStoneDeathEffect(exileId), new ManaCostsImpl("{2}{B}"))); - + } - + public SistersOfStoneDeath(final SistersOfStoneDeath card) { super(card); } - + @Override public SistersOfStoneDeath copy() { return new SistersOfStoneDeath(this); @@ -102,20 +100,20 @@ public class SistersOfStoneDeath extends CardImpl { } class SistersOfStoneDeathEffect extends OneShotEffect { - + private UUID exileId; - + public SistersOfStoneDeathEffect(UUID exileId) { super(Outcome.PutCreatureInPlay); this.exileId = exileId; staticText = "Put a creature card exiled with {this} onto the battlefield under your control"; } - + public SistersOfStoneDeathEffect(final SistersOfStoneDeathEffect effect) { super(effect); this.exileId = effect.exileId; } - + @Override public boolean apply(Game game, Ability source) { CardsImpl cardsInExile = new CardsImpl(); @@ -137,7 +135,7 @@ class SistersOfStoneDeathEffect extends OneShotEffect { } return false; } - + @Override public SistersOfStoneDeathEffect copy() { return new SistersOfStoneDeathEffect(this); diff --git a/Mage.Sets/src/mage/sets/theros/ChainedToTheRocks.java b/Mage.Sets/src/mage/sets/theros/ChainedToTheRocks.java index a5d3a0e0246..2a8dd53f012 100644 --- a/Mage.Sets/src/mage/sets/theros/ChainedToTheRocks.java +++ b/Mage.Sets/src/mage/sets/theros/ChainedToTheRocks.java @@ -52,33 +52,37 @@ import mage.target.common.TargetCreaturePermanent; import mage.util.CardUtil; /** - * If the land Chained to the Rocks is enchanting stops being a Mountain or another player - * gains control of it, Chained to the Rocks will be put into its owner's graveyard when - * state-based actions are performed. + * If the land Chained to the Rocks is enchanting stops being a Mountain or + * another player gains control of it, Chained to the Rocks will be put into its + * owner's graveyard when state-based actions are performed. * - * Chained to the Rocks's ability causes a zone change with a duration, a style of ability - * introduced in Magic 2014 that's somewhat reminiscent of older cards like Oblivion Ring. - * However, unlike Oblivion Ring, cards like Chained to the Rocks have a single ability - * that creates two one-shot effects: one that exiles the creature when the ability resolves, - * and another that returns the exiled card to the battlefield immediately after Chained to - * the Rocks leaves the battlefield. + * Chained to the Rocks's ability causes a zone change with a duration, a style + * of ability introduced in Magic 2014 that's somewhat reminiscent of older + * cards like Oblivion Ring. However, unlike Oblivion Ring, cards like Chained + * to the Rocks have a single ability that creates two one-shot effects: one + * that exiles the creature when the ability resolves, and another that returns + * the exiled card to the battlefield immediately after Chained to the Rocks + * leaves the battlefield. * - * If Chained to the Rocks leaves the battlefield before its triggered ability resolves, - * the target creature won't be exiled. + * If Chained to the Rocks leaves the battlefield before its triggered ability + * resolves, the target creature won't be exiled. * - * Auras attached to the exiled creature will be put into their owners' graveyards (unless - * they have bestow). Equipment attached to the exiled creature will become unattached and - * remain on the battlefield. Any counters on the exiled creature will cease to exist. + * Auras attached to the exiled creature will be put into their owners' + * graveyards (unless they have bestow). Equipment attached to the exiled + * creature will become unattached and remain on the battlefield. Any counters + * on the exiled creature will cease to exist. * - * If a creature token is exiled, it ceases to exist. It won't be returned to the battlefield. + * If a creature token is exiled, it ceases to exist. It won't be returned to + * the battlefield. * - * The exiled card returns to the battlefield immediately after Chained to the Rocks leaves - * the battlefield. Nothing happens between the two events, including state-based actions. + * The exiled card returns to the battlefield immediately after Chained to the + * Rocks leaves the battlefield. Nothing happens between the two events, + * including state-based actions. * - * In a multiplayer game, if Chained to the Rocks's owner leaves the game, the exiled card - * will return to the battlefield. Because the one-shot effect that returns the card isn't - * an ability that goes on the stack, it won't cease to exist along with the leaving player's - * spells and abilities on the stack. + * In a multiplayer game, if Chained to the Rocks's owner leaves the game, the + * exiled card will return to the battlefield. Because the one-shot effect that + * returns the card isn't an ability that goes on the stack, it won't cease to + * exist along with the leaving player's spells and abilities on the stack. * * @author LevelX2 */ @@ -86,6 +90,7 @@ public class ChainedToTheRocks extends CardImpl { private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Mountain you control"); private static final FilterCreaturePermanent filterTarget = new FilterCreaturePermanent("creature an opponent controls"); + static { filter.add(new SubtypePredicate("Mountain")); filterTarget.add(new ControllerPredicate(TargetController.OPPONENT)); @@ -96,7 +101,6 @@ public class ChainedToTheRocks extends CardImpl { this.expansionSetCode = "THS"; this.subtype.add("Aura"); - // Enchant Mountain you control TargetPermanent auraTarget = new TargetPermanent(filter); this.getSpellAbility().addTarget(auraTarget); @@ -144,7 +148,7 @@ class ChainedToTheRocksEffect extends OneShotEffect { // If Chained to the Rocks leaves the battlefield before its triggered ability resolves, // the target creature won't be exiled. if (permanent != null) { - return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getName()).apply(game, source); + return new ExileTargetEffect(CardUtil.getCardExileZoneId(game, source), permanent.getIdName()).apply(game, source); } return false; } From 2c3790b70e8814b9e1df8e31053bd3288d68e270 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 21:06:51 +0300 Subject: [PATCH 7/8] Remove basic lands from boosters that are not supposed to have them. Implement the timeshifted slot of Time Spiral boosters. TODO: Planar Chaos with its "planeshifted" card slots --- .../src/mage/sets/ChampionsOfKamigawa.java | 4 ++-- .../src/mage/sets/ClassicSixthEdition.java | 4 ++-- Mage.Sets/src/mage/sets/FifthEdition.java | 6 ++--- Mage.Sets/src/mage/sets/FourthEdition.java | 4 ++-- Mage.Sets/src/mage/sets/FutureSight.java | 4 ++-- Mage.Sets/src/mage/sets/IceAge.java | 4 ++-- Mage.Sets/src/mage/sets/Invasion.java | 6 ++--- Mage.Sets/src/mage/sets/Judgment.java | 6 ++--- Mage.Sets/src/mage/sets/Legends.java | 4 ++-- .../src/mage/sets/LimitedEditionAlpha.java | 4 ++-- .../src/mage/sets/LimitedEditionBeta.java | 4 ++-- Mage.Sets/src/mage/sets/Lorwyn.java | 4 ++-- Mage.Sets/src/mage/sets/MercadianMasques.java | 4 ++-- Mage.Sets/src/mage/sets/Mirage.java | 4 ++-- Mage.Sets/src/mage/sets/Mirrodin.java | 4 ++-- Mage.Sets/src/mage/sets/Odyssey.java | 4 ++-- Mage.Sets/src/mage/sets/Onslaught.java | 6 ++--- .../src/mage/sets/RavnicaCityOfGuilds.java | 4 ++-- Mage.Sets/src/mage/sets/RevisedEdition.java | 4 ++-- Mage.Sets/src/mage/sets/Shadowmoor.java | 4 ++-- Mage.Sets/src/mage/sets/Tempest.java | 4 ++-- Mage.Sets/src/mage/sets/TimeSpiral.java | 23 +++++++++++++++---- Mage.Sets/src/mage/sets/UrzasDestiny.java | 4 ++-- Mage.Sets/src/mage/sets/UrzasLegacy.java | 4 ++-- Mage.Sets/src/mage/sets/UrzasSaga.java | 4 ++-- Mage.Sets/src/mage/sets/Weatherlight.java | 4 ++-- Mage/src/mage/cards/ExpansionSet.java | 2 +- 27 files changed, 73 insertions(+), 60 deletions(-) diff --git a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java index ee0847dea9f..bd5d6bdda63 100644 --- a/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java +++ b/Mage.Sets/src/mage/sets/ChampionsOfKamigawa.java @@ -15,8 +15,8 @@ public class ChampionsOfKamigawa extends ExpansionSet { super("Champions of Kamigawa", "CHK", "mage.sets.championsofkamigawa", new GregorianCalendar(2004, 9, 1).getTime(), SetType.EXPANSION); this.blockName = "Kamigawa"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java index f8b987af32f..543300a0f50 100644 --- a/Mage.Sets/src/mage/sets/ClassicSixthEdition.java +++ b/Mage.Sets/src/mage/sets/ClassicSixthEdition.java @@ -47,8 +47,8 @@ public class ClassicSixthEdition extends ExpansionSet { private ClassicSixthEdition() { super("Classic Sixth Edition", "6ED", "mage.sets.classicsixthedition", new GregorianCalendar(1999, 3, 28).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/FifthEdition.java b/Mage.Sets/src/mage/sets/FifthEdition.java index 56b9d933fc4..5f3a0b10e3b 100644 --- a/Mage.Sets/src/mage/sets/FifthEdition.java +++ b/Mage.Sets/src/mage/sets/FifthEdition.java @@ -15,11 +15,11 @@ public class FifthEdition extends ExpansionSet { private FifthEdition() { super("Fifth Edition", "5ED", "mage.sets.fifthedition", new GregorianCalendar(1997, 3, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/FourthEdition.java b/Mage.Sets/src/mage/sets/FourthEdition.java index 46b0f5a8906..624d4519eb2 100644 --- a/Mage.Sets/src/mage/sets/FourthEdition.java +++ b/Mage.Sets/src/mage/sets/FourthEdition.java @@ -47,8 +47,8 @@ public class FourthEdition extends ExpansionSet { private FourthEdition() { super("Fourth Edition", "4ED", "mage.sets.fourthedition", new GregorianCalendar(1995, 3, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/FutureSight.java b/Mage.Sets/src/mage/sets/FutureSight.java index ca70d3b350d..30444985c8f 100644 --- a/Mage.Sets/src/mage/sets/FutureSight.java +++ b/Mage.Sets/src/mage/sets/FutureSight.java @@ -49,8 +49,8 @@ public class FutureSight extends ExpansionSet { this.parentSet = TimeSpiral.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/IceAge.java b/Mage.Sets/src/mage/sets/IceAge.java index 0612030775c..3ef48130795 100644 --- a/Mage.Sets/src/mage/sets/IceAge.java +++ b/Mage.Sets/src/mage/sets/IceAge.java @@ -48,8 +48,8 @@ public class IceAge extends ExpansionSet { super("Ice Age", "ICE", "mage.sets.iceage", new GregorianCalendar(1995, 5, 1).getTime(), SetType.EXPANSION); this.blockName = "Ice Age"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Invasion.java b/Mage.Sets/src/mage/sets/Invasion.java index 98588fb7648..8e9290f7724 100644 --- a/Mage.Sets/src/mage/sets/Invasion.java +++ b/Mage.Sets/src/mage/sets/Invasion.java @@ -46,10 +46,10 @@ public class Invasion extends ExpansionSet { super("Invasion", "INV", "mage.sets.invasion", new GregorianCalendar(2000, 9, 2).getTime(), SetType.EXPANSION); this.blockName = "Invasion"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/Judgment.java b/Mage.Sets/src/mage/sets/Judgment.java index 4b25afcd4e6..3614c778829 100644 --- a/Mage.Sets/src/mage/sets/Judgment.java +++ b/Mage.Sets/src/mage/sets/Judgment.java @@ -49,10 +49,10 @@ public class Judgment extends ExpansionSet { this.parentSet = Odyssey.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/Legends.java b/Mage.Sets/src/mage/sets/Legends.java index cdc9935d03a..b5307e817fa 100644 --- a/Mage.Sets/src/mage/sets/Legends.java +++ b/Mage.Sets/src/mage/sets/Legends.java @@ -48,8 +48,8 @@ public class Legends extends ExpansionSet { super("Legends", "LEG", "mage.sets.legends", new GregorianCalendar(1994, 5, 1).getTime(), SetType.EXPANSION); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java b/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java index fb93b406110..467f742fd0d 100644 --- a/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java +++ b/Mage.Sets/src/mage/sets/LimitedEditionAlpha.java @@ -20,8 +20,8 @@ public class LimitedEditionAlpha extends ExpansionSet { private LimitedEditionAlpha() { super("Limited Edition Alpha", "LEA", "mage.sets.limitedalpha", new GregorianCalendar(1993, 7, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/LimitedEditionBeta.java b/Mage.Sets/src/mage/sets/LimitedEditionBeta.java index 599ae25cf32..dfd8189ced3 100644 --- a/Mage.Sets/src/mage/sets/LimitedEditionBeta.java +++ b/Mage.Sets/src/mage/sets/LimitedEditionBeta.java @@ -20,8 +20,8 @@ public class LimitedEditionBeta extends ExpansionSet { private LimitedEditionBeta() { super("Limited Edition Beta", "LEB", "mage.sets.limitedbeta", new GregorianCalendar(1993, 9, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Lorwyn.java b/Mage.Sets/src/mage/sets/Lorwyn.java index cac08597c78..011e1b6180e 100644 --- a/Mage.Sets/src/mage/sets/Lorwyn.java +++ b/Mage.Sets/src/mage/sets/Lorwyn.java @@ -47,8 +47,8 @@ public class Lorwyn extends ExpansionSet { super("Lorwyn", "LRW", "mage.sets.lorwyn", new GregorianCalendar(2007, 9, 12).getTime(), SetType.EXPANSION); this.blockName = "Lorwyn"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index 7182d87bc46..dc1d00790f8 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -48,8 +48,8 @@ public class MercadianMasques extends ExpansionSet { super("Mercadian Masques", "MMQ", "mage.sets.mercadianmasques", new GregorianCalendar(1999, 8, 25).getTime(), SetType.EXPANSION); this.blockName = "Masques"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Mirage.java b/Mage.Sets/src/mage/sets/Mirage.java index 7bdbf7c12dc..9d40be18729 100644 --- a/Mage.Sets/src/mage/sets/Mirage.java +++ b/Mage.Sets/src/mage/sets/Mirage.java @@ -47,8 +47,8 @@ public class Mirage extends ExpansionSet { super("Mirage", "MIR", "mage.sets.mirage", new GregorianCalendar(1996, 8, 21).getTime(), SetType.EXPANSION); this.blockName = "Mirage"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Mirrodin.java b/Mage.Sets/src/mage/sets/Mirrodin.java index 92f3cdb2c9c..82d6d416541 100644 --- a/Mage.Sets/src/mage/sets/Mirrodin.java +++ b/Mage.Sets/src/mage/sets/Mirrodin.java @@ -16,8 +16,8 @@ public class Mirrodin extends ExpansionSet { super("Mirrodin", "MRD", "mage.sets.mirrodin", new GregorianCalendar(2003, 9, 2).getTime(), SetType.EXPANSION); this.blockName = "Mirrodin"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Odyssey.java b/Mage.Sets/src/mage/sets/Odyssey.java index 6eea1098284..b962188d4e7 100644 --- a/Mage.Sets/src/mage/sets/Odyssey.java +++ b/Mage.Sets/src/mage/sets/Odyssey.java @@ -47,8 +47,8 @@ public class Odyssey extends ExpansionSet { super("Odyssey", "ODY", "mage.sets.odyssey", new GregorianCalendar(2001, 9, 22).getTime(), SetType.EXPANSION); this.blockName = "Odyssey"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Onslaught.java b/Mage.Sets/src/mage/sets/Onslaught.java index c3ca10d05d0..e1e64cb4754 100644 --- a/Mage.Sets/src/mage/sets/Onslaught.java +++ b/Mage.Sets/src/mage/sets/Onslaught.java @@ -16,10 +16,10 @@ public class Onslaught extends ExpansionSet { super("Onslaught", "ONS", "mage.sets.onslaught", new GregorianCalendar(2002, 10, 7).getTime(), SetType.EXPANSION); this.blockName = "Onslaught"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java index b0c4cfaffd0..f9f0f39e511 100644 --- a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java +++ b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java @@ -48,8 +48,8 @@ public class RavnicaCityOfGuilds extends ExpansionSet { super("Ravnica: City of Guilds", "RAV", "mage.sets.ravnica", new GregorianCalendar(2005, 9, 24).getTime(), SetType.EXPANSION); this.blockName = "Ravnica"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/RevisedEdition.java b/Mage.Sets/src/mage/sets/RevisedEdition.java index 585abbfc50a..9a39ecc2686 100644 --- a/Mage.Sets/src/mage/sets/RevisedEdition.java +++ b/Mage.Sets/src/mage/sets/RevisedEdition.java @@ -20,8 +20,8 @@ public class RevisedEdition extends ExpansionSet { private RevisedEdition() { super("Revised Edition", "3ED", "mage.sets.revisededition", new GregorianCalendar(1994, 3, 1).getTime(), SetType.CORE); this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Shadowmoor.java b/Mage.Sets/src/mage/sets/Shadowmoor.java index f6c6627905d..855d14b372c 100644 --- a/Mage.Sets/src/mage/sets/Shadowmoor.java +++ b/Mage.Sets/src/mage/sets/Shadowmoor.java @@ -47,8 +47,8 @@ public class Shadowmoor extends ExpansionSet { super("Shadowmoor", "SHM", "mage.sets.shadowmoor", new GregorianCalendar(2008, 4, 2).getTime(), SetType.EXPANSION); this.blockName = "Shadowmoor"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Tempest.java b/Mage.Sets/src/mage/sets/Tempest.java index 28249cb07db..8ac10ab2a21 100644 --- a/Mage.Sets/src/mage/sets/Tempest.java +++ b/Mage.Sets/src/mage/sets/Tempest.java @@ -16,8 +16,8 @@ public class Tempest extends ExpansionSet { super("Tempest", "TMP", "mage.sets.tempest", new GregorianCalendar(1997, 9, 1).getTime(), SetType.EXPANSION); this.blockName = "Tempest"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/TimeSpiral.java b/Mage.Sets/src/mage/sets/TimeSpiral.java index 98aa18145ab..6ac46687ed2 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiral.java +++ b/Mage.Sets/src/mage/sets/TimeSpiral.java @@ -1,9 +1,13 @@ package mage.sets; -import mage.cards.ExpansionSet; -import mage.constants.SetType; - import java.util.GregorianCalendar; +import java.util.List; +import mage.cards.Card; +import mage.cards.ExpansionSet; +import mage.cards.repository.CardCriteria; +import mage.cards.repository.CardRepository; +import mage.constants.Rarity; +import mage.constants.SetType; public class TimeSpiral extends ExpansionSet { @@ -17,10 +21,19 @@ public class TimeSpiral extends ExpansionSet { super("Time Spiral", "TSP", "mage.sets.timespiral", new GregorianCalendar(2006, 9, 9).getTime(), SetType.EXPANSION); this.blockName = "Time Spiral"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 11; + this.numBoosterLands = 0; + this.numBoosterCommon = 10; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; } + + @Override + public List createBooster() { + List booster = super.createBooster(); + CardCriteria criteria = new CardCriteria(); + criteria.rarities(Rarity.SPECIAL).setCodes("TSB"); + addToBooster(booster, CardRepository.instance.findCards(criteria)); + return booster; + } } diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index e0fcdbdebef..8a71f5e2e6f 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -49,8 +49,8 @@ public class UrzasDestiny extends ExpansionSet { this.parentSet = UrzasSaga.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/UrzasLegacy.java b/Mage.Sets/src/mage/sets/UrzasLegacy.java index 3d4fef267ad..c56402921e2 100644 --- a/Mage.Sets/src/mage/sets/UrzasLegacy.java +++ b/Mage.Sets/src/mage/sets/UrzasLegacy.java @@ -51,8 +51,8 @@ public class UrzasLegacy extends ExpansionSet { this.parentSet = UrzasSaga.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/UrzasSaga.java b/Mage.Sets/src/mage/sets/UrzasSaga.java index 9187caf4678..2ff9831caca 100644 --- a/Mage.Sets/src/mage/sets/UrzasSaga.java +++ b/Mage.Sets/src/mage/sets/UrzasSaga.java @@ -48,8 +48,8 @@ public class UrzasSaga extends ExpansionSet { super("Urza's Saga", "USG", "mage.sets.urzassaga", new GregorianCalendar(1998, 10, 1).getTime(), SetType.EXPANSION); this.blockName = "Urza"; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage.Sets/src/mage/sets/Weatherlight.java b/Mage.Sets/src/mage/sets/Weatherlight.java index 6020c0bf36c..9931163de2f 100644 --- a/Mage.Sets/src/mage/sets/Weatherlight.java +++ b/Mage.Sets/src/mage/sets/Weatherlight.java @@ -51,8 +51,8 @@ public class Weatherlight extends ExpansionSet { this.parentSet = Mirage.getInstance(); this.hasBasicLands = false; this.hasBoosters = true; - this.numBoosterLands = 1; - this.numBoosterCommon = 10; + this.numBoosterLands = 0; + this.numBoosterCommon = 11; this.numBoosterUncommon = 3; this.numBoosterRare = 1; this.ratioBoosterMythic = 0; diff --git a/Mage/src/mage/cards/ExpansionSet.java b/Mage/src/mage/cards/ExpansionSet.java index 4c5b9249fcc..a7b968c724c 100644 --- a/Mage/src/mage/cards/ExpansionSet.java +++ b/Mage/src/mage/cards/ExpansionSet.java @@ -257,7 +257,7 @@ public abstract class ExpansionSet implements Serializable { } } - private void addToBooster(List booster, List cards) { + protected void addToBooster(List booster, List cards) { if (!cards.isEmpty()) { CardInfo cardInfo = cards.remove(rnd.nextInt(cards.size())); if (cardInfo != null) { From eb7ca3788a78ed8843181785a7b5f0a4240759ca Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 20 Jul 2015 22:09:36 +0200 Subject: [PATCH 8/8] * Recovery added missing check for creature type. --- Mage/src/mage/abilities/keyword/RecoverAbility.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage/src/mage/abilities/keyword/RecoverAbility.java b/Mage/src/mage/abilities/keyword/RecoverAbility.java index 6b6c47b52ef..bd8cbb938d3 100644 --- a/Mage/src/mage/abilities/keyword/RecoverAbility.java +++ b/Mage/src/mage/abilities/keyword/RecoverAbility.java @@ -77,6 +77,7 @@ public class RecoverAbility extends TriggeredAbilityImpl { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) { if (zEvent.getTarget().getOwnerId().equals(getControllerId()) + && zEvent.getTarget().getCardType().contains(CardType.CREATURE) && !zEvent.getTarget().getId().equals(getSourceId())) { return true; }