magarena/release/Magarena/scripts/Binding_Grasp.groovy

27 lines
914 B
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}{U}"))
),
this,
"PN may\$ pay {1}{U}\$. If you don't, sacrifice SN."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isNo()) {
game.doAction(new MagicSacrificeAction(event.getPermanent()));
}
}
}
]