magarena/release/Magarena/scripts/Inferno_Elemental.groovy

52 lines
1.9 KiB
Groovy

[
new MagicWhenBecomesBlockedTrigger() {
@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 3 damage to each blocking creature."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanentList plist = event.getRefPermanentList();
for (final MagicPermanent blocker : plist) {
final MagicDamage damage = new MagicDamage(event.getSource(),blocker,3);
game.doAction(new MagicDealDamageAction(damage));
}
}
},
new MagicWhenBlocksTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent blocker) {
final MagicPermanent blocked = permanent.getBlockedCreature();
return (permanent == blocker && blocked.isValid()) ?
new MagicEvent(
permanent,
blocked,
this,
"SN deals 3 damage to RN."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicDamage damage = new MagicDamage(
event.getPermanent(),
event.getRefPermanent(),
3
);
game.doAction(new MagicDealDamageAction(damage));
}
}
]