From c064ec3860e42305dba3407a602393044a782da5 Mon Sep 17 00:00:00 2001 From: Agetian Date: Fri, 30 Nov 2018 22:57:29 +0300 Subject: [PATCH] - Improved UntapAllAi a little, modified AmbushAI flag for Angel of the Dire Hour. --- .../src/main/java/forge/ai/ability/UntapAllAi.java | 10 ++++++++++ forge-gui/res/cardsfolder/a/angel_of_the_dire_hour.txt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/UntapAllAi.java b/forge-ai/src/main/java/forge/ai/ability/UntapAllAi.java index 355c8989ac1..9c43797bcd5 100644 --- a/forge-ai/src/main/java/forge/ai/ability/UntapAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/UntapAllAi.java @@ -5,6 +5,7 @@ import forge.game.ability.ApiType; import forge.game.card.Card; import forge.game.card.CardCollectionView; import forge.game.card.CardLists; +import forge.game.card.CardPredicates; import forge.game.phase.PhaseType; import forge.game.player.Player; import forge.game.spellability.AbilitySub; @@ -35,6 +36,15 @@ public class UntapAllAi extends SpellAbilityAi { @Override protected boolean doTriggerAINoCost(Player aiPlayer, SpellAbility sa, boolean mandatory) { + Card source = sa.getHostCard(); + + if (sa.hasParam("ValidCards")) { + String valid = sa.getParam("ValidCards"); + CardCollectionView list = CardLists.filter(aiPlayer.getGame().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.TAPPED); + list = CardLists.getValidCards(list, valid.split(","), source.getController(), source, sa); + return mandatory || !list.isEmpty(); + } + return mandatory; } } diff --git a/forge-gui/res/cardsfolder/a/angel_of_the_dire_hour.txt b/forge-gui/res/cardsfolder/a/angel_of_the_dire_hour.txt index 38d43b78ba6..61710ba4e11 100644 --- a/forge-gui/res/cardsfolder/a/angel_of_the_dire_hour.txt +++ b/forge-gui/res/cardsfolder/a/angel_of_the_dire_hour.txt @@ -6,6 +6,6 @@ K:Flash K:Flying T:Mode$ ChangesZone | ValidCard$ Card.wasCastFromHand+Self | Destination$ Battlefield | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it from your hand, exile all attacking creatures. SVar:TrigExile:DB$ ChangeZoneAll | ChangeType$ Creature.attacking | Origin$ Battlefield | Destination$ Exile -SVar:AmbushAI:True +SVar:AmbushAI:BlockOnly SVar:Picture:http://www.wizards.com/global/images/magic/general/angel_of_the_dire_hour.jpg Oracle:Flash\nFlying\nWhen Angel of the Dire Hour enters the battlefield, if you cast it from your hand, exile all attacking creatures.