From ef2677ae21083ebf16c08802b193e2ddb2d1b6e9 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Fri, 13 Oct 2023 12:20:15 +0200 Subject: [PATCH] Tweak SpellDescription fallback --- .../forge/game/ability/effects/CountersMultiplyEffect.java | 1 + .../forge/game/ability/effects/DelayedTriggerEffect.java | 7 +++---- .../forge/game/ability/effects/ImmediateTriggerEffect.java | 7 +++---- forge-gui/res/cardsfolder/b/barroom_brawl.txt | 2 +- forge-gui/res/cardsfolder/e/elvish_vatkeeper.txt | 2 +- forge-gui/res/cardsfolder/n/narset_of_the_ancient_way.txt | 2 +- forge-gui/res/cardsfolder/r/reincarnation.txt | 2 +- forge-gui/res/cardsfolder/t/the_beamtown_bullies.txt | 2 +- .../cardsfolder/upcoming/tempest_hart_scan_the_clouds.txt | 4 ++-- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersMultiplyEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersMultiplyEffect.java index d507879bbc0..50c5a8304b7 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersMultiplyEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersMultiplyEffect.java @@ -34,6 +34,7 @@ public class CountersMultiplyEffect extends SpellAbilityEffect { return sb.toString(); } + @Override public void resolve(SpellAbility sa) { final Card host = sa.getHostCard(); diff --git a/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java b/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java index 3591c516d4d..f75f623a420 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/DelayedTriggerEffect.java @@ -39,12 +39,11 @@ public class DelayedTriggerEffect extends SpellAbilityEffect { final Game game = host.getGame(); Map mapParams = Maps.newHashMap(sa.getMapParams()); - mapParams.remove("Cost"); - - if (mapParams.containsKey("SpellDescription")) { + if (mapParams.containsKey("SpellDescription") && !mapParams.containsKey("TriggerDescription")) { mapParams.put("TriggerDescription", mapParams.get("SpellDescription")); - mapParams.remove("SpellDescription"); } + mapParams.remove("SpellDescription"); + mapParams.remove("Cost"); final Trigger delTrig = TriggerHandler.parseTrigger(mapParams, host, sa.isIntrinsic(), null); delTrig.setSpawningAbility(sa.copy(host, true)); diff --git a/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java index eb7628c79a0..06ecf7c8b21 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ImmediateTriggerEffect.java @@ -36,12 +36,11 @@ public class ImmediateTriggerEffect extends SpellAbilityEffect { final Game game = host.getGame(); Map mapParams = Maps.newHashMap(sa.getMapParams()); - mapParams.remove("Cost"); - - if (mapParams.containsKey("SpellDescription")) { + if (mapParams.containsKey("SpellDescription") && !mapParams.containsKey("TriggerDescription")) { mapParams.put("TriggerDescription", mapParams.get("SpellDescription")); - mapParams.remove("SpellDescription"); } + mapParams.remove("SpellDescription"); + mapParams.remove("Cost"); mapParams.put("Mode", TriggerType.Immediate.name()); diff --git a/forge-gui/res/cardsfolder/b/barroom_brawl.txt b/forge-gui/res/cardsfolder/b/barroom_brawl.txt index 9c3a8c36eff..556cc221743 100644 --- a/forge-gui/res/cardsfolder/b/barroom_brawl.txt +++ b/forge-gui/res/cardsfolder/b/barroom_brawl.txt @@ -3,5 +3,5 @@ ManaCost:1 G Types:Sorcery A:SP$ Pump | ValidTgts$ Creature.YouCtrl | AILogic$ Fight | TgtPrompt$ Select target creature you control | SubAbility$ DBFight | StackDescription$ None SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.ControlledBy NextOpponentToYourLeft | TgtPrompt$ Select target creature controlled by the opponent to your left | SubAbility$ DBCopy | SpellDescription$ Target creature you control fights target creature the opponent to your left controls. -SVar:DBCopy:DB$ CopySpellAbility | Defined$ Parent | Controller$ NextOpponentToYourLeft | Optional$ True | AILogic$ ChainOfAcid | StackDescription$ None | MayChooseTarget$ True | StackDescription$ REP that player_{p:NextPlayerToYourLeft} | SpellDescription$ Then that player may copy this spell and may choose new targets for the copy. +SVar:DBCopy:DB$ CopySpellAbility | Defined$ Parent | Controller$ NextOpponentToYourLeft | Optional$ True | AILogic$ ChainOfAcid | MayChooseTarget$ True | StackDescription$ REP that player_{p:NextPlayerToYourLeft} | SpellDescription$ Then that player may copy this spell and may choose new targets for the copy. Oracle:Target creature you control fights target creature the opponent to your left controls. Then that player may copy this spell and may choose new targets for the copy. diff --git a/forge-gui/res/cardsfolder/e/elvish_vatkeeper.txt b/forge-gui/res/cardsfolder/e/elvish_vatkeeper.txt index 7d2c174cc41..bdd5541a82b 100644 --- a/forge-gui/res/cardsfolder/e/elvish_vatkeeper.txt +++ b/forge-gui/res/cardsfolder/e/elvish_vatkeeper.txt @@ -5,7 +5,7 @@ PT:3/3 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigIncubate | TriggerDescription$ When CARDNAME enters the battlefield, incubate 2. (Create an Incubator token with two +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.) SVar:TrigIncubate:DB$ Incubate | Amount$ 2 A:AB$ SetState | Cost$ 5 | TgtPrompt$ Select target Incubator token you control | ValidTgts$ Incubator.token+YouCtrl | Mode$ Transform | SubAbility$ DBDouble | SpellDescription$ Transform target Incubator token you control. -SVar:DBDouble:DB$ MultiplyCounter | Defined$ Targeted | CounterType$ P1P1 | SpellDescription$ SpellDescription | SpellDescription$ Double the number of +1/+1 counters on it. +SVar:DBDouble:DB$ MultiplyCounter | Defined$ Targeted | CounterType$ P1P1 | SpellDescription$ Double the number of +1/+1 counters on it. DeckHas:Ability$Counters|Token & Type$Incubator|Artifact DeckHints:Type$Incubator Oracle:When Elvish Vatkeeper enters the battlefield, incubate 2. (Create an Incubator token with two +1/+1 counters on it and "{2}: Transform this artifact." It transforms into a 0/0 Phyrexian artifact creature.)\n{5}: Transform target Incubator token you control. Double the number of +1/+1 counters on it. diff --git a/forge-gui/res/cardsfolder/n/narset_of_the_ancient_way.txt b/forge-gui/res/cardsfolder/n/narset_of_the_ancient_way.txt index 52a46fae87c..75ba1877747 100644 --- a/forge-gui/res/cardsfolder/n/narset_of_the_ancient_way.txt +++ b/forge-gui/res/cardsfolder/n/narset_of_the_ancient_way.txt @@ -4,7 +4,7 @@ Types:Legendary Planeswalker Narset Loyalty:4 A:AB$ GainLife | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | LifeAmount$ 2 | Defined$ You | SubAbility$ DBMana | StackDescription$ SpellDescription | SpellDescription$ You gain 2 life. Add {U}, {R}, or {W}. Spend this mana only to cast a noncreature spell. SVar:DBMana:DB$ Mana | Produced$ Combo U R W | Amount$ 1 | RestrictValid$ Spell.nonCreature | StackDescription$ None -A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | NumCards$ 1 | SpellDescription$ Draw a card, then discard a card. | SubAbility$ DBDiscard | StackDescription$ SpellDescription | SpellDescription$ Draw a card, then you may discard a card. +A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | NumCards$ 1 | SubAbility$ DBDiscard | StackDescription$ SpellDescription | SpellDescription$ Draw a card, then you may discard a card. SVar:DBDiscard:DB$ Discard | Defined$ You | Mode$ TgtChoose | Optional$ True | NumCards$ 1 | RememberDiscarded$ True | SubAbility$ DBImmediateTrig | StackDescription$ None SVar:DBImmediateTrig:DB$ ImmediateTrigger | ConditionDefined$ Remembered | ConditionPresent$ Card.nonLand | ConditionCompare$ EQ1 | Execute$ TrigDamage | RememberObjects$ Remembered | SubAbility$ DBCleanup | StackDescription$ SpellDescription | SpellDescription$ When you discard a nonland card this way, CARDNAME deals damage equal to that card's mana value to target creature or planeswalker. SVar:TrigDamage:DB$ DealDamage | NumDmg$ X | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker diff --git a/forge-gui/res/cardsfolder/r/reincarnation.txt b/forge-gui/res/cardsfolder/r/reincarnation.txt index 22ea6cfbdee..2ee791b3be1 100644 --- a/forge-gui/res/cardsfolder/r/reincarnation.txt +++ b/forge-gui/res/cardsfolder/r/reincarnation.txt @@ -1,7 +1,7 @@ Name:Reincarnation ManaCost:1 G G Types:Instant -A:SP$ DelayedTrigger | ValidTgts$ Creature | TgtPrompt$ Choose target creature | Mode$ ChangesZone | RememberObjects$ Targeted | ValidCard$ Card.IsTriggerRemembered | Origin$ Battlefield | Destination$ Graveyard | ThisTurn$ True | Execute$ TrigReturn | AILogic$ SaveCreature | StackDescription$ None | TriggerDescription$ When that creature dies this turn, return a creature card from its owner's graveyard to the battlefield under the control of that creature's owner. | StackDescription$ When {c:Targeted} dies this turn, return a creature card from {p:TargetedOwner}'s graveyard to the battlefield under the control of that creature's owner. | SpellDescription$ Choose target creature. When that creature dies this turn, return a creature card from its owner's graveyard to the battlefield under the control of that creature's owner. +A:SP$ DelayedTrigger | ValidTgts$ Creature | TgtPrompt$ Choose target creature | Mode$ ChangesZone | RememberObjects$ Targeted | ValidCard$ Card.IsTriggerRemembered | Origin$ Battlefield | Destination$ Graveyard | ThisTurn$ True | Execute$ TrigReturn | AILogic$ SaveCreature | TriggerDescription$ When that creature dies this turn, return a creature card from its owner's graveyard to the battlefield under the control of that creature's owner. | StackDescription$ When {c:Targeted} dies this turn, return a creature card from {p:TargetedOwner}'s graveyard to the battlefield under the control of that creature's owner. | SpellDescription$ Choose target creature. When that creature dies this turn, return a creature card from its owner's graveyard to the battlefield under the control of that creature's owner. SVar:TrigReturn:DB$ ChangeZone | ChangeType$ Creature.sharesOwnerWith TriggeredCard | Origin$ Graveyard | Destination$ Battlefield | Mandatory$ True | ChangeNum$ 1 | Hidden$ True | SelectPrompt$ Select a creature card from that creature's owner's graveyard DeckHas:Ability$Graveyard DeckHints:Ability$Discard|Sacrifice diff --git a/forge-gui/res/cardsfolder/t/the_beamtown_bullies.txt b/forge-gui/res/cardsfolder/t/the_beamtown_bullies.txt index a6e67aedb5a..ba543329769 100644 --- a/forge-gui/res/cardsfolder/t/the_beamtown_bullies.txt +++ b/forge-gui/res/cardsfolder/t/the_beamtown_bullies.txt @@ -4,7 +4,7 @@ Types:Legendary Creature Ogre Devil Warrior PT:4/4 K:Vigilance K:Haste -A:AB$ Pump | Cost$ T | ValidTgts$ Player.Opponent+Active | TgtPrompt$ Select target opponent whose turn it is | SubAbility$ DBChangeZone | StackDescription$ None | StackDescription$ {p:Targeted} | SpellDescription$ Target opponent whose turn it is +A:AB$ Pump | Cost$ T | ValidTgts$ Player.Opponent+Active | TgtPrompt$ Select target opponent whose turn it is | SubAbility$ DBChangeZone | StackDescription$ {p:Targeted} | SpellDescription$ Target opponent whose turn it is SVar:DBChangeZone:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | DefinedPlayer$ ParentTarget | ValidTgts$ Creature.nonLegendary+YouOwn | TgtPrompt$ Select target nonlegendary creature card from your graveyard | GainControl$ ParentTarget | SubAbility$ DBAnimate | StackDescription$ puts {c:Targeted} onto the battlefield under their control. | SpellDescription$ puts target nonlegendary creature card from your graveyard onto the battlefield under their control. SVar:DBAnimate:DB$ Animate | Keywords$ Haste | Defined$ Targeted | Duration$ Permanent | SubAbility$ DBGoad | StackDescription$ SpellDescription | SpellDescription$ It gains haste. SVar:DBGoad:DB$ Goad | Defined$ Targeted | SubAbility$ DelTrig | SpellDescription$ Goad it. diff --git a/forge-gui/res/cardsfolder/upcoming/tempest_hart_scan_the_clouds.txt b/forge-gui/res/cardsfolder/upcoming/tempest_hart_scan_the_clouds.txt index a57b1f27c81..2d2b333519a 100644 --- a/forge-gui/res/cardsfolder/upcoming/tempest_hart_scan_the_clouds.txt +++ b/forge-gui/res/cardsfolder/upcoming/tempest_hart_scan_the_clouds.txt @@ -3,7 +3,7 @@ ManaCost:3 G Types:Creature Elemental Elk PT:3/4 K:Trample -T:Mode$ SpellCast | ValidCard$ Card.cmcGE5 | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$Whenever you cast a spell with mana value 5 or greater, put a +1/+1 counter on CARDNAME +T:Mode$ SpellCast | ValidCard$ Card.cmcGE5 | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever you cast a spell with mana value 5 or greater, put a +1/+1 counter on CARDNAME. SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 DeckHas:Ability$Counters|Discard AlternateMode:Adventure @@ -14,6 +14,6 @@ ALTERNATE Name:Scan the Clouds ManaCost:1 U Types:Instant Adventure -A:SP$ Draw | NumCards$ 2 | SpellDescription$ Draw two cards, then discard two cards. | SubAbility$ DBDiscard | SpellDescription$ Draw two cards, then discard two cards. (Then exile this card. You may cast the creature later from exile.) +A:SP$ Draw | NumCards$ 2 | SubAbility$ DBDiscard | SpellDescription$ Draw two cards, then discard two cards. (Then exile this card. You may cast the creature later from exile.) SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 2 | Mode$ TgtChoose Oracle:Draw two cards, then discard two cards. (Then exile this card. You may cast the creature later from exile.) \ No newline at end of file