magarena/release/Magarena/scripts/Call_to_the_Grave.groovy

43 lines
1.5 KiB
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer player) {
return new MagicEvent(
permanent,
player,
this,
"PN sacrifices a non-Zombie creature."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
player,
MagicTargetChoice.SACRIFICE_NON_ZOMBIE
));
}
},
new MagicAtEndOfTurnTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer eotPlayer) {
final Collection<MagicPermanent> targets =
game.filterPermanents(permanent.getController(),MagicTargetFilter.TARGET_CREATURE);
return (targets.size() == 0) ?
new MagicEvent(
permanent,
this,
"Sacrifice SN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicSacrificeAction(event.getPermanent()));
}
}
]