* Firebolt fix AI targets

This commit is contained in:
jendave
2011-08-06 04:29:01 +00:00
parent a0abe0df67
commit 64895cab25

View File

@@ -7610,8 +7610,13 @@ public class CardFactory implements NewConstants {
}
Card c = getFlying();
if((c == null) || (!check.equals(c))) throw new RuntimeException(card
+ " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check);
if((c == null) || (!check.equals(c))) {
c = getAnyCreature();
if (c == null) {
setTargetPlayer(Constant.Player.Human);
return;
}
}
setTargetCard(c);
}//chooseTargetAI()
@@ -7625,6 +7630,14 @@ public class CardFactory implements NewConstants {
return null;
}
Card getAnyCreature() {
CardList creatures = CardFactoryUtil.AI_getHumanCreature(card, true);
for(int i = 0; i < creatures.size(); i++)
if(creatures.get(i).getNetDefense() <= damage) return creatures.get(i);
return null;
}
@Override
public void resolve() {
if(getTargetCard() != null) {