magarena/release/Magarena/scripts/Tolarian_Emissary.groovy

26 lines
917 B
Groovy
Raw Normal View History

2013-07-19 05:41:20 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
return payedCost.isKicked() ?
new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_ENCHANTMENT,
new MagicDestroyTargetPicker(false),
this,
"Destroy target enchantment\$."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent target) {
game.doAction(new MagicDestroyAction(target));
}
});
}
}
]