mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Improved the AI for Intrepid Hero. The AI will no longer target creatures with Indestructible.
This commit is contained in:
@@ -7098,25 +7098,26 @@ public class CardFactory_Creatures {
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return getHumanCreatures().size() != 0;
|
||||
}
|
||||
return getCreature().size() != 0;
|
||||
}//canPlayAI()
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
CardList human = getHumanCreatures();
|
||||
human.shuffle();
|
||||
setTargetCard(human.get(0));
|
||||
}
|
||||
|
||||
CardList getHumanCreatures() {
|
||||
CardList list = new CardList(AllZone.Human_Play.getCards());
|
||||
CardList getCreature() {
|
||||
CardList list = CardFactoryUtil.AI_getHumanCreature(card, true);
|
||||
list = list.filter(new CardListFilter() {
|
||||
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;
|
||||
}
|
||||
}//getCreature()
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
Card best = CardFactoryUtil.AI_getBestCreature(getCreature());
|
||||
setTargetCard(best);
|
||||
}//chooseTargetAI()
|
||||
};//SpellAbility
|
||||
|
||||
Input target = new Input() {
|
||||
@@ -7135,8 +7136,10 @@ public class CardFactory_Creatures {
|
||||
|
||||
@Override
|
||||
public void selectCard(Card c, PlayerZone zone) {
|
||||
if(c.isCreature() && zone.is(Constant.Zone.Play) &&
|
||||
3 < c.getNetAttack() && CardFactoryUtil.canTarget(card, c)) {
|
||||
if (c.isCreature()
|
||||
&& zone.is(Constant.Zone.Play)
|
||||
&& 3 < c.getNetAttack()
|
||||
&& CardFactoryUtil.canTarget(card, c)) {
|
||||
ability.setTargetCard(c);
|
||||
stopSetNext(new Input_NoCost_TapAbility(ability));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user