From c8d082e7f9429031273291eebc57c29d4d26b43c Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 11:07:41 +0000 Subject: [PATCH] - More improvements to the AI of dealDamage. --- src/forge/AbilityFactory_DealDamage.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/forge/AbilityFactory_DealDamage.java b/src/forge/AbilityFactory_DealDamage.java index 8ccae260286..c8d67d75748 100644 --- a/src/forge/AbilityFactory_DealDamage.java +++ b/src/forge/AbilityFactory_DealDamage.java @@ -194,7 +194,9 @@ import java.util.Random; // will include creatures already dealt damage return c.isCreature() && ((c.getNetDefense() + c.getDamage()) <= d) && CardFactoryUtil.canTarget(AF.getHostCard(), c) - && !c.reduceDamageToZero(AF.getHostCard(),false); + && !c.reduceDamageToZero(AF.getHostCard(),false) + && !c.getKeyword().contains("Indestructible") + && !(c.getSVar("SacMe").length() > 0); } }); @@ -220,15 +222,16 @@ import java.util.Random; // temporarily disabled until better AI if (AF.getAbCost().getSacCost()) { - if(AllZone.HumanPlayer.getLife() - damage > 0) // only if damage from this spell would kill the human + if(AllZone.HumanPlayer.getLife() - damage > 0) // only if damage from this ability would kill the human return false; } if (AF.getAbCost().getSubCounter()) { - if(AllZone.HumanPlayer.getLife() - damage > 0) // only if damage from this spell would kill the human + // +1/+1 counters only if damage from this ability would kill the human, otherwise ok + if(AllZone.HumanPlayer.getLife() - damage > 0 || !AF.getAbCost().getCounterType().equals(Counters.P1P1)) return false; } if (AF.getAbCost().getLifeCost()) { - if(AllZone.HumanPlayer.getLife() - damage > 0) // only if damage from this spell would kill the human + if(AllZone.HumanPlayer.getLife() - damage > 0) // only if damage from this ability would kill the human return false; }