From 11236a97497141482a29982476f5d5c581b10876 Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 25 Sep 2017 11:21:48 +0000 Subject: [PATCH] - A more appropriate solution for the manland animation AI problem. git-svn-id: http://svn.slightlymagic.net/forge/trunk@35765 269b9781-a132-4a9b-9d4e-f004f1b56b58 --- forge-ai/src/main/java/forge/ai/ComputerUtilMana.java | 3 +-- forge-ai/src/main/java/forge/ai/ability/AnimateAi.java | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java index 64e8237c..fef8fd99 100644 --- a/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java +++ b/forge-ai/src/main/java/forge/ai/ComputerUtilMana.java @@ -204,10 +204,9 @@ public class ComputerUtilMana { } // If a manland was previously animated this turn, do not tap it to animate another manland - // Also, don't animate a land that is already tapped (not very useful) if (sa.getHostCard().isLand() && ma.getHostCard().isLand() && ai.getController().isAI() - && (AnimateAi.isAnimatedThisTurn(ai, ma.getHostCard())) || sa.getHostCard().isTapped()) { + && AnimateAi.isAnimatedThisTurn(ai, ma.getHostCard())) { continue; } } else if (sa.getApi() == ApiType.Pump) { diff --git a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java index f98cd81f..7a800e5a 100644 --- a/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/AnimateAi.java @@ -163,7 +163,9 @@ public class AnimateAi extends SpellAbilityAi { } } if (power + toughness > c.getCurrentPower() + c.getCurrentToughness()) { - bFlag = true; + if (!c.isTapped() || (game.getCombat() != null && game.getCombat().isAttacking(c))) { + bFlag = true; + } } } @@ -182,7 +184,9 @@ public class AnimateAi extends SpellAbilityAi { if (animatedCopy.getCurrentPower() + animatedCopy.getCurrentToughness() > c.getCurrentPower() + c.getCurrentToughness()) { if (!isAnimatedThisTurn(aiPlayer, sa.getHostCard())) { - bFlag = true; + if (!sa.getHostCard().isTapped() || (game.getCombat() != null && game.getCombat().isAttacking(sa.getHostCard()))) { + bFlag = true; + } } } }