magarena/release/Magarena/scripts/Conjurer_s_Closet.groovy

45 lines
1.7 KiB
Groovy
Raw Normal View History

2013-05-28 05:16:08 -07:00
[
new MagicAtEndOfTurnTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer eotPlayer) {
return permanent.isController(eotPlayer) ?
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL
),
MagicBounceTargetPicker.getInstance(),
this,
2013-05-28 05:16:08 -07:00
"You may\$ exile target creature\$ you control, then return " +
2013-04-12 19:32:25 -07:00
"that card to the battlefield under your control."
):
MagicEvent.NONE;
}
@Override
2013-05-28 05:16:08 -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 creature) {
game.doAction(new MagicRemoveFromPlayAction(
creature,
MagicLocationType.Exile
));
game.doAction(new MagicRemoveCardAction(
creature.getCard(),
MagicLocationType.Exile
));
game.doAction(new MagicPlayCardAction(
creature.getCard(),
event.getPlayer(),
MagicPlayCardAction.NONE
));
}
});
}
}
2013-05-28 05:16:08 -07:00
}
]