From 6eb1f45f9125f09e99cd7e39c757a0bb01a80b25 Mon Sep 17 00:00:00 2001 From: Sloth Date: Sun, 28 Aug 2011 15:58:06 +0000 Subject: [PATCH] - Small improvement of AI in PreventDamage AF. --- .../card/abilityFactory/AbilityFactory_PreventDamage.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java index 348688921bf..da5ccd19107 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_PreventDamage.java @@ -17,7 +17,7 @@ import java.util.HashMap; */ public class AbilityFactory_PreventDamage { - // Ex: A:SP$ PreventDamage | Cost$ W | Tgt$ TgtC | Amount$ 3 | SpellDescription$ Prevent the next 3 damage that would be dealt to target creature this turn. + // Ex: A:SP$ PreventDamage | Cost$ W | Tgt$ TgtC | Amount$ 3 | SpellDescription$ Prevent the next 3 damage that would be dealt to ... // http://www.slightlymagic.net/wiki/Forge_AbilityFactory#PreventDamage /** @@ -216,7 +216,9 @@ public class AbilityFactory_PreventDamage { flag |= CombatUtil.combatantWouldBeDestroyed(c); } else if (o instanceof Player) { Player p = (Player) o; - flag |= (p.isComputer() && CombatUtil.lifeInDanger(AllZone.getCombat())); + flag |= (p.isComputer() && + ((CombatUtil.wouldLoseLife(AllZone.getCombat()) && sa.isAbility()) || + CombatUtil.lifeInDanger(AllZone.getCombat()))) ; } }