magarena/release/Magarena/scripts/Eldrazi_Monument.groovy

26 lines
991 B
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
this,
"PN sacrifices a creature. If you can't, sacrifice SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent=event.getPermanent();
final MagicPlayer player=event.getPlayer();
if (player.controlsPermanent(MagicType.Creature)) {
game.addEvent(new MagicSacrificePermanentEvent(permanent,player,MagicTargetChoice.SACRIFICE_CREATURE));
} else {
game.doAction(new MagicSacrificeAction(permanent));
}
}
}
]