From 29ba41d20ff80d23e24d7db0fb7140534f0d7126 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Tue, 26 Jul 2022 16:10:57 -0400 Subject: [PATCH 1/8] spectacular_showdown.txt --- .../res/cardsfolder/upcoming/spectacular_showdown.txt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt diff --git a/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt b/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt new file mode 100644 index 00000000000..475201db5ca --- /dev/null +++ b/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt @@ -0,0 +1,9 @@ +Name:Spectacular Showdown +ManaCost:1 R +Types:Sorcery +A:SP$ PutCounter | ValidTgts$ Creature | CounterType$ Double Strike | RememberCards$ True | SubAbility$ DBGoad | SpellDescription$ Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.) +SVar:DBGoad:DB$ Goad | Defined$ Remembered | DefinedDesc$ each creature that had a double strike counter put on it this way | SubAbility$ DBCleanup +A:SP$ PutCounterAll | PrecostDesc$ Overload | Cost$ 4 R R R | ValidCards$ Creature | CounterType$ Double Strike | RememberCards$ True | SubAbility$ DBGoad | CostDesc$ {4}{R}{R}{R} | NonBasicSpell$ True | SpellDescription$ (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") | StackDescription$ Put a double strike counter on each creature. +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True +DeckHas:Ability$Counters +Oracle:Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)\nOverload {4}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change "target" in its text to "each.") From 75264c6115442c8093d59b75e899d29c9cc74a3b Mon Sep 17 00:00:00 2001 From: Northmoc Date: Tue, 26 Jul 2022 16:11:44 -0400 Subject: [PATCH 2/8] GoadEffect.getStackDescription support "DefinedDesc" for when Defined isn't filled at time of StackDesc --- .../main/java/forge/game/ability/effects/GoadEffect.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/GoadEffect.java b/forge-game/src/main/java/forge/game/ability/effects/GoadEffect.java index 69efb0dfe33..ad5116f444e 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/GoadEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/GoadEffect.java @@ -16,12 +16,13 @@ public class GoadEffect extends SpellAbilityEffect { @Override protected String getStackDescription(SpellAbility sa) { final Player player = sa.getActivatingPlayer(); - List tgt = getTargetCards(sa); - if (tgt.size() <= 0) { + List tgt = getDefinedCardsOrTargeted(sa, "Defined"); + String tgtString = sa.getParamOrDefault("DefinedDesc", Lang.joinHomogenous(tgt)); + if (tgtString.isEmpty()) { return ""; } else { final StringBuilder sb = new StringBuilder(); - sb.append(player).append(" goads ").append(Lang.joinHomogenous(tgt)).append("."); + sb.append(player).append(" goads ").append(tgtString).append("."); return sb.toString(); } } From ed467fa2d1ac08359d09a9df9e7ec54982ba1da0 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Tue, 26 Jul 2022 16:12:06 -0400 Subject: [PATCH 3/8] CountersPutAllEffect.resolve add "RememberCards" --- .../java/forge/game/ability/effects/CountersPutAllEffect.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java index 06a38c522e2..540cbc05a86 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java @@ -71,6 +71,9 @@ public class CountersPutAllEffect extends SpellAbilityEffect { GameEntityCounterTable table = new GameEntityCounterTable(); for (final Card tgtCard : cards) { tgtCard.addCounter(type, counterAmount, placer, table); + if (sa.hasParam("RememberCards")) { + host.addRemembered(tgtCard); + } } if (sa.hasParam("ValidCards2") || sa.hasParam("CounterType2") || sa.hasParam("CounterNum2")) { From 49861df4fc26bcb0fde069dccb9d131eb546512d Mon Sep 17 00:00:00 2001 From: Northmoc Date: Tue, 26 Jul 2022 17:14:47 -0400 Subject: [PATCH 4/8] CountersPutAllEffect move Remember after replacement --- .../forge/game/ability/effects/CountersPutAllEffect.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java index 540cbc05a86..a501d6388f1 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java @@ -71,9 +71,6 @@ public class CountersPutAllEffect extends SpellAbilityEffect { GameEntityCounterTable table = new GameEntityCounterTable(); for (final Card tgtCard : cards) { tgtCard.addCounter(type, counterAmount, placer, table); - if (sa.hasParam("RememberCards")) { - host.addRemembered(tgtCard); - } } if (sa.hasParam("ValidCards2") || sa.hasParam("CounterType2") || sa.hasParam("CounterNum2")) { @@ -97,6 +94,11 @@ public class CountersPutAllEffect extends SpellAbilityEffect { } table.replaceCounterEffect(game, sa, true); + + if (sa.hasParam("RememberCards")) { + host.addRemembered(table.columnKeySet()); + } + } } From b6bf1097bd153f055913747aa50863b782c69131 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 27 Jul 2022 11:32:44 -0400 Subject: [PATCH 5/8] clarify usage in CountersPutEffect and CountersPutAllEffect --- .../java/forge/game/ability/effects/CountersPutAllEffect.java | 4 +++- .../java/forge/game/ability/effects/CountersPutEffect.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java index a501d6388f1..6c65684f5cf 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutAllEffect.java @@ -95,7 +95,9 @@ public class CountersPutAllEffect extends SpellAbilityEffect { table.replaceCounterEffect(game, sa, true); - if (sa.hasParam("RememberCards")) { + //for cards like Agitator Ant/Spectacular Showdown that care if counters were actually put on, + // instead use "RememberPut" – this checks after replacement + if (sa.hasParam("RememberCards")) { // remembers whether counters actually placed or not host.addRemembered(table.columnKeySet()); } diff --git a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java index 3dec9d6ae4e..4ab73159bf6 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/CountersPutEffect.java @@ -631,7 +631,9 @@ public class CountersPutEffect extends SpellAbilityEffect { } } } - if (sa.hasParam("RememberCards")) { + //for cards like Agitator Ant/Spectacular Showdown that care if counters were actually put on, + // instead use "RememberPut" – this checks after replacement + if (sa.hasParam("RememberCards")) { // remembers whether counters actually placed or not card.addRemembered(table.columnKeySet()); } } From 2717862ca7f3d466e9f25c76f3a96390980dc4e5 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 27 Jul 2022 11:33:04 -0400 Subject: [PATCH 6/8] GameEntityCounterTable.replaceCounterEffect support "RememberPut" --- .../src/main/java/forge/game/GameEntityCounterTable.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/forge-game/src/main/java/forge/game/GameEntityCounterTable.java b/forge-game/src/main/java/forge/game/GameEntityCounterTable.java index 1e81b78a21b..97633e14f8b 100644 --- a/forge-game/src/main/java/forge/game/GameEntityCounterTable.java +++ b/forge-game/src/main/java/forge/game/GameEntityCounterTable.java @@ -157,8 +157,13 @@ public class GameEntityCounterTable extends ForwardingTable, Ga // Apply counter after replacement effect for (Map.Entry, Map> e : values.entrySet()) { + boolean remember = cause.hasParam("RememberPut"); for (Map.Entry ec : e.getValue().entrySet()) { gm.getKey().addCounterInternal(ec.getKey(), ec.getValue(), e.getKey().orNull(), true, result); + if (remember && ec.getValue() >= 1) { + cause.getHostCard().addRemembered(gm.getKey()); + } + } } } From 21da14e5cff33503c2d55bdcb11465a229515099 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 27 Jul 2022 11:33:38 -0400 Subject: [PATCH 7/8] agitator_ant.txt spectacular_showdown.txt refactor to "RememberPut" --- forge-gui/res/cardsfolder/a/agitator_ant.txt | 2 +- forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/forge-gui/res/cardsfolder/a/agitator_ant.txt b/forge-gui/res/cardsfolder/a/agitator_ant.txt index d3575071925..8fc7d91cfc4 100644 --- a/forge-gui/res/cardsfolder/a/agitator_ant.txt +++ b/forge-gui/res/cardsfolder/a/agitator_ant.txt @@ -4,7 +4,7 @@ Types:Creature Insect PT:2/2 T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigRepeat | TriggerDescription$ At the beginning of your end step, each player may put two +1/+1 counters on a creature they control. Goad each creature that had counters put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.) SVar:TrigRepeat:DB$ RepeatEach | RepeatPlayers$ Player | RepeatSubAbility$ DBPutCounter | SubAbility$ DBGoad -SVar:DBPutCounter:DB$ PutCounter | Chooser$ Remembered | Choices$ Creature.RememberedPlayerCtrl | ChoiceTitle$ You may choose a creature you control | ChoiceOptional$ True | CounterType$ P1P1 | CounterNum$ 2 | RememberCards$ True +SVar:DBPutCounter:DB$ PutCounter | Chooser$ Remembered | Choices$ Creature.RememberedPlayerCtrl | ChoiceTitle$ You may choose a creature you control | ChoiceOptional$ True | CounterType$ P1P1 | CounterNum$ 2 | RememberPut$ True SVar:DBGoad:DB$ Goad | Defined$ Remembered | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True DeckHas:Ability$Counters diff --git a/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt b/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt index 475201db5ca..15f6613efc6 100644 --- a/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt +++ b/forge-gui/res/cardsfolder/upcoming/spectacular_showdown.txt @@ -1,9 +1,9 @@ Name:Spectacular Showdown ManaCost:1 R Types:Sorcery -A:SP$ PutCounter | ValidTgts$ Creature | CounterType$ Double Strike | RememberCards$ True | SubAbility$ DBGoad | SpellDescription$ Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.) +A:SP$ PutCounter | ValidTgts$ Creature | CounterType$ Double Strike | RememberPut$ True | SubAbility$ DBGoad | SpellDescription$ Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.) SVar:DBGoad:DB$ Goad | Defined$ Remembered | DefinedDesc$ each creature that had a double strike counter put on it this way | SubAbility$ DBCleanup -A:SP$ PutCounterAll | PrecostDesc$ Overload | Cost$ 4 R R R | ValidCards$ Creature | CounterType$ Double Strike | RememberCards$ True | SubAbility$ DBGoad | CostDesc$ {4}{R}{R}{R} | NonBasicSpell$ True | SpellDescription$ (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") | StackDescription$ Put a double strike counter on each creature. +A:SP$ PutCounterAll | PrecostDesc$ Overload | Cost$ 4 R R R | ValidCards$ Creature | CounterType$ Double Strike | RememberPut$ True | SubAbility$ DBGoad | CostDesc$ {4}{R}{R}{R} | NonBasicSpell$ True | SpellDescription$ (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.") | StackDescription$ Put a double strike counter on each creature. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True DeckHas:Ability$Counters Oracle:Put a double strike counter on target creature, then goad each creature that had a double strike counter put on it this way. (Until your next turn, those creatures attack each combat if able and attack a player other than you if able.)\nOverload {4}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change "target" in its text to "each.") From ac6347c94bac8abd7a71e54af3c012cee325fab6 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Wed, 27 Jul 2022 11:48:42 -0400 Subject: [PATCH 8/8] GameEntityCounterTable.replaceCounterEffect dodge NPE --- forge-game/src/main/java/forge/game/GameEntityCounterTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/GameEntityCounterTable.java b/forge-game/src/main/java/forge/game/GameEntityCounterTable.java index 97633e14f8b..ef0db0e993f 100644 --- a/forge-game/src/main/java/forge/game/GameEntityCounterTable.java +++ b/forge-game/src/main/java/forge/game/GameEntityCounterTable.java @@ -157,7 +157,7 @@ public class GameEntityCounterTable extends ForwardingTable, Ga // Apply counter after replacement effect for (Map.Entry, Map> e : values.entrySet()) { - boolean remember = cause.hasParam("RememberPut"); + boolean remember = cause != null && cause.hasParam("RememberPut"); for (Map.Entry ec : e.getValue().entrySet()) { gm.getKey().addCounterInternal(ec.getKey(), ec.getValue(), e.getKey().orNull(), true, result); if (remember && ec.getValue() >= 1) {