From e2ab41601594c26a731cf7c646d7b3804049ef3a Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 1 Oct 2015 13:20:15 +0300 Subject: [PATCH 1/6] Implement the Eidolon cycle from Dissension --- .../mage/sets/dissension/AuroraEidolon.java | 84 ++++++++++++++++++ .../mage/sets/dissension/EnigmaEidolon.java | 83 +++++++++++++++++ .../mage/sets/dissension/EntropicEidolon.java | 88 +++++++++++++++++++ .../sets/dissension/SandstormEidolon.java | 84 ++++++++++++++++++ .../mage/sets/dissension/VerdantEidolon.java | 82 +++++++++++++++++ 5 files changed, 421 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java create mode 100644 Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java create mode 100644 Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java create mode 100644 Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java create mode 100644 Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java diff --git a/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java b/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.java new file mode 100644 index 0000000000..a27927a02e --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/AuroraEidolon.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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author LoneFox + */ +public class AuroraEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public AuroraEidolon(UUID ownerId) { + super(ownerId, 1, "Aurora Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {W}, Sacrifice Aurora Eidolon: Prevent the next 3 damage that would be dealt to target creature or player this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 3), new ManaCostsImpl("{W}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Aurora Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public AuroraEidolon(final AuroraEidolon card) { + super(card); + } + + @Override + public AuroraEidolon copy() { + return new AuroraEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java b/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.java new file mode 100644 index 0000000000..74fd14bf74 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EnigmaEidolon.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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class EnigmaEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public EnigmaEidolon(UUID ownerId) { + super(ownerId, 24, "Enigma Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {U}, Sacrifice Enigma Eidolon: Target player puts the top three cards of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(3), new ManaCostsImpl("{U}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Enigma Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public EnigmaEidolon(final EnigmaEidolon card) { + super(card); + } + + @Override + public EnigmaEidolon copy() { + return new EnigmaEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java b/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.java new file mode 100644 index 0000000000..46daa29c5e --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EntropicEidolon.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.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class EntropicEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public EntropicEidolon(UUID ownerId) { + super(ownerId, 45, "Entropic Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}, Sacrifice Entropic Eidolon: Target player loses 1 life and you gain 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), new ManaCostsImpl("{B}")); + Effect effect = new GainLifeEffect(1); + effect.setText("and you gain 1 life"); + ability.addEffect(effect); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Entropic Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public EntropicEidolon(final EntropicEidolon card) { + super(card); + } + + @Override + public EntropicEidolon copy() { + return new EntropicEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java b/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.java new file mode 100644 index 0000000000..67d9b679a8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/SandstormEidolon.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.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.effects.common.combat.CantBlockTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SandstormEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public SandstormEidolon(UUID ownerId) { + super(ownerId, 70, "Sandstorm Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}, Sacrifice Sandstorm Eidolon: Target creature can't block this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Sandstorm Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public SandstormEidolon(final SandstormEidolon card) { + super(card); + } + + @Override + public SandstormEidolon copy() { + return new SandstormEidolon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java b/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java new file mode 100644 index 0000000000..2f801f8351 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/VerdantEidolon.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AddManaOfAnyColorEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; + +/** + * + * @author LoneFox + */ +public class VerdantEidolon extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + + public VerdantEidolon(UUID ownerId) { + super(ownerId, 100, "Verdant Eidolon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {G}, Sacrifice Verdant Eidolon: Add three mana of any one color to your mana pool. + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new ManaCostsImpl("{G}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + // Whenever you cast a multicolored spell, you may return Verdant Eidolon from your graveyard to your hand. + this.addAbility(new SpellCastControllerTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, false)); + } + + public VerdantEidolon(final VerdantEidolon card) { + super(card); + } + + @Override + public VerdantEidolon copy() { + return new VerdantEidolon(this); + } +} From 0cdbf8cca09843fd22150f66a8ad1305399aa848 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 1 Oct 2015 16:58:37 +0300 Subject: [PATCH 2/6] Kill some unnecessary custom effects --- .../sets/alarareborn/GloryscaleViashino.java | 53 +++++-------------- .../mage/sets/returntoravnica/LobberCrew.java | 50 ++++------------- .../sets/returntoravnica/Pyroconvergence.java | 53 +++++-------------- 3 files changed, 35 insertions(+), 121 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java index 7d87143fc8..cb81497e51 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java +++ b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java @@ -30,17 +30,14 @@ package mage.sets.alarareborn; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; /** * @@ -48,17 +45,23 @@ import mage.game.stack.Spell; */ public class GloryscaleViashino extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public GloryscaleViashino (UUID ownerId) { super(ownerId, 120, "Gloryscale Viashino", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}"); this.expansionSetCode = "ARB"; this.subtype.add("Viashino"); this.subtype.add("Soldier"); - - this.power = new MageInt(3); this.toughness = new MageInt(3); - this.addAbility(new GloryscaleViashinoAbility()); + + // Whenever you cast a multicolored spell, Gloryscale Viashino gets +3/+3 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(3, 3, Duration.EndOfTurn), filter, false)); } public GloryscaleViashino (final GloryscaleViashino card) { @@ -69,36 +72,4 @@ public class GloryscaleViashino extends CardImpl { public GloryscaleViashino copy() { return new GloryscaleViashino(this); } - } - -class GloryscaleViashinoAbility extends TriggeredAbilityImpl { - public GloryscaleViashinoAbility() { - super(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.EndOfTurn)); - } - - public GloryscaleViashinoAbility(final GloryscaleViashinoAbility ability) { - super(ability); - } - - @Override - public GloryscaleViashinoAbility copy() { - return new GloryscaleViashinoAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, {this} gets +3/+3 until end of turn."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java index 570c89917f..7eed6965be 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java @@ -30,8 +30,8 @@ package mage.sets.returntoravnica; import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DamagePlayersEffect; import mage.abilities.effects.common.UntapSourceEffect; @@ -41,10 +41,8 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; /** * @@ -52,6 +50,12 @@ import mage.game.stack.Spell; */ public class LobberCrew extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public LobberCrew (UUID ownerId) { super(ownerId, 99, "Lobber Crew", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.expansionSetCode = "RTR"; @@ -66,7 +70,7 @@ public class LobberCrew extends CardImpl { // {T}: Lobber Crew deals 1 damage to each opponent. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT), new TapSourceCost())); // Whenever you cast a multicolored spell, untap Lobber Crew. - this.addAbility(new LobberCrewTriggeredAbility()); + this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false)); } public LobberCrew (final LobberCrew card) { @@ -78,37 +82,3 @@ public class LobberCrew extends CardImpl { return new LobberCrew(this); } } - -class LobberCrewTriggeredAbility extends TriggeredAbilityImpl { - public LobberCrewTriggeredAbility() { - super(Zone.BATTLEFIELD, new UntapSourceEffect()); - } - - public LobberCrewTriggeredAbility(final LobberCrewTriggeredAbility ability) { - super(ability); - } - - @Override - public LobberCrewTriggeredAbility copy() { - return new LobberCrewTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) { - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, untap {this}."; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java index a001e95d09..c29cdab9da 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java @@ -29,16 +29,14 @@ package mage.sets.returntoravnica; import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.MulticoloredPredicate; import mage.target.common.TargetCreatureOrPlayer; /** @@ -47,13 +45,20 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class Pyroconvergence extends CardImpl { + private static final FilterSpell filter = new FilterSpell("a multicolored spell"); + + static { + filter.add(new MulticoloredPredicate()); + } + public Pyroconvergence(UUID ownerId) { super(ownerId, 103, "Pyroconvergence", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}"); this.expansionSetCode = "RTR"; - // Whenever you cast a multicolored spell, Pyroconvergence deals 2 damage to target creature or player. - this.addAbility(new PyroconvergenceTriggeredAbility()); + Ability ability = new SpellCastControllerTriggeredAbility(new DamageTargetEffect(2), filter, false); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); } public Pyroconvergence(final Pyroconvergence card) { @@ -65,35 +70,3 @@ public class Pyroconvergence extends CardImpl { return new Pyroconvergence(this); } } -class PyroconvergenceTriggeredAbility extends TriggeredAbilityImpl { - public PyroconvergenceTriggeredAbility() { - super(Zone.BATTLEFIELD, new DamageTargetEffect(2)); - TargetCreatureOrPlayer target = new TargetCreatureOrPlayer(); - this.addTarget(target); - } - - public PyroconvergenceTriggeredAbility(final PyroconvergenceTriggeredAbility ability) { - super(ability); - } - - @Override - public PyroconvergenceTriggeredAbility copy() { - return new PyroconvergenceTriggeredAbility(this); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId()); - } - - @Override - public String getRule() { - return "Whenever you cast a multicolored spell, {this} deals 2 damage to target creature or player."; - } -} \ No newline at end of file From a51abccda73f908e5f9182264baa6ac063422b77 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 1 Oct 2015 18:25:49 +0300 Subject: [PATCH 3/6] Implement cards: Ogre Gatecrasher, Simic Ragworm, Utvara Scalper, and Whiptail Moloch --- .../mage/sets/dissension/OgreGatecrasher.java | 77 +++++++++++++++++++ .../mage/sets/dissension/SimicRagworm.java | 65 ++++++++++++++++ .../mage/sets/dissension/UtvaraScalper.java | 66 ++++++++++++++++ .../mage/sets/dissension/WhiptailMoloch.java | 67 ++++++++++++++++ 4 files changed, 275 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java create mode 100644 Mage.Sets/src/mage/sets/dissension/SimicRagworm.java create mode 100644 Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java create mode 100644 Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java diff --git a/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java b/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java new file mode 100644 index 0000000000..c20b4ea424 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/OgreGatecrasher.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class OgreGatecrasher extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender"); + + static { + filter.add(new AbilityPredicate(DefenderAbility.class)); + } + + public OgreGatecrasher(UUID ownerId) { + super(ownerId, 67, "Ogre Gatecrasher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Ogre"); + this.subtype.add("Rogue"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Ogre Gatecrasher enters the battlefield, destroy target creature with defender. + Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetCreaturePermanent(filter)); + this.addAbility(ability); + } + + public OgreGatecrasher(final OgreGatecrasher card) { + super(card); + } + + @Override + public OgreGatecrasher copy() { + return new OgreGatecrasher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java b/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java new file mode 100644 index 0000000000..323d074f30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/SimicRagworm.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SimicRagworm extends CardImpl { + + public SimicRagworm(UUID ownerId) { + super(ownerId, 93, "Simic Ragworm", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Worm"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // {U}: Untap Simic Ragworm. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{U}"))); + } + + public SimicRagworm(final SimicRagworm card) { + super(card); + } + + @Override + public SimicRagworm copy() { + return new SimicRagworm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java b/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java new file mode 100644 index 0000000000..e6bc0c5bab --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/UtvaraScalper.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class UtvaraScalper extends CardImpl { + + public UtvaraScalper(UUID ownerId) { + super(ownerId, 76, "Utvara Scalper", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Goblin"); + this.subtype.add("Scout"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // Utvara Scalper attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + } + + public UtvaraScalper(final UtvaraScalper card) { + super(card); + } + + @Override + public UtvaraScalper copy() { + return new UtvaraScalper(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java b/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java new file mode 100644 index 0000000000..a170be090f --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/WhiptailMoloch.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class WhiptailMoloch extends CardImpl { + + public WhiptailMoloch(UUID ownerId) { + super(ownerId, 79, "Whiptail Moloch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Lizard"); + this.power = new MageInt(6); + this.toughness = new MageInt(3); + + // When Whiptail Moloch enters the battlefield, it deals 3 damage to target creature you control. + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3), false); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + } + + public WhiptailMoloch(final WhiptailMoloch card) { + super(card); + } + + @Override + public WhiptailMoloch copy() { + return new WhiptailMoloch(this); + } +} From 7479ae7644a850bdad59912324ca125a0cc89a1c Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 2 Oct 2015 08:09:51 +0300 Subject: [PATCH 4/6] Implement cards: Evolution Vat, Kill-Suit Cultist, Rakdos Ickspitter, and Stoic Ephemera --- .../mage/sets/dissension/EvolutionVat.java | 82 ++++++++++++ .../mage/sets/dissension/KillSuitCultist.java | 124 ++++++++++++++++++ .../sets/dissension/RakdosIckspitter.java | 74 +++++++++++ .../mage/sets/dissension/StoicEphemera.java | 72 ++++++++++ 4 files changed, 352 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/dissension/EvolutionVat.java create mode 100644 Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java create mode 100644 Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java create mode 100644 Mage.Sets/src/mage/sets/dissension/StoicEphemera.java diff --git a/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java new file mode 100644 index 0000000000..5d696c45d4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/EvolutionVat.java @@ -0,0 +1,82 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CountersCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +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.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class EvolutionVat extends CardImpl { + + public EvolutionVat(UUID ownerId) { + super(ownerId, 161, "Evolution Vat", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "DIS"; + + // {3}, {tap}: Tap target creature and put a +1/+1 counter on it. Until end of turn, that creature gains "{2}{G}{U}: Double the number of +1/+1 counters on this creature." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{3}")); + ability.addCost(new TapSourceCost()); + Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); + effect.setText("and put a +1/+1 counter on it"); + ability.addEffect(effect); + effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(), new CountersCount(CounterType.P1P1), false); + effect.setText("Double the number of +1/+1 counters on this creature"); + Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}{G}{U}")); + ability.addEffect(new GainAbilityTargetEffect(gainedAbility, Duration.EndOfTurn, + "Until end of turn, that creature gains \"{2}{G}{U}: Double the number of +1/+1 counters on this creature.\"")); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public EvolutionVat(final EvolutionVat card) { + super(card); + } + + @Override + public EvolutionVat copy() { + return new EvolutionVat(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java b/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java new file mode 100644 index 0000000000..4661618af0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/KillSuitCultist.java @@ -0,0 +1,124 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksEachTurnStaticAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class KillSuitCultist extends CardImpl { + + public KillSuitCultist(UUID ownerId) { + super(ownerId, 65, "Kill-Suit Cultist", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Goblin"); + this.subtype.add("Berserker"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Kill-Suit Cultist attacks each turn if able. + this.addAbility(new AttacksEachTurnStaticAbility()); + // {B}, Sacrifice Kill-Suit Cultist: The next time damage would be dealt to target creature this turn, destroy that creature instead. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new KillSuitCultistEffect(), new ManaCostsImpl("{B}")); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public KillSuitCultist(final KillSuitCultist card) { + super(card); + } + + @Override + public KillSuitCultist copy() { + return new KillSuitCultist(this); + } +} + +class KillSuitCultistEffect extends ReplacementEffectImpl { + + public KillSuitCultistEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "The next time damage would be dealt to target creature this turn, destroy that creature instead"; + } + + public KillSuitCultistEffect(final KillSuitCultistEffect effect) { + super(effect); + } + + @Override + public KillSuitCultistEffect copy() { + return new KillSuitCultistEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == EventType.DAMAGE_CREATURE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(targetPointer.getFirst(game, source)); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if(permanent != null) { + return permanent.destroy(source.getSourceId(), game, false); + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java b/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java new file mode 100644 index 0000000000..cf27653565 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/RakdosIckspitter.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.LoseLifeTargetControllerEffect; +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 RakdosIckspitter extends CardImpl { + + public RakdosIckspitter(UUID ownerId) { + super(ownerId, 128, "Rakdos Ickspitter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{R}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Thrull"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {tap}: Rakdos Ickspitter deals 1 damage to target creature and that creature's controller loses 1 life. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost()); + Effect effect = new LoseLifeTargetControllerEffect(1); + effect.setText("and that creature's controller loses 1 life"); + ability.addEffect(effect); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public RakdosIckspitter(final RakdosIckspitter card) { + super(card); + } + + @Override + public RakdosIckspitter copy() { + return new RakdosIckspitter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java b/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java new file mode 100644 index 0000000000..e8bb93eee2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dissension/StoicEphemera.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dissension; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.BlocksTriggeredAbility; +import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.abilities.keyword.DefenderAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class StoicEphemera extends CardImpl { + + public StoicEphemera(UUID ownerId) { + super(ownerId, 19, "Stoic Ephemera", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "DIS"; + this.subtype.add("Spirit"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Defender + this.addAbility(DefenderAbility.getInstance()); + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Stoic Ephemera blocks, sacrifice it at end of combat. + this.addAbility(new BlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect( + new AtTheEndOfCombatDelayedTriggeredAbility(new SacrificeSourceEffect())), false)); + } + + public StoicEphemera(final StoicEphemera card) { + super(card); + } + + @Override + public StoicEphemera copy() { + return new StoicEphemera(this); + } +} From bff06e3e0e0ec352c802a850ad77c6ceb8cb6358 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 2 Oct 2015 09:32:25 +0300 Subject: [PATCH 5/6] Fix Munda, Ambush Leader being able to reveal non-Ally cards. --- .../src/mage/sets/battleforzendikar/MundaAmbushLeader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java b/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java index 0b50bbc13b..dd3b890bd0 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/MundaAmbushLeader.java @@ -81,7 +81,7 @@ public class MundaAmbushLeader extends CardImpl { class MundaAmbushLeaderEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your libraray"); + private static final FilterCard filter = new FilterCard("Ally cards to reveal and put on top of your library"); static { filter.add(new SubtypePredicate("Ally")); @@ -111,7 +111,7 @@ class MundaAmbushLeaderEffect extends OneShotEffect { controller.lookAtCards(sourceObject.getIdName(), allCards, game); if (!allCards.isEmpty()) { Cards cardsToReveal = new CardsImpl(); - TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, new FilterCard("Ally cards to put on top of your libraray")); + TargetCard target = new TargetCard(0, Integer.MAX_VALUE, Zone.LIBRARY, filter); controller.chooseTarget(outcome, allCards, target, source, game); cardsToReveal.addAll(target.getTargets()); if (!cardsToReveal.isEmpty()) { From fec3db3a61692b83995e237df0cd3ce713216738 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Fri, 2 Oct 2015 09:32:48 +0300 Subject: [PATCH 6/6] Fix tooltip text of Ulamog's Nullifier. --- .../src/mage/sets/battleforzendikar/UlamogsNullifier.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java index 2f5fb4fea5..dcdff1c328 100644 --- a/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java +++ b/Mage.Sets/src/mage/sets/battleforzendikar/UlamogsNullifier.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.DevoidAbility; import mage.abilities.keyword.FlashAbility; @@ -78,9 +77,7 @@ public class UlamogsNullifier extends CardImpl { // When Ulamog's Nullifier enters the battlefield, you may put two cards your opponents own // from exile into their owners' graveyards. If you do, counter target spell. - Effect effect = new UlamogsNullifierEffect(); - effect.setText("you may put two cards your opponents own from exile into their owners' graveyards. If you do, "); - Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); + Ability ability = new EntersBattlefieldTriggeredAbility(new UlamogsNullifierEffect(), true); ability.addTarget(new TargetSpell()); this.addAbility(ability); } @@ -105,7 +102,7 @@ class UlamogsNullifierEffect extends OneShotEffect { public UlamogsNullifierEffect() { super(Outcome.Benefit); - this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, "; + this.staticText = "you may put two cards your opponents own from exile into their owners' graveyards. If you do, counter target spell."; } public UlamogsNullifierEffect(final UlamogsNullifierEffect effect) {