From e417d510c43993c88e0a28b024dd2dc5cfea3903 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Fri, 8 Oct 2021 17:42:53 +0300 Subject: [PATCH 1/2] - Added an AI hint to Devoted Paladin. --- forge-gui/res/cardsfolder/d/devoted_paladin.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/forge-gui/res/cardsfolder/d/devoted_paladin.txt b/forge-gui/res/cardsfolder/d/devoted_paladin.txt index da0a2ba5e61..437457614c3 100644 --- a/forge-gui/res/cardsfolder/d/devoted_paladin.txt +++ b/forge-gui/res/cardsfolder/d/devoted_paladin.txt @@ -4,4 +4,5 @@ Types:Creature Orc Knight PT:4/4 T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPumpAll | TriggerDescription$ Beacon of Hope — When CARDNAME enters the battlefield, creatures you control get +1/+1 and gain vigilance until end of turn. SVar:TrigPumpAll:DB$ PumpAll | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +1 | KW$ Vigilance +SVar:PlayMain1:TRUE Oracle:Beacon of Hope — When Devoted Paladin enters the battlefield, creatures you control get +1/+1 and gain vigilance until end of turn. From dd630936425687ff59182d2e52b8b161ebc92976 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Fri, 8 Oct 2021 17:55:04 +0300 Subject: [PATCH 2/2] - Tweak the timing for VentureAi activations when it has an associated cost. --- .../src/main/java/forge/ai/ability/VentureAi.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/VentureAi.java b/forge-ai/src/main/java/forge/ai/ability/VentureAi.java index 00cbce14fab..5d4b3fe95c5 100644 --- a/forge-ai/src/main/java/forge/ai/ability/VentureAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/VentureAi.java @@ -4,6 +4,8 @@ import com.google.common.collect.Lists; import forge.ai.AiPlayDecision; import forge.ai.PlayerControllerAi; import forge.ai.SpellAbilityAi; +import forge.game.phase.PhaseHandler; +import forge.game.phase.PhaseType; import forge.game.player.Player; import forge.game.player.PlayerActionConfirmMode; import forge.game.spellability.SpellAbility; @@ -15,7 +17,16 @@ import java.util.Map; public class VentureAi extends SpellAbilityAi { @Override protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) { - // TODO: is it ever a bad idea to venture into a dungeon? + // If this has a mana cost, do it at opponent's EOT if able to prevent spending mana early; if sorcery, do it in Main2 + PhaseHandler ph = aiPlayer.getGame().getPhaseHandler(); + if (sa.getPayCosts().hasManaCost() || sa.getPayCosts().hasTapCost()) { + if (SpellAbilityAi.isSorcerySpeed(sa)) { + return ph.is(PhaseType.MAIN2, aiPlayer); + } else { + return ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn() == aiPlayer; + } + } + return true; }