magarena/release/Magarena/scripts/Deadly_Grub.groovy

27 lines
952 B
Groovy
Raw Normal View History

2013-05-18 03:37:57 -07:00
[
new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (triggerData.fromLocation == MagicLocationType.Play &&
permanent.getCounters(MagicCounterType.Charge) == 0) ?
new MagicEvent(
permanent,
this,
"PN puts a 6/1 green Insect creature token " +
"with shroud onto the battlefield."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicPlayTokenAction(
event.getPlayer(),
TokenCardDefinitions.get("Insect2")
));
}
}
]