magarena/release/Magarena/scripts/Telim_Tor.groovy

30 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 05:54:18 -07:00
[
new MagicWhenAttacksTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent attacker) {
return (permanent == attacker) ?
new MagicEvent(
permanent,
this,
"Attacking creatures with flanking get +1/+1 until end of turn."
):
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
2013-05-18 05:54:18 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final Collection<MagicPermanent> targets = game.filterPermanents(
event.getPlayer(),
MagicTargetFilter.TARGET_ATTACKING_CREATURE);
for (final MagicPermanent creature : targets) {
if (creature.hasAbility(MagicAbility.Flanking)) {
2013-06-23 18:29:26 -07:00
game.doAction(new MagicChangeTurnPTAction(creature,1,1));
2013-04-12 19:32:25 -07:00
}
}
2013-06-23 18:29:26 -07:00
}
2013-05-18 05:54:18 -07:00
}
]