magarena/release/Magarena/scripts/Artisan_of_Kozilek.groovy

36 lines
1.2 KiB
Groovy

[
new MagicWhenSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicCardOnStack spell) {
return new MagicEvent(
spell,
new MagicMayChoice(
MagicTargetChoice.TARGET_CREATURE_CARD_FROM_GRAVEYARD
),
new MagicGraveyardTargetPicker(true),
this,
"PN may\$ return target creature card\$ from " +
"his or her graveyard to the battlefield."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetCard(game,new MagicCardAction() {
public void doAction(final MagicCard card) {
game.doAction(new MagicReanimateAction(
event.getPlayer(),
card,
MagicPlayCardAction.NONE
));
}
});
}
}
}
]