magarena/release/Magarena/scripts/Eyes_of_the_Wisent.groovy

24 lines
947 B
Groovy

[
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
return (permanent.isEnemy(cardOnStack) &&
cardOnStack.hasColor(MagicColor.Blue) &&
permanent.isController(game.getTurnPlayer())) ?
new MagicEvent(
permanent,
new MagicMayChoice(),
this,
"PN may\$ put a 4/4 green Elemental creature token onto the battlefield."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicPlayTokenAction(event.getPlayer(), TokenCardDefinitions.get("G Elemental")));
}
}
}
]