From 3bdbb5bfbf6d78e15e7d85676eebabacaea11603 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Sun, 8 Aug 2021 15:09:51 +0200 Subject: [PATCH 1/3] Clear manaPaid before Targeting --- forge-game/src/main/java/forge/game/cost/CostPartMana.java | 3 --- .../src/main/java/forge/player/HumanPlaySpellAbility.java | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/forge-game/src/main/java/forge/game/cost/CostPartMana.java b/forge-game/src/main/java/forge/game/cost/CostPartMana.java index 270515175b2..1f6cf9dad0c 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPartMana.java +++ b/forge-game/src/main/java/forge/game/cost/CostPartMana.java @@ -155,9 +155,6 @@ public class CostPartMana extends CostPart { @Override public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) { - // TODO Auto-generated method stub - sa.clearManaPaid(); - // decision not used here, the whole payment is interactive! return payer.getController().payManaCost(this, sa, null, cardMatrix, true); } diff --git a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java index ea7aa35525d..3389f1d5642 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java +++ b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java @@ -144,6 +144,8 @@ public class HumanPlaySpellAbility { } } + ability.clearManaPaid(); + // This line makes use of short-circuit evaluation of boolean values, that is each subsequent argument // is only executed or evaluated if the first argument does not suffice to determine the value of the expression // because of Selective Snare do announceType first From aae01f913e41d91a866dfec761dbbbeaa2dbbdc6 Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Sun, 8 Aug 2021 16:55:58 +0200 Subject: [PATCH 2/3] Fix chooser --- forge-gui/res/cardsfolder/v/varragoth_bloodsky_sire.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-gui/res/cardsfolder/v/varragoth_bloodsky_sire.txt b/forge-gui/res/cardsfolder/v/varragoth_bloodsky_sire.txt index bddce0a97e4..9bbe8ba7dde 100644 --- a/forge-gui/res/cardsfolder/v/varragoth_bloodsky_sire.txt +++ b/forge-gui/res/cardsfolder/v/varragoth_bloodsky_sire.txt @@ -3,5 +3,5 @@ ManaCost:2 B Types:Legendary Creature Demon Rogue K:Deathtouch PT:2/3 -A:AB$ ChangeZone | Cost$ 1 B | ValidTgts$ Player | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | Mandatory$ True | ChangeType$ Card | ChangeNum$ 1 | Boast$ True | SpellDescription$ Target player searches their library for a card, then shuffles their library and puts that card on top of it. +A:AB$ ChangeZone | Cost$ 1 B | ValidTgts$ Player | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | Mandatory$ True | ChangeType$ Card | ChangeNum$ 1 | Boast$ True | Chooser$ Targeted | SpellDescription$ Target player searches their library for a card, then shuffles their library and puts that card on top of it. Oracle:Deathtouch\nBoast — {1}{B}: Target player searches their library for a card, then shuffles and puts that card on top. (Activate only if this creature attacked this turn and only once each turn.) From 7afc17b514e30cbbfa55e259ba3241f7ba2b575a Mon Sep 17 00:00:00 2001 From: tool4EvEr Date: Sun, 8 Aug 2021 17:09:58 +0200 Subject: [PATCH 3/3] Clean up --- forge-game/src/main/java/forge/game/cost/CostPartMana.java | 2 ++ forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java | 1 + 2 files changed, 3 insertions(+) diff --git a/forge-game/src/main/java/forge/game/cost/CostPartMana.java b/forge-game/src/main/java/forge/game/cost/CostPartMana.java index 1f6cf9dad0c..e36f2780aee 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPartMana.java +++ b/forge-game/src/main/java/forge/game/cost/CostPartMana.java @@ -155,6 +155,8 @@ public class CostPartMana extends CostPart { @Override public boolean payAsDecided(Player payer, PaymentDecision pd, SpellAbility sa) { + sa.clearManaPaid(); + // decision not used here, the whole payment is interactive! return payer.getController().payManaCost(this, sa, null, cardMatrix, true); } diff --git a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java index 3389f1d5642..c4c20bfd096 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java +++ b/forge-gui/src/main/java/forge/player/HumanPlaySpellAbility.java @@ -144,6 +144,7 @@ public class HumanPlaySpellAbility { } } + // reset is also done early here, because if an ability is canceled from targeting it might otherwise lead to refunding mana from earlier cast ability.clearManaPaid(); // This line makes use of short-circuit evaluation of boolean values, that is each subsequent argument