magarena/release/Magarena/scripts/Death_Pits_of_Rath.groovy

23 lines
881 B
Groovy

[
new MagicWhenDamageIsDealtTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
final MagicTarget target = damage.getTarget();
return target.isCreature() ?
new MagicEvent(
permanent,
target,
this,
"Destroy RN. It can't be regenerated."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPermanent creature = event.getRefPermanent();
game.doAction(MagicChangeStateAction.Set(creature,MagicPermanentState.CannotBeRegenerated));
game.doAction(new MagicDestroyAction(creature));
}
}
]