magarena/release/Magarena/scripts/Deathgazer.groovy

27 lines
1001 B
Groovy
Raw Normal View History

2013-05-30 06:27:18 -07:00
[
new MagicWhenBlocksOrBecomesBlockedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent blocker) {
final MagicPermanent target = permanent == blocker ? blocker.getBlockedCreature() : blocker;
return !target.hasColor(MagicColor.Black) ?
2013-04-12 19:32:25 -07:00
new MagicEvent(
permanent,
target,
2013-04-12 19:32:25 -07:00
this,
2013-05-30 06:27:18 -07:00
"Destroy RN at end of combat."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-30 06:27:18 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processRefPermanent(game, {
final MagicPermanent permanent ->
game.doAction(new MagicAddTriggerAction(
permanent,
MagicAtEndOfCombatTrigger.Destroy
))
} as MagicPermanentAction);
2013-04-12 19:32:25 -07:00
}
2013-05-30 06:27:18 -07:00
}
]