magarena/release/Magarena/scripts/Soltari_Visionary.groovy

28 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 22:30:04 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.getTarget().isPlayer()) ?
new MagicEvent(
permanent,
permanent.isController(damage.getTarget()) ?
MagicTargetChoice.TARGET_ENCHANTMENT_YOU_CONTROL :
MagicTargetChoice.TARGET_ENCHANTMENT_YOUR_OPPONENT_CONTROLS,
MagicDestroyTargetPicker.Destroy,
2013-04-12 19:32:25 -07:00
this,
2013-05-18 22:30:04 -07:00
"Destroy target enchantment\$."
2013-04-12 19:32:25 -07:00
):
MagicEvent.NONE;
}
@Override
2013-05-18 22:30:04 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent perm) {
game.doAction(new MagicDestroyAction(perm));
}
});
}
2013-05-18 22:30:04 -07:00
}
]