magarena/release/Magarena/scripts/Stitcher_s_Apprentice.groovy

43 lines
1.5 KiB
Groovy

def action = {
final MagicGame game, final MagicEvent event ->
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent permanent) {
game.doAction(new MagicSacrificeAction(permanent));
}
});
};
[
new MagicPermanentActivation(
new MagicActivationHints(MagicTiming.Token),
"Token"
) {
@Override
public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source), new MagicPayManaCostEvent(source, "{1}{U}")];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
this,
"PN puts a 2/2 blue Homunculus creature token " +
"onto the battlefield, then sacrifices a creature."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
game.doAction(new MagicPlayTokenAction(player,TokenCardDefinitions.get("2/2 blue Homunculus creature token")));
game.addEvent(new MagicEvent(
event.getSource(),
player,
MagicTargetChoice.SACRIFICE_CREATURE,
MagicSacrificeTargetPicker.create(),
action,
"Choose a creature to sacrifice\$."
));
}
}
]