diff --git a/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java b/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java index f61f3d7b63d..834d9874544 100644 --- a/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/RemoveFromCombatAi.java @@ -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; } diff --git a/forge-ai/src/main/java/forge/ai/ability/UntapAi.java b/forge-ai/src/main/java/forge/ai/ability/UntapAi.java index bb36e18c1bc..3f39feb855c 100644 --- a/forge-ai/src/main/java/forge/ai/ability/UntapAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/UntapAi.java @@ -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"}; diff --git a/forge-gui/res/cardsfolder/g/glorifier_of_dusk.txt b/forge-gui/res/cardsfolder/g/glorifier_of_dusk.txt index d253785b1f2..25de35841c4 100644 --- a/forge-gui/res/cardsfolder/g/glorifier_of_dusk.txt +++ b/forge-gui/res/cardsfolder/g/glorifier_of_dusk.txt @@ -3,6 +3,6 @@ ManaCost:3 W W Types:Creature Vampire Soldier PT:4/4 A:AB$ Pump | Cost$ PayLife<2> | Defined$ Self | KW$ Flying | SpellDescription$ CARDNAME gains flying until end of turn. -A:AB$ Pump | Cost$ PayLife<2> | Defined$ Self | KW$ Vigilance| SpellDescription$ CARDNAME gains vigilance until end of turn. +A:AB$ Pump | Cost$ PayLife<2> | Defined$ Self | KW$ Vigilance | SpellDescription$ CARDNAME gains vigilance until end of turn. SVar:Picture:http://www.wizards.com/global/images/magic/general/glorifier_of_dusk.jpg Oracle:Pay 2 life: Glorifier of Dusk gains flying until end of turn.\nPay 2 life: Glorifier of Dusk gains vigilance until end of turn. \ No newline at end of file diff --git a/forge-gui/res/cardsfolder/t/thaumatic_compass_spires_of_orazca.txt b/forge-gui/res/cardsfolder/t/thaumatic_compass_spires_of_orazca.txt index 83791abb306..187c915d731 100644 --- a/forge-gui/res/cardsfolder/t/thaumatic_compass_spires_of_orazca.txt +++ b/forge-gui/res/cardsfolder/t/thaumatic_compass_spires_of_orazca.txt @@ -14,7 +14,7 @@ Name:Spires of Orazca ManaCost:no cost Types:Land 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. -SVar:RemCombat:DB$ RemoveFromCombat | Defined$ Targeted +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 | AILogic$ RemoveBestAttacker 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.