From 6c92cc0884b6bcee5c73d4e0aacabf76793bb9e7 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 07:14:13 +0000 Subject: [PATCH] - The AI is now taking damage already dealt into account when deciding to cast spDamageAll spells. - Changed the targeting of players AI of spDamageTgt to what the comments say. --- src/forge/CardFactory.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index c5eaece74cf..dca31050f32 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -1961,7 +1961,7 @@ public class CardFactory implements NewConstants { if(hand.size() >= 7) // anti-discard-at-EOT return true; - if(AllZone.Human_Life.getLife() < (10 - damage)) // if damage from this spell would drop the human to less than 10 life + if(AllZone.Human_Life.getLife() < (10 + damage)) // if damage from this spell would drop the human to less than 10 life return true; return false; @@ -2202,7 +2202,11 @@ public class CardFactory implements NewConstants { human = human.getValidCards(Tgts); human = human.canBeDamagedBy(card); human = human.getNotKeyword("Indestructible"); - human = CardListUtil.filterToughness(human, ndam); // leaves all creatures that will be destroyed + human = human.filter(new CardListFilter() { + public boolean addCard(Card c) { + return (c.getKillDamage() <= getNumDam()); + } + }); // leaves all creatures that will be destroyed int humanvalue = CardListUtil.sumCMC(human); humanvalue += human.size(); humanvalue += CardListUtil.sumAttack(human.getTokens()); @@ -2213,7 +2217,11 @@ public class CardFactory implements NewConstants { computer = computer.getValidCards(Tgts); computer = computer.canBeDamagedBy(card); computer = computer.getNotKeyword("Indestructible"); - computer = CardListUtil.filterToughness(computer, ndam); // leaves all creatures that will be destroyed + computer = computer.filter(new CardListFilter() { + public boolean addCard(Card c) { + return (c.getKillDamage() <= getNumDam()); + } + }); // leaves all creatures that will be destroyed int computervalue = CardListUtil.sumCMC(computer); computervalue += computer.size(); computervalue += CardListUtil.sumAttack(computer.getTokens());