Improved the AI for Intrepid Hero. The AI will no longer target creatures with Indestructible.

This commit is contained in:
jendave
2011-08-06 05:30:26 +00:00
parent 42ce9cf88c
commit 15eb9be172

View File

@@ -7098,25 +7098,26 @@ public class CardFactory_Creatures {
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {
return getHumanCreatures().size() != 0; return getCreature().size() != 0;
} }//canPlayAI()
@Override CardList getCreature() {
public void chooseTargetAI() { CardList list = CardFactoryUtil.AI_getHumanCreature(card, true);
CardList human = getHumanCreatures();
human.shuffle();
setTargetCard(human.get(0));
}
CardList getHumanCreatures() {
CardList list = new CardList(AllZone.Human_Play.getCards());
list = list.filter(new CardListFilter() { list = list.filter(new CardListFilter() {
public boolean addCard(Card c) { public boolean addCard(Card c) {
return c.isCreature() && 3 < c.getNetAttack(); return CardFactoryUtil.canTarget(card, c)
&& !c.getKeyword().contains("Indestructible")
&& c.getNetAttack() > 3;
} }
}); });
return list; return list;
} }//getCreature()
@Override
public void chooseTargetAI() {
Card best = CardFactoryUtil.AI_getBestCreature(getCreature());
setTargetCard(best);
}//chooseTargetAI()
};//SpellAbility };//SpellAbility
Input target = new Input() { Input target = new Input() {
@@ -7135,8 +7136,10 @@ public class CardFactory_Creatures {
@Override @Override
public void selectCard(Card c, PlayerZone zone) { public void selectCard(Card c, PlayerZone zone) {
if(c.isCreature() && zone.is(Constant.Zone.Play) && if (c.isCreature()
3 < c.getNetAttack() && CardFactoryUtil.canTarget(card, c)) { && zone.is(Constant.Zone.Play)
&& 3 < c.getNetAttack()
&& CardFactoryUtil.canTarget(card, c)) {
ability.setTargetCard(c); ability.setTargetCard(c);
stopSetNext(new Input_NoCost_TapAbility(ability)); stopSetNext(new Input_NoCost_TapAbility(ability));
} }