mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Implemented simple AI for Spires of Orazca.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"};
|
||||
|
||||
Reference in New Issue
Block a user