magarena/release/Magarena/scripts/Angelic_Benediction.groovy

31 lines
1.2 KiB
Groovy

[
//Whenever a creature you control attacks alone, you may tap target creature.
new MagicWhenAttacksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (creature.isFriend(permanent) &&
creature.getController().getNrOfAttackers() == 1) ?
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.NEG_TARGET_CREATURE
),
MagicTapTargetPicker.Tap,
this,
"PN may\$ tap target creature\$."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicTapAction(creature,true));
}
});
}
}
}
]