From f9e86bbe8cfaa92c8cf7d4469846e8d07cdd11fe Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Wed, 19 Aug 2020 09:53:58 +0300 Subject: [PATCH 1/3] - Handle AI equipping creatures in Main 2 by way of prioritizing spells instead of hard-locking it. --- forge-ai/src/main/java/forge/ai/AiController.java | 4 ++++ forge-ai/src/main/java/forge/ai/ability/AttachAi.java | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/AiController.java b/forge-ai/src/main/java/forge/ai/AiController.java index 8f941ed6886..035a4cecb4c 100644 --- a/forge-ai/src/main/java/forge/ai/AiController.java +++ b/forge-ai/src/main/java/forge/ai/AiController.java @@ -997,6 +997,10 @@ public class AiController { if (source.isEquipment() && noCreatures) { p -= 9; } + // don't equip stuff in main 2 if there's more stuff to cast at the moment + if (sa.getApi() == ApiType.Attach && !sa.isCurse() && source.getGame().getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS)) { + p -= 1; + } // 1. increase chance of using Surge effects // 2. non-surged versions are usually inefficient if (source.getOracleText().contains("surge cost") && !sa.isSurged()) { diff --git a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java index e762a23d12a..bed0968b29e 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AttachAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AttachAi.java @@ -69,11 +69,6 @@ public class AttachAi extends SpellAbilityAi { return false; } - if (ai.getGame().getPhaseHandler().getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS) - && !"Curse".equals(sa.getParam("AILogic"))) { - return false; - } - // prevent run-away activations - first time will always return true if (ComputerUtil.preventRunAwayActivations(sa)) { return false; From 468d2f91981ccf53d86e84a3881c8be82eb51a44 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Thu, 20 Aug 2020 17:57:21 +0300 Subject: [PATCH 2/3] - Fix AI hint vars for Gideon's Sacrifice. - Add NeedsToPlay for Mirrormade. --- forge-gui/res/cardsfolder/g/gideons_sacrifice.txt | 4 ++-- forge-gui/res/cardsfolder/m/mirrormade.txt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/forge-gui/res/cardsfolder/g/gideons_sacrifice.txt b/forge-gui/res/cardsfolder/g/gideons_sacrifice.txt index 9e3d7dd078a..d76910c2231 100644 --- a/forge-gui/res/cardsfolder/g/gideons_sacrifice.txt +++ b/forge-gui/res/cardsfolder/g/gideons_sacrifice.txt @@ -7,6 +7,6 @@ SVar:DamageEvent:Event$ DamageDone | ActiveZones$ Command | ValidTarget$ You,Per SVar:GideonSac:DB$ ReplaceEffect | VarName$ Affected | VarValue$ Remembered | VarType$ Card SVar:NeedsToPlayVar:Z GE1 SVar:Z:SVar$Z1/Plus.Z2 -SVar:Z1:Count$Creature.YouCtrl -SVar:Z2:Count$Planeswalker.YouCtrl +SVar:Z1:Count$Valid Creature.YouCtrl +SVar:Z2:Count$Valid Planeswalker.YouCtrl Oracle:Choose a creature or planeswalker you control. All damage that would be dealt this turn to you and permanents you control is dealt to the chosen permanent instead (if it's still on the battlefield). diff --git a/forge-gui/res/cardsfolder/m/mirrormade.txt b/forge-gui/res/cardsfolder/m/mirrormade.txt index ae1d94a8c3f..87471024560 100644 --- a/forge-gui/res/cardsfolder/m/mirrormade.txt +++ b/forge-gui/res/cardsfolder/m/mirrormade.txt @@ -3,4 +3,8 @@ ManaCost:1 U U Types:Enchantment K:ETBReplacement:Copy:DBCopy:Optional SVar:DBCopy:DB$ Clone | Choices$ Artifact.Other,Enchantment.Other | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or enchantment on the battlefield. +SVar:NeedsToPlayVar:Z GE1 +SVar:Z:SVar$Z1/Plus.Z2 +SVar:Z1:Count$Valid Artifact.Other+YouCtrl +SVar:Z2:Count$Valid Enchantment.Other+YouCtrl Oracle:You may have Mirrormade enter the battlefield as a copy of any artifact or enchantment on the battlefield. From 3d33ad0192ac3b552d901e76d64b775da58e0638 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Thu, 20 Aug 2020 17:59:28 +0300 Subject: [PATCH 3/3] - Mirrormade: no need for YouCtrl in AI vars. --- forge-gui/res/cardsfolder/m/mirrormade.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forge-gui/res/cardsfolder/m/mirrormade.txt b/forge-gui/res/cardsfolder/m/mirrormade.txt index 87471024560..299b397dc01 100644 --- a/forge-gui/res/cardsfolder/m/mirrormade.txt +++ b/forge-gui/res/cardsfolder/m/mirrormade.txt @@ -5,6 +5,6 @@ K:ETBReplacement:Copy:DBCopy:Optional SVar:DBCopy:DB$ Clone | Choices$ Artifact.Other,Enchantment.Other | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or enchantment on the battlefield. SVar:NeedsToPlayVar:Z GE1 SVar:Z:SVar$Z1/Plus.Z2 -SVar:Z1:Count$Valid Artifact.Other+YouCtrl -SVar:Z2:Count$Valid Enchantment.Other+YouCtrl +SVar:Z1:Count$Valid Artifact.Other +SVar:Z2:Count$Valid Enchantment.Other Oracle:You may have Mirrormade enter the battlefield as a copy of any artifact or enchantment on the battlefield.