magarena/release/Magarena/scripts/Kiki_Jiki__Mirror_Breaker.g...

37 lines
1.4 KiB
Groovy

[
new MagicPermanentActivation(
[MagicCondition.CAN_TAP_CONDITION],
new MagicActivationHints(MagicTiming.Token),
"Copy"
) {
@Override
public MagicEvent[] getCostEvent(final MagicPermanent source) {
return [new MagicTapEvent(source)];
}
@Override
public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
return new MagicEvent(
source,
MagicTargetChoice.TARGET_NON_LEGENDARY_CREATURE_YOU_CONTROL,
MagicCopyTargetPicker.create(),
this,
"Put a token that's a copy of target nonlegendary creature\$ you control onto the battlefield. "+
"That token has haste. Sacrifice it at end of turn."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
final MagicPlayer player=event.getPlayer();
final MagicCard card=MagicCard.createTokenCard(creature.getCardDefinition(),player);
game.doAction(new MagicPlayCardAction(card,player,MagicPlayCardAction.HASTE_SACRIFICE_AT_END_OF_TURN));
}
});
}
}
]