From ad8358a495b8c8a63917067e72416af41909c2ee Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 12:10:05 +0300 Subject: [PATCH 1/6] 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 0000000000..94644acdf1 --- /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 0000000000..50cd28ade0 --- /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 0000000000..787126a6cc --- /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/6] 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 911d57ec0d..9c8f2b2265 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 07129d69f2..d536c5102c 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 0000000000..ad0cacc5e6 --- /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 0000000000..f7f89e62e8 --- /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/6] 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 0000000000..6012dd2abe --- /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 0000000000..1f81dac24a --- /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 0000000000..d0eaf0d459 --- /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 0000000000..876e3724c0 --- /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 3248596ce0..abe026812b 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 0000000000..18d3bf592a --- /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 76273506c4..bf1fac671b 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 0000000000..4c58bf38f5 --- /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/6] 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 94644acdf1..96baa61d2d 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/6] 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 0000000000..131fc3391f --- /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 0000000000..1a4cd91645 --- /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 0000000000..14a00fbb7b --- /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 0000000000..d5d4ad4355 --- /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 2c3790b70e8814b9e1df8e31053bd3288d68e270 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Mon, 20 Jul 2015 21:06:51 +0300 Subject: [PATCH 6/6] 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 ee0847dea9..bd5d6bdda6 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 f8b987af32..543300a0f5 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 56b9d933fc..5f3a0b10e3 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 46b0f5a890..624d4519eb 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 ca70d3b350..30444985c8 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 0612030775..3ef4813079 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 98588fb764..8e9290f772 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 4b25afcd4e..3614c77882 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 cdc9935d03..b5307e817f 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 fb93b40611..467f742fd0 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 599ae25cf3..dfd8189ced 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 cac08597c7..011e1b6180 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 7182d87bc4..dc1d00790f 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 7bdbf7c12d..9d40be1872 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 92f3cdb2c9..82d6d41654 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 6eea109828..b962188d4e 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 c3ca10d05d..e1e64cb475 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 b0c4cfaffd..f9f0f39e51 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 585abbfc50..9a39ecc268 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 f6c6627905..855d14b372 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 28249cb07d..8ac10ab2a2 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 98aa18145a..6ac46687ed 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 e0fcdbdebe..8a71f5e2e6 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 3d4fef267a..c56402921e 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 9187caf467..2ff9831cac 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 6020c0bf36..9931163de2 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 4c5b9249fc..a7b968c724 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) {