- Implemented simple AI for Spires of Orazca.

This commit is contained in:
Agetian
2017-10-01 04:24:42 +00:00
parent 9a45a84663
commit bd70662314
4 changed files with 19 additions and 4 deletions

View File

@@ -17,6 +17,12 @@ public class RemoveFromCombatAi extends SpellAbilityAi {
public boolean chkAIDrawback(SpellAbility sa, Player aiPlayer) {
// AI should only activate this during Human's turn
if ("RemoveBestAttacker".equals(sa.getParam("AILogic"))) {
if (aiPlayer.getGame().getCombat() != null && aiPlayer.getGame().getCombat().getDefenders().contains(aiPlayer)) {
return true;
}
}
// TODO - implement AI
return false;
}

View File

@@ -140,7 +140,16 @@ public class UntapAi extends SpellAbilityAi {
return false;
}
CardCollection untapList = CardLists.filter(list, Presets.TAPPED);
// For some abilities, it may be worth to target even an untapped card if we're targeting mostly for the subability
boolean targetUntapped = false;
if (sa.getSubAbility() != null) {
SpellAbility subSa = sa.getSubAbility();
if (subSa.getApi() == ApiType.RemoveFromCombat && "RemoveBestAttacker".equals(subSa.getParam("AILogic"))) {
targetUntapped = true;
}
}
CardCollection untapList = targetUntapped ? list : CardLists.filter(list, Presets.TAPPED);
// filter out enchantments and planeswalkers, their tapped state doesn't
// matter.
final String[] tappablePermanents = {"Creature", "Land", "Artifact"};