magarena/release/Magarena/scripts/Trygon_Predator.groovy

32 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-25 19:27:00 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.getTarget().isPlayer() &&
damage.isCombat()) ?
2011-08-13 23:57:22 -07:00
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_ARTIFACT_OR_ENCHANTMENT_YOUR_OPPONENT_CONTROLS
),
new MagicDestroyTargetPicker(false),
this,
2013-05-25 19:43:47 -07:00
"PN may\$ destroy target artifact or enchantment\$ an opponent controls."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-25 19:27:00 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicDestroyAction(permanent));
}
});
2012-06-17 05:19:08 -07:00
}
}
2013-05-25 19:27:00 -07:00
}
]