magarena/release/Magarena/scripts/Jotun_Owl_Keeper.groovy

27 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 04:46:47 -07:00
[
new MagicWhenLeavesPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicRemoveFromPlayAction act) {
2013-04-12 19:32:25 -07:00
final int amount = permanent.getCounters(MagicCounterType.Charge);
return (act.isPermanent(permanent) && amount > 0) ?
2013-04-12 19:32:25 -07:00
new MagicEvent(
permanent,
amount,
this,
amount > 1 ?
"PN puts " + amount + " 1/1 white Bird creature tokens with flying onto the battlefield." :
"PN puts a 1/1 white Bird creature token with flying onto the battlefield."
):
MagicEvent.NONE;
}
@Override
2013-05-18 04:46:47 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
game.doAction(new MagicPlayTokensAction(
event.getPlayer(),
TokenCardDefinitions.get("Bird1"),
event.getRefInt()
));
}
2013-05-18 04:46:47 -07:00
}
]