30 lines
1.0 KiB
Groovy
30 lines
1.0 KiB
Groovy
[
|
|
new MagicWhenDamageIsDealtTrigger() {
|
|
@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,
|
|
"SN deals RN damage to PN."
|
|
) :
|
|
MagicEvent.NONE;
|
|
}
|
|
@Override
|
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
|
final MagicDamage damage = new MagicDamage(
|
|
event.getSource(),
|
|
event.getPlayer(),
|
|
event.getRefInt()
|
|
);
|
|
game.doAction(new MagicDealDamageAction(damage));
|
|
}
|
|
}
|
|
]
|