magarena/release/Magarena/scripts/Goldnight_Commander.groovy

29 lines
1.1 KiB
Groovy

[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
otherPermanent.isFriend(permanent) &&
otherPermanent.isCreature()) ?
new MagicEvent(
permanent,
this,
"Creatures PN controls get +1/+1 until end of turn."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets = game.filterPermanents(
event.getPlayer(),
MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL);
for (final MagicPermanent target : targets) {
game.doAction(new MagicChangeTurnPTAction(target,1,1));
}
}
}
]