- 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) { public boolean chkAIDrawback(SpellAbility sa, Player aiPlayer) {
// AI should only activate this during Human's turn // 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 // TODO - implement AI
return false; return false;
} }

View File

@@ -140,7 +140,16 @@ public class UntapAi extends SpellAbilityAi {
return false; 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 // filter out enchantments and planeswalkers, their tapped state doesn't
// matter. // matter.
final String[] tappablePermanents = {"Creature", "Land", "Artifact"}; final String[] tappablePermanents = {"Creature", "Land", "Artifact"};

View File

@@ -14,7 +14,7 @@ Name:Spires of Orazca
ManaCost:no cost ManaCost:no cost
Types:Land Types:Land
A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 1 | SpellDescription$ Add {C} to your mana pool. A:AB$ Mana | Cost$ T | Produced$ C | Amount$ 1 | SpellDescription$ Add {C} to your mana pool.
A:AB$ Untap | Cost$ T | ValidTgts$ Creature.attacking+OppCtrl | TgtPrompt$ Select target attacking creature an opponent controls | SubAbility$ RemCombat | SpellDescription$ Untap target attacking creature an opponent controls and remove it from combat. A:AB$ Untap | Cost$ T | ValidTgts$ Creature.attacking+OppCtrl | IsCurse$ True | TgtPrompt$ Select target attacking creature an opponent controls | SubAbility$ RemCombat | SpellDescription$ Untap target attacking creature an opponent controls and remove it from combat.
SVar:RemCombat:DB$ RemoveFromCombat | Defined$ Targeted SVar:RemCombat:DB$ RemoveFromCombat | Defined$ Targeted | AILogic$ RemoveBestAttacker
SVar:Picture:http://www.wizards.com/global/images/magic/general/spires_of_orazca.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/spires_of_orazca.jpg
Oracle:(Transforms from Thaumatic Compass.)\n{T}: Add {C} to your mana pool.\n{T}: Untap target attacking creature an opponent controls and remove it from combat. Oracle:(Transforms from Thaumatic Compass.)\n{T}: Add {C} to your mana pool.\n{T}: Untap target attacking creature an opponent controls and remove it from combat.