magarena/release/Magarena/scripts/Victory_s_Herald.groovy

32 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 06:30:12 -07:00
[
new MagicWhenAttacksTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
2012-10-07 01:48:51 -07:00
final MagicPermanent attacker) {
return (permanent==attacker) ?
2012-06-17 05:19:08 -07:00
new MagicEvent(
2011-09-04 00:49:20 -07:00
permanent,
this,
2012-10-07 01:48:51 -07:00
"Attacking creatures gain flying and lifelink until end of turn."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-18 06:30:12 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
final Collection<MagicPermanent> targets = game.filterPermanents(
2012-08-30 05:42:37 -07:00
event.getPlayer(),
MagicTargetFilter.TARGET_ATTACKING_CREATURE);
for (final MagicPermanent target : targets) {
2012-06-17 05:19:08 -07:00
game.doAction(new MagicSetAbilityAction(
target,
MagicAbility.Flying,
2013-05-21 05:26:01 -07:00
MagicAbility.Lifelink
));
2012-06-17 05:19:08 -07:00
}
}
2013-05-18 06:30:12 -07:00
}
]