mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Improved the AI for Crib Swap.
This commit is contained in:
@@ -6555,32 +6555,30 @@ public class CardFactory implements NewConstants {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList creature = new CardList(AllZone.Human_Play.getCards());
|
return (getCreature().size() != 0) && (AllZone.Phase.getTurn() > 4);
|
||||||
creature = creature.getType("Creature");
|
}//canPlayAI()
|
||||||
creature = creature.filter(new CardListFilter()
|
|
||||||
{
|
CardList getCreature() {
|
||||||
public boolean addCard(Card c)
|
CardList list = CardFactoryUtil.AI_getHumanCreature(card, true);
|
||||||
{
|
list = list.filter(new CardListFilter() {
|
||||||
return !c.getName().equals("Shapeshifter");
|
public boolean addCard(Card c) {
|
||||||
}
|
return (c.getNetAttack() > 2
|
||||||
|
&& CardFactoryUtil.canTarget(card, c)
|
||||||
|
&& (!c.getName().equals("Shapeshifter")
|
||||||
|
|| (c.getName().equals("Shapeshifter")
|
||||||
|
&& (c.isEnchanted()
|
||||||
|
|| c.getCounters(Counters.P1P1) != 0))));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
return list;
|
||||||
if (creature.size()>0) {
|
}//getCreature()
|
||||||
Card target = CardFactoryUtil.AI_getBestCreature(creature);
|
|
||||||
setTargetCard(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
return creature.size() != 0 && (AllZone.Phase.getTurn() > 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
CardList play = new CardList(AllZone.Human_Play.getCards());
|
Card best = CardFactoryUtil.AI_getBestCreature(getCreature());
|
||||||
Card target = CardFactoryUtil.AI_getBestCreature(play);
|
setTargetCard(best);
|
||||||
setTargetCard(target);
|
}//chooseTargetAI()
|
||||||
}
|
};//SpellAbility
|
||||||
|
|
||||||
};
|
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
|
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
|
||||||
|
|
||||||
card.setSVar("PlayMain1", "TRUE");
|
card.setSVar("PlayMain1", "TRUE");
|
||||||
|
|||||||
Reference in New Issue
Block a user