magarena/release/Magarena/scripts/Spiteful_Shadows.groovy

30 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 06:30:51 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicDamage damage) {
final int amount = damage.getDealtAmount();
final MagicPermanent enchantedCreature = permanent.getEnchantedCreature();
return (damage.getTarget() == enchantedCreature) ?
new MagicEvent(
enchantedCreature,
amount,
this,
2013-05-18 06:30:51 -07:00
"SN deals RN damage to PN."
) :
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-18 06:30:51 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicDamage damage = new MagicDamage(
event.getSource(),
event.getPlayer(),
event.getRefInt()
);
game.doAction(new MagicDealDamageAction(damage));
}
2013-05-18 06:30:51 -07:00
}
]