magarena/release/Magarena/scripts/Pariah.groovy

13 lines
526 B
Groovy
Raw Normal View History

2013-07-23 00:53:05 -07:00
[
new MagicIfDamageWouldBeDealtTrigger(MagicTrigger.REPLACE_DAMAGE) {
2013-07-23 00:53:05 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
if (permanent.isController(damage.getTarget()) && permanent.getEnchantedCreature().isValid()) {
// Replacement effect. Generates no event or action.
damage.setTarget(permanent.getEnchantedCreature());
}
return MagicEvent.NONE;
}
}
]