From c2a1508ed6bad81847a9d9f3165b8c8250f72dc0 Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 5 Dec 2018 18:20:56 +0300 Subject: [PATCH 1/5] - Attempting to fix Venerated Loxodon not giving counters to creatures that helped convoke it. --- forge-game/src/main/java/forge/game/cost/CostAdjustment.java | 1 - 1 file changed, 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index c0f0216ead4..e9d96f08468 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -237,7 +237,6 @@ public class CostAdjustment { } } if (sa.getHostCard().hasKeyword(Keyword.CONVOKE)) { - sa.getHostCard().clearConvoked(); adjustCostByConvokeOrImprovise(cost, sa, false, test); } if (sa.getHostCard().hasKeyword(Keyword.IMPROVISE)) { From 1905ff30ddea7ad0b3048db2258926a6f223d80f Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 5 Dec 2018 20:28:50 +0300 Subject: [PATCH 2/5] - --- forge-ai/src/main/java/forge/ai/SpellAbilityAi.java | 2 +- forge-game/src/main/java/forge/game/cost/CostAdjustment.java | 4 +--- forge-gui/res/cardsfolder/v/venerated_loxodon.txt | 2 +- forge-gui/src/main/java/forge/player/HumanPlay.java | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java b/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java index 4f08eb0e0e0..928cdb3b384 100644 --- a/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java +++ b/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java @@ -176,7 +176,7 @@ public abstract class SpellAbilityAi { public final boolean doTriggerNoCostWithSubs(final Player aiPlayer, final SpellAbility sa, final boolean mandatory) { - if (!doTriggerAINoCost(aiPlayer, sa, mandatory)) { + if (!doTriggerAINoCost(aiPlayer, sa, mandatory) && !"Always".equals(sa.getParam("AILogic"))) { return false; } final AbilitySub subAb = sa.getSubAbility(); diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index e9d96f08468..ff5291f94d3 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -262,10 +262,9 @@ public class CostAdjustment { Map convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise); // Convoked creats are tapped here with triggers suppressed, - // Then again when payment is done(In InputPayManaCost.done()) with suppression cleared. + // Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers. // This is to make sure that triggers go off at the right time // AND that you can't use mana tapabilities of convoked creatures to pay the convoked cost. - sa.getActivatingPlayer().getGame().getTriggerHandler().suppressMode(TriggerType.Taps); for (final Entry conv : convokedCards.entrySet()) { sa.addTappedForConvoke(conv.getKey()); cost.decreaseShard(conv.getValue(), 1); @@ -276,7 +275,6 @@ public class CostAdjustment { } } } - sa.getActivatingPlayer().getGame().getTriggerHandler().clearSuppression(TriggerType.Taps); } private static void adjustCostByOffering(final ManaCostBeingPaid cost, final SpellAbility sa) { diff --git a/forge-gui/res/cardsfolder/v/venerated_loxodon.txt b/forge-gui/res/cardsfolder/v/venerated_loxodon.txt index 09f861fd655..0c3e6b477cf 100644 --- a/forge-gui/res/cardsfolder/v/venerated_loxodon.txt +++ b/forge-gui/res/cardsfolder/v/venerated_loxodon.txt @@ -4,6 +4,6 @@ Types:Creature Elephant Cleric PT:4/4 K:Convoke T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPutCounterAll | TriggerDescription$ When CARDNAME enters the battlefield, put a +1/+1 counter on each creature that convoked it. -SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.convoked | CounterType$ P1P1 | CounterNum$ 1 +SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.convoked | CounterType$ P1P1 | CounterNum$ 1 | AILogic$ Always DeckHas:Ability$Counters Oracle:Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of the creature's color.)\nWhen Venerated Loxodon enters the battlefield, put a +1/+1 counter on each creature that convoked it. diff --git a/forge-gui/src/main/java/forge/player/HumanPlay.java b/forge-gui/src/main/java/forge/player/HumanPlay.java index 8e7b84f42e3..cd5ab73816e 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/player/HumanPlay.java @@ -903,10 +903,12 @@ public class HumanPlay { } } if (ability.getTappedForConvoke() != null) { + activator.getGame().getTriggerHandler().suppressMode(TriggerType.Taps); for (final Card c : ability.getTappedForConvoke()) { c.setTapped(false); c.tap(); } + activator.getGame().getTriggerHandler().clearSuppression(TriggerType.Taps); ability.clearTappedForConvoke(); } return handleOfferingConvokeAndDelve(ability, cardsToDelve, false); From e23790fd90f5170120fe1e3092e0f7208f2de6a7 Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 5 Dec 2018 18:20:56 +0300 Subject: [PATCH 3/5] - Attempting to fix Venerated Loxodon not giving counters to creatures that helped convoke it. --- forge-game/src/main/java/forge/game/cost/CostAdjustment.java | 1 - 1 file changed, 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index c0f0216ead4..e9d96f08468 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -237,7 +237,6 @@ public class CostAdjustment { } } if (sa.getHostCard().hasKeyword(Keyword.CONVOKE)) { - sa.getHostCard().clearConvoked(); adjustCostByConvokeOrImprovise(cost, sa, false, test); } if (sa.getHostCard().hasKeyword(Keyword.IMPROVISE)) { From 9cbada32aad67f4461a023de6742a32d1c6dbd2b Mon Sep 17 00:00:00 2001 From: Agetian Date: Wed, 5 Dec 2018 20:28:50 +0300 Subject: [PATCH 4/5] - --- forge-ai/src/main/java/forge/ai/SpellAbilityAi.java | 2 +- forge-game/src/main/java/forge/game/cost/CostAdjustment.java | 4 +--- forge-gui/res/cardsfolder/v/venerated_loxodon.txt | 2 +- forge-gui/src/main/java/forge/player/HumanPlay.java | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java b/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java index 4f08eb0e0e0..928cdb3b384 100644 --- a/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java +++ b/forge-ai/src/main/java/forge/ai/SpellAbilityAi.java @@ -176,7 +176,7 @@ public abstract class SpellAbilityAi { public final boolean doTriggerNoCostWithSubs(final Player aiPlayer, final SpellAbility sa, final boolean mandatory) { - if (!doTriggerAINoCost(aiPlayer, sa, mandatory)) { + if (!doTriggerAINoCost(aiPlayer, sa, mandatory) && !"Always".equals(sa.getParam("AILogic"))) { return false; } final AbilitySub subAb = sa.getSubAbility(); diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index e9d96f08468..ff5291f94d3 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -262,10 +262,9 @@ public class CostAdjustment { Map convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise); // Convoked creats are tapped here with triggers suppressed, - // Then again when payment is done(In InputPayManaCost.done()) with suppression cleared. + // Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers. // This is to make sure that triggers go off at the right time // AND that you can't use mana tapabilities of convoked creatures to pay the convoked cost. - sa.getActivatingPlayer().getGame().getTriggerHandler().suppressMode(TriggerType.Taps); for (final Entry conv : convokedCards.entrySet()) { sa.addTappedForConvoke(conv.getKey()); cost.decreaseShard(conv.getValue(), 1); @@ -276,7 +275,6 @@ public class CostAdjustment { } } } - sa.getActivatingPlayer().getGame().getTriggerHandler().clearSuppression(TriggerType.Taps); } private static void adjustCostByOffering(final ManaCostBeingPaid cost, final SpellAbility sa) { diff --git a/forge-gui/res/cardsfolder/v/venerated_loxodon.txt b/forge-gui/res/cardsfolder/v/venerated_loxodon.txt index 09f861fd655..0c3e6b477cf 100644 --- a/forge-gui/res/cardsfolder/v/venerated_loxodon.txt +++ b/forge-gui/res/cardsfolder/v/venerated_loxodon.txt @@ -4,6 +4,6 @@ Types:Creature Elephant Cleric PT:4/4 K:Convoke T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPutCounterAll | TriggerDescription$ When CARDNAME enters the battlefield, put a +1/+1 counter on each creature that convoked it. -SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.convoked | CounterType$ P1P1 | CounterNum$ 1 +SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.convoked | CounterType$ P1P1 | CounterNum$ 1 | AILogic$ Always DeckHas:Ability$Counters Oracle:Convoke (Your creatures can help cast this spell. Each creature you tap while casting this spell pays for {1} or one mana of the creature's color.)\nWhen Venerated Loxodon enters the battlefield, put a +1/+1 counter on each creature that convoked it. diff --git a/forge-gui/src/main/java/forge/player/HumanPlay.java b/forge-gui/src/main/java/forge/player/HumanPlay.java index 8e7b84f42e3..cd5ab73816e 100644 --- a/forge-gui/src/main/java/forge/player/HumanPlay.java +++ b/forge-gui/src/main/java/forge/player/HumanPlay.java @@ -903,10 +903,12 @@ public class HumanPlay { } } if (ability.getTappedForConvoke() != null) { + activator.getGame().getTriggerHandler().suppressMode(TriggerType.Taps); for (final Card c : ability.getTappedForConvoke()) { c.setTapped(false); c.tap(); } + activator.getGame().getTriggerHandler().clearSuppression(TriggerType.Taps); ability.clearTappedForConvoke(); } return handleOfferingConvokeAndDelve(ability, cardsToDelve, false); From 74c7dd030539bdac41ba9d71e0feae1963cb3600 Mon Sep 17 00:00:00 2001 From: Agetian Date: Thu, 6 Dec 2018 17:28:13 +0300 Subject: [PATCH 5/5] - Tweaked the comment. --- forge-game/src/main/java/forge/game/cost/CostAdjustment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index ff5291f94d3..a76e47054e7 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -261,7 +261,7 @@ public class CostAdjustment { Map convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise); - // Convoked creats are tapped here with triggers suppressed, + // Convoked creats are tapped here, setting up their taps triggers, // Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers. // This is to make sure that triggers go off at the right time // AND that you can't use mana tapabilities of convoked creatures to pay the convoked cost.