magarena/release/Magarena/scripts/Lab_Rats.groovy

27 lines
981 B
Groovy

[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicBuybackChoice(MagicManaCost.create("{4}")),
this,
"PN puts a 1/1 black Rat creature token onto the " +
"battlefield. If the buyback cost was payed\$, " +
"return SN to its owner's hand as it resolves."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
game.doAction(new MagicPlayTokenAction(
event.getPlayer(),
TokenCardDefinitions.get("Rat1")
));
if (event.isBuyback()) {
game.doAction(new MagicChangeCardDestinationAction(event.getCardOnStack(), MagicLocationType.OwnersHand));
}
}
}
]