magarena/release/Magarena/scripts/Judge_of_Currents.groovy

28 lines
990 B
Groovy

[
new MagicWhenBecomesTappedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent tapped) {
return (tapped.isFriend(permanent) &&
tapped.isCreature() &&
tapped.hasSubType(MagicSubType.Merfolk)) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ gain 1 life."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
}
}
}
]