magarena/release/Magarena/scripts/Rock_Basilisk.groovy

27 lines
1004 B
Groovy

[
new MagicWhenBlocksOrBecomesBlockedTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent blocker) {
final MagicPermanent target = permanent == blocker ? blocker.getBlockedCreature() : blocker;
return !target.hasSubType(MagicSubType.Wall) ?
new MagicEvent(
permanent,
target,
this,
"Destroy RN at end of combat."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processRefPermanent(game, {
final MagicPermanent permanent ->
game.doAction(new MagicAddTriggerAction(
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
}
}
]