From b91b6402dcb12e9c1eaec681589bd37e2d92930d Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 1 Jul 2016 23:59:47 +1000 Subject: [PATCH 1/2] spjspj - Implement Stitcher's Graft [EMN] and slight change to mtg-cards-data.txt --- .../sets/eldritchmoon/StitchersGraft.java | 119 ++++++++++++++++++ Utils/mtg-cards-data.txt | 2 +- 2 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java diff --git a/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java b/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java new file mode 100644 index 0000000000..7c023fafd5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java @@ -0,0 +1,119 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.eldritchmoon; + +import java.util.UUID; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.common.UnattachedTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DontUntapInControllersNextUntapStepSourceEffect; +import mage.abilities.effects.common.SacrificeEquippedEffect; +import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; + +/** + * + * @author spjspj + */ +public class StitchersGraft extends CardImpl { + + public StitchersGraft(UUID ownerId) { + super(ownerId, 200, "Stitcher's Graft", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}"); + this.expansionSetCode = "EMN"; + this.subtype.add("Equipment"); + + // Equipped creature gets +3/+3. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3))); + + // Whenever equipped creature attacks, it doesn't untap during its controller's next untap step. + Effect effect = new GainAbilityAttachedEffect(new StitchersGraftTriggeredAbility(), AttachmentType.EQUIPMENT); + effect.setText("Equipped creature has \"Whenever equipped creature attacks, it doesn't untap during its controller's next untap step.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // Whenever Stitcher's Graft becomes unequipped from a permanent, sacrifice that permanent. + this.addAbility(new UnattachedTriggeredAbility(new SacrificeEquippedEffect(), false)); + + // Equip {2} + this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); + } + + public StitchersGraft(final StitchersGraft card) { + super(card); + } + + @Override + public StitchersGraft copy() { + return new StitchersGraft(this); + } +} + +class StitchersGraftTriggeredAbility extends TriggeredAbilityImpl { + + public StitchersGraftTriggeredAbility() { + super(Zone.BATTLEFIELD, new DontUntapInControllersNextUntapStepSourceEffect()); + } + + public StitchersGraftTriggeredAbility(final StitchersGraftTriggeredAbility ability) { + super(ability); + } + + @Override + public StitchersGraftTriggeredAbility copy() { + return new StitchersGraftTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.ATTACKER_DECLARED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { + return true; + } + return false; + } + + @Override + public String getRule() { + return "Whenever equipped creature attacks, it doesn't untap during its controller's next untap step"; + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 4f2c351c72..762e18cf80 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -57364,6 +57364,6 @@ Cryptolith Fragment|Eldritch Moon|193|U|{3}|Artifact|||Cryptolith Fragment enter Aurora of Emrakul|Eldritch Moon|193|U||Creature - Eldrazi Reflection|1|4|Flying, deathtouch$Whenever Aurora of Emrakul attacks, each opponent loses 3 life.| Lupine Prototype|Eldritch Moon|197|R|{2}|Artifact Creature - Wolf Construct|5|5|Lupine Prototype can't attack or block unless a player has no cards in hand.| Soul Separator|Eldritch Moon|199|R|{3}|Artifact|||{5}, {T}, Sacrifice Soul Separator: Exile target creature card from your graveyard. Put a token onto the battlefield that's a copy of that card except it's 1/1, it's a Spirit in addition to its other types, and it has flying. Put a black Zombie creature token onto the battlefield with power equal to that card's power and toughness equal that card's toughness.| -Stitcher's Graft|Eldritch Moon|200|R|{1}|Artifact - Equipment|||Equipped creature gets +3/+3.$Whenever equipped creature attacks, it doesn't untap during its controller's next untap step.$Whenever Stitcher's Graft becomes unequipped from a creature, sacrifice that creature.$Equip {2}| +Stitcher's Graft|Eldritch Moon|200|R|{1}|Artifact - Equipment|||Equipped creature gets +3/+3.$Whenever equipped creature attacks, it doesn't untap during its controller's next untap step.$Whenever Stitcher's Graft becomes unattached from a permanent, sacrifice that permanent.$Equip {2}| Geier Reach Sanitarium|Eldritch Moon|203|R||Legendary Land|||{T}: Add {C} to your mana pool.${2}, {T}: Each player draws a card, then discards a card.| Hanweir Battlements|Eldritch Moon|204|R||Land|||{T}: Add {C} to your mana pool.${R},{T}: Target creature gains haste until end of turn.${3}{R}{R},{T}: If you both own and control Hanweir Battlements and a creature named Hanweir Garrison, exile them, then meld them into Hanweir, the Writhing Township.| \ No newline at end of file From dad0b3809ffc940aaf78e8060cabfc35b4f152e4 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sat, 2 Jul 2016 00:03:50 +1000 Subject: [PATCH 2/2] spjspj - Implement Stitcher's Graft [EMN] --- Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java b/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java index 7c023fafd5..65876b2e08 100644 --- a/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java +++ b/Mage.Sets/src/mage/sets/eldritchmoon/StitchersGraft.java @@ -67,7 +67,7 @@ public class StitchersGraft extends CardImpl { effect.setText("Equipped creature has \"Whenever equipped creature attacks, it doesn't untap during its controller's next untap step.\""); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - // Whenever Stitcher's Graft becomes unequipped from a permanent, sacrifice that permanent. + // Whenever Stitcher's Graft becomes unattached from a permanent, sacrifice that permanent. this.addAbility(new UnattachedTriggeredAbility(new SacrificeEquippedEffect(), false)); // Equip {2}