magarena/release/Magarena/scripts/Somberwald_Vigilante.groovy

30 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 04:58:17 -07:00
[
new MagicWhenBecomesBlockedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPermanent attacker) {
if (permanent != attacker) {
return MagicEvent.NONE;
}
final MagicPermanentList plist = new MagicPermanentList(permanent.getBlockingCreatures());
return new MagicEvent(
permanent,
plist,
this,
"SN deals 1 damage to each blocking creature."
);
}
@Override
2013-05-18 04:58:17 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicPermanentList plist = event.getRefPermanentList();
for (final MagicPermanent blocker : plist) {
final MagicDamage damage = new MagicDamage(event.getSource(),blocker,1);
game.doAction(new MagicDealDamageAction(damage));
}
}
2013-05-18 04:58:17 -07:00
}
]