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,
|
2013-10-27 20:30:35 -07:00
|
|
|
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
|
|
|
}
|
|
|
|
]
|