magarena/release/Magarena/scripts/Rite_of_Replication.groovy

35 lines
1.4 KiB
Groovy
Raw Normal View History

2013-05-27 00:03:15 -07:00
[
new MagicSpellCardEvent() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent getEvent(
final MagicCardOnStack cardOnStack,
final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
new MagicKickerChoice(
MagicTargetChoice.TARGET_CREATURE,
MagicManaCost.create("{5}"),
false
),
MagicCopyTargetPicker.create(),
this,
2013-05-27 00:03:15 -07:00
"Put a token onto the battlefield that's a copy of target creature\$. " +
"If SN was kicked\$, put five of those tokens onto the battlefield instead."
);
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-27 00:03:15 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
2012-09-01 18:52:34 -07:00
final MagicPlayer player = event.getPlayer();
2011-10-25 02:02:02 -07:00
final MagicCardDefinition cardDefinition = creature.getCardDefinition();
int count = event.isKicked() ? 5 : 1;
for (;count>0;count--) {
game.doAction(new MagicPlayTokenAction(player,cardDefinition));
}
}
2012-06-17 05:19:08 -07:00
});
}
2013-05-27 00:03:15 -07:00
}
]