From c108d462c26fa409602c7e79d8ef627cd7222eb2 Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Wed, 5 Jun 2013 20:41:45 +0000 Subject: [PATCH] experimental parameter "OneOff" for triggers - fixes chandra_the_firebrand.txt --- res/cardsfolder/c/chandra_the_firebrand.txt | 2 +- src/main/java/forge/card/trigger/TriggerHandler.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/res/cardsfolder/c/chandra_the_firebrand.txt b/res/cardsfolder/c/chandra_the_firebrand.txt index ae157fc199c..c712f25a5c5 100644 --- a/res/cardsfolder/c/chandra_the_firebrand.txt +++ b/res/cardsfolder/c/chandra_the_firebrand.txt @@ -5,7 +5,7 @@ Loyalty:3 A:AB$DealDamage | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player. A:AB$Effect | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Name$ Chandra, the Firebrand effect. | Image$ chandra_the_firebrand_effect | Triggers$ TrigCopy | SVars$ TrigCopyMain,DBCleanup | SpellDescription$ When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy. A:AB$DealDamage | Cost$ SubCounter<6/LOYALTY> | Planeswalker$ True | Ultimate$ True | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | TargetMin$ 0 | TargetMax$ 6 | NumDmg$ 6 | SpellDescription$ CARDNAME deals 6 damage to each of up to six target creatures and/or players. -SVar:TrigCopy:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | Execute$ TrigCopyMain | TriggerZones$ Command | TriggerDescription$ When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy. +SVar:TrigCopy:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | OneOff$ True | Execute$ TrigCopyMain | TriggerZones$ Command | TriggerDescription$ When you cast your next instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy. SVar:TrigCopyMain:AB$ CopySpellAbility | Cost$ 0 | Defined$ TriggeredSpellAbility | SubAbility$ DBCleanup SVar:DBCleanup:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile SVar:Picture:http://www.wizards.com/global/images/magic/general/chandra_the_firebrand.jpg diff --git a/src/main/java/forge/card/trigger/TriggerHandler.java b/src/main/java/forge/card/trigger/TriggerHandler.java index 7e868659817..ed682b1a07d 100644 --- a/src/main/java/forge/card/trigger/TriggerHandler.java +++ b/src/main/java/forge/card/trigger/TriggerHandler.java @@ -420,5 +420,11 @@ public class TriggerHandler { game.getStack().addSimultaneousStackEntry(wrapperAbility); } regtrig.setTriggeredSA(wrapperAbility); + + if ( triggerParams.containsKey("OneOff") && regtrig.getHostCard().isImmutable() ) { + Player p = regtrig.getHostCard().getController(); + p.getZone(ZoneType.Command).remove(regtrig.getHostCard()); + } + } }