From 042693bf538cd2ce61195e602cd83de2ee97d2b4 Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 19 Jan 2018 22:16:16 +0300 Subject: [PATCH] - Volrath's Shapeshifter: unfortunately, the generic solution for AB Discard on a SVar didn't work (doesn't work with cloning, crashes the game), so resorting to a non-generic version specific to VS. --- .../game/staticability/StaticAbilityContinuous.java | 12 ++++++------ .../res/cardsfolder/v/volraths_shapeshifter.txt | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java index 866780ed622..316ab6a4e46 100644 --- a/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java +++ b/forge-game/src/main/java/forge/game/staticability/StaticAbilityContinuous.java @@ -524,12 +524,12 @@ public final class StaticAbilityContinuous { affectedCard.getCurrentState().addStaticAbility(stAb); } - // Gain additional abilities (e.g. such as Volrath's Shapeshifter {2}: Discard a card) - if (params.containsKey("GainAbility")) { - for (String svarDef : params.get("GainAbility").split(",")) { - SpellAbility ab = AbilityFactory.getAbility(affectedCard.getState(CardStateName.OriginalText), svarDef); - affectedCard.addSpellAbility(ab); - } + // Add the ability "{2}: Discard a card" for Volrath's Shapeshifter + // TODO: Make this generic so that other SAs can be added onto custom cards if need be + if (params.containsKey("GainVolrathsDiscardAbility")) { + String abDiscard = "AB$ Discard | Cost$ 2 | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | AILogic$ VolrathsShapeshifter | SpellDescription$ Discard a card."; + SpellAbility ab = AbilityFactory.getAbility(abDiscard, affectedCard); + affectedCard.addSpellAbility(ab); } // Remember the name and the timestamp of the card we're gaining text from, so we don't modify diff --git a/forge-gui/res/cardsfolder/v/volraths_shapeshifter.txt b/forge-gui/res/cardsfolder/v/volraths_shapeshifter.txt index 6ff57578e72..ff32341ff56 100644 --- a/forge-gui/res/cardsfolder/v/volraths_shapeshifter.txt +++ b/forge-gui/res/cardsfolder/v/volraths_shapeshifter.txt @@ -3,8 +3,7 @@ ManaCost:1 U U Types:Creature Shapeshifter PT:0/1 A:AB$ Discard | Cost$ 2 | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | AILogic$ VolrathsShapeshifter | SpellDescription$ Discard a card. -S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainTextOf$ Creature.TopGraveyard+YouCtrl | GainedTextHasThisStaticAbility$ True | GainAbility$ ABDiscard | Description$ ORIGINALTEXTONLY:As long as the top card of your graveyard is a creature card, CARDNAME has the full text of that card and has the text "{2}: Discard a card." (CARDNAME has that card's name, mana cost, color, types, abilities, power, and toughness.) -SVar:ABDiscard:AB$ Discard | Cost$ 2 | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | AILogic$ VolrathsShapeshifter | SpellDescription$ Discard a card. +S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainTextOf$ Creature.TopGraveyard+YouCtrl | GainedTextHasThisStaticAbility$ True | GainVolrathsDiscardAbility$ True | Description$ ORIGINALTEXTONLY:As long as the top card of your graveyard is a creature card, CARDNAME has the full text of that card and has the text "{2}: Discard a card." (CARDNAME has that card's name, mana cost, color, types, abilities, power, and toughness.) SVar:NeedsOrderedGraveyard:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/volraths_shapeshifter.jpg Oracle:As long as the top card of your graveyard is a creature card, Volrath's Shapeshifter has the full text of that card and has the text "{2}: Discard a card." (Volrath's Shapeshifter has that card's name, mana cost, color, types, abilities, power, and toughness.) \ No newline at end of file