diff --git a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java index 30a8066610f..bed0d1faa09 100644 --- a/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java +++ b/forge-game/src/main/java/forge/game/ability/SpellAbilityEffect.java @@ -218,30 +218,39 @@ public abstract class SpellAbilityEffect { boolean your = location.startsWith("Your"); boolean combat = location.endsWith("Combat"); + String desc = sa.hasParam("AtEOTDesc") ? sa.getParam("AtEOTDesc") : ""; + if (your) { location = location.substring("Your".length()); } if (combat) { location = location.substring(0, location.length() - "Combat".length()); } + + if (desc.isEmpty()) { + StringBuilder sb = new StringBuilder(); + sb.append(location).append(" "); + sb.append(Lang.joinHomogenous(crds)); + sb.append(" at the "); + if (combat) { + sb.append("end of combat."); + } else { + sb.append("beginning of "); + sb.append(your ? "your" : "the"); + sb.append(" next end step."); + } + desc = sb.toString(); + } StringBuilder delTrig = new StringBuilder(); - delTrig.append("Mode$ Phase | Phase$ "); - delTrig.append(combat ? "EndCombat " : "End Of Turn "); + delTrig.append("Mode$ Phase | Phase$ "); + delTrig.append(combat ? "EndCombat " : "End Of Turn "); - if (your) { - delTrig.append("| ValidPlayer$ You "); - } - delTrig.append("| TriggerDescription$ " + location + " "); - delTrig.append(Lang.joinHomogenous(crds)); - delTrig.append(" at the "); - if (combat) { - delTrig.append("end of combat."); - } else { - delTrig.append("beginning of "); - delTrig.append(your ? "your" : "the"); - delTrig.append(" next end step."); - } + if (your) { + delTrig.append("| ValidPlayer$ You "); + } + delTrig.append("| TriggerDescription$ " + desc); + final Trigger trig = TriggerHandler.parseTrigger(delTrig.toString(), sa.getHostCard(), intrinsic); for (final Card c : crds) { trig.addRemembered(c); @@ -254,6 +263,10 @@ public abstract class SpellAbilityEffect { } else if (location.equals("Destroy")) { trigSA = "DB$ Destroy | Defined$ DelayTriggerRemembered"; } + if (sa.hasParam("AtEOTCondition")) { + String var = sa.getParam("AtEOTCondition"); + trigSA += "| ConditionCheckSVar$ " + var + "| References$ " + var; + } final SpellAbility newSa = AbilityFactory.getAbility(trigSA, sa.getHostCard()); newSa.setIntrinsic(intrinsic); trig.setOverridingAbility(newSa); diff --git a/forge-gui/res/cardsfolder/t/tilonallis_summoner.txt b/forge-gui/res/cardsfolder/t/tilonallis_summoner.txt index a719f511660..64730a68496 100644 --- a/forge-gui/res/cardsfolder/t/tilonallis_summoner.txt +++ b/forge-gui/res/cardsfolder/t/tilonallis_summoner.txt @@ -4,12 +4,10 @@ Types:Creature Human Shaman PT:1/1 K:Ascend T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing. -SVar:TrigToken:AB$ Token | Cost$ X R | TokenAmount$ X | TokenName$ Elemental | TokenTypes$ Creature,Elemental | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1 | TokenTapped$ True | TokenAttacking$ True | TokenImage$ r 1 1 Elemental RIX | RememberTokens$ True | SubAbility$ DelTrig -SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigExile | RememberObjects$ Remembered | TriggerDescription$ At the beginning of the next end step, exile those tokens unless you have the city's blessing. | SubAbility$ DBCleanup -SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True -SVar:TrigExile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ DelayTriggerRemembered | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y +SVar:TrigToken:AB$ Token | Cost$ X R | TokenAmount$ X | TokenName$ Elemental | TokenTypes$ Creature,Elemental | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1 | TokenTapped$ True | TokenAttacking$ True | TokenImage$ r 1 1 Elemental RIX | AtEOT$ Exile | AtEOTCondition$ Y | AtEOTDesc$ At the beginning of the next end step, exile those tokens unless you have the city's blessing. SVar:X:Count$xPaid SVar:Y:Count$Blessing.0.1 +DeckHas:Ability$Token SVar:HasAttackEffect:TRUE SVar:Picture:http://www.wizards.com/global/images/magic/general/tilonallis_summoner.jpg -Oracle:Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)\nWhenever Tilonalli's Summoner attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing. \ No newline at end of file +Oracle:Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)\nWhenever Tilonalli's Summoner attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.