magarena/release/Magarena/scripts/Rukh_Egg.groovy

30 lines
1.1 KiB
Groovy
Raw Normal View History

[
new MagicWhenDiesTrigger() {
@Override
public MagicEvent getEvent(final MagicPermanent permanent) {
return new MagicEvent(
permanent,
this,
"PN puts a 4/4 red Bird creature token with flying onto the battlefield at the beginning of the next end step."
);
}
@Override
public void executeEvent(
final MagicGame outerGame,
2013-03-22 22:00:53 -07:00
final MagicEvent event) {
//insert trigger to act at the beginning of the next end step
outerGame.doAction(new MagicAddTriggerAction(new MagicAtEndOfTurnTrigger() {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final eotPlayer) {
game.doAction(new MagicPlayTokenAction(
game.getPlayer(event.getPlayer().getIndex()),
TokenCardDefinitions.get("Bird4")
));
game.addDelayedAction(new MagicRemoveTriggerAction(this));
return MagicEvent.NONE;
}
}));
}
}
]