"Tap target creature" ability

I created some AI for the cards that have the "Tap target creature" ability. It works fairly well in my play testing. The computer will check to see if it has in play one of the Royal Assassin type creatures. This combo finally works.
If the computer does not have one of the Royal Assassin type creatures in play it will check to see if it will be attacking and will tap a big blocking creature.
If the computer does not have one of the Royal Assassin type creatures in play it will check to see if it will be attacking and will tap a big blocking creature.

- Code: Select all
public boolean canPlayAI() {
CardList human = CardFactoryUtil.AI_getHumanCreature(card, true);
human = human.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isUntapped() && CardFactoryUtil.canTarget(card, c);
}
});
if (human.size() > 0) {
CardListUtil.sortAttack(human);
CardListUtil.sortFlying(human);
setTargetCard(human.get(0));
}
PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
CardList assassins = new CardList();
assassins.addAll(play.getCards());
assassins = assassins.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isCreature() && (!c.hasSickness() || c.getKeyword().contains("Haste")) && c.isUntapped() &&
(c.getName().equals("Rathi Assassin") || c.getName().equals("Royal Assassin") || c.getName().equals("Tetsuo Umezawa"));
}
});
Combat attackers = ComputerUtil.getAttackers();
CardList list = new CardList(attackers.getAttackers());
return (AllZone.Phase.getPhase().equals(Constant.Phase.Main1) && AllZone.Phase.getActivePlayer().equals(card.getController()) &&
human.size() > 0 && (assassins.size() > 0 || !list.contains(card)));
}//canPlayAI