magarena/release/Magarena/scripts/Restoration_Angel.groovy

42 lines
1.7 KiB
Groovy
Raw Normal View History

2013-05-28 05:50:02 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
2013-06-19 07:23:35 -07:00
final MagicPayedCost payedCost) {
2013-04-12 19:32:25 -07:00
return new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.TARGET_NON_ANGEL_CREATURE_YOU_CONTROL
),
2013-06-30 01:53:17 -07:00
MagicBounceTargetPicker.create(),
2013-04-12 19:32:25 -07:00
this,
2013-05-28 05:50:02 -07:00
"You may\$ exile target non-Angel creature\$ you control, then return " +
2013-04-12 19:32:25 -07:00
"that card to the battlefield under your control."
);
}
@Override
2013-05-28 05:50:02 -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
));
final MagicRemoveCardAction removeCard = new MagicRemoveCardAction(creature.getCard(), MagicLocationType.Exile);
game.doAction(removeCard);
if (removeCard.isValid()) {
game.doAction(new MagicPlayCardAction(
creature.getCard(),
2013-07-10 05:01:39 -07:00
event.getPlayer()
2013-04-12 19:32:25 -07:00
));
}
}
});
}
}
2013-05-28 05:50:02 -07:00
}
]