- Improved UntapAllAi a little, modified AmbushAI flag for Angel of the Dire Hour.

This commit is contained in:
Agetian
2018-11-30 22:57:29 +03:00
parent 5c047b3849
commit c064ec3860
2 changed files with 11 additions and 1 deletions

View File

@@ -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;
}
}

View File

@@ -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.