magarena/release/Magarena/scripts/Floral_Spuzzem.groovy

34 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-26 03:29:29 -07:00
[
new MagicWhenAttacksUnblockedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent creature) {
return (creature == permanent) ?
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_ARTIFACT_YOUR_OPPONENT_CONTROLS
),
new MagicDestroyTargetPicker(false),
this,
2013-05-26 03:29:29 -07:00
"PN may\$ destroy target artifact\$."
2013-04-12 19:32:25 -07:00
):
MagicEvent.NONE;
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
2013-05-26 03:29:29 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent target) {
game.doAction(new MagicDestroyAction(target));
}
});
game.doAction(MagicChangeStateAction.Set(
2013-05-26 03:29:29 -07:00
event.getPermanent(),
MagicPermanentState.NoCombatDamage
2013-05-26 03:29:29 -07:00
));
2013-04-12 19:32:25 -07:00
}
}
2013-05-26 03:29:29 -07:00
}
]