magarena/release/Magarena/scripts/Followed_Footsteps.groovy

25 lines
1006 B
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
final MagicPermanent enchanted = permanent.getEnchantedCreature();
return permanent.isController(upkeepPlayer) && enchanted.isValid() ?
new MagicEvent(
permanent,
this,
"PN puts a token that's a copy of enchanted creature onto the battlefield."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent permanent=event.getPermanent();
final MagicPermanent enchanted=permanent.getEnchantedCreature();
if (enchanted.isValid()) {
game.doAction(new MagicPlayTokenAction(event.getPlayer(),enchanted.getCardDefinition()));
}
}
}
]