2013-05-18 06:30:12 -07:00
|
|
|
[
|
|
|
|
new MagicWhenAttacksTrigger() {
|
2012-06-17 05:19:08 -07:00
|
|
|
@Override
|
|
|
|
public MagicEvent executeTrigger(
|
2011-08-10 23:11:56 -07:00
|
|
|
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) {
|
2012-10-07 07:31:10 -07:00
|
|
|
final Collection<MagicPermanent> targets = game.filterPermanents(
|
2012-08-30 05:42:37 -07:00
|
|
|
event.getPlayer(),
|
2011-08-10 23:11:56 -07:00
|
|
|
MagicTargetFilter.TARGET_ATTACKING_CREATURE);
|
2012-10-07 07:31:10 -07:00
|
|
|
for (final MagicPermanent target : targets) {
|
2012-06-17 05:19:08 -07:00
|
|
|
game.doAction(new MagicSetAbilityAction(
|
2012-10-07 07:31:10 -07:00
|
|
|
target,
|
2013-02-17 01:37:27 -08:00
|
|
|
MagicAbility.Flying,
|
2013-05-21 05:26:01 -07:00
|
|
|
MagicAbility.Lifelink
|
2012-10-07 07:31:10 -07:00
|
|
|
));
|
2012-06-17 05:19:08 -07:00
|
|
|
}
|
|
|
|
}
|
2013-05-18 06:30:12 -07:00
|
|
|
}
|
|
|
|
]
|