magarena/release/Magarena/scripts/Nettle_Sentinel.groovy

28 lines
994 B
Groovy

[
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
return (permanent.isFriend(cardOnStack) &&
cardOnStack.hasColor(MagicColor.Green) &&
permanent.isTapped()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.UNTAP,
1,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ untap SN."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicUntapAction(event.getPermanent()));
}
}
}
]