magarena/release/Magarena/scripts/Dispense_Justice.groovy

35 lines
1.4 KiB
Groovy
Raw Normal View History

2013-10-15 22:39:10 -07:00
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
MagicTargetChoice.NEG_TARGET_PLAYER,
this,
2013-10-20 05:41:50 -07:00
"Target player\$ sacrifices an attacking creature. " +
2013-10-15 22:39:10 -07:00
"If you control three or more artifacts, he or she sacrifices two creatures instead."
);
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
2013-10-20 05:41:50 -07:00
final choice = new MagicTargetChoice("an attacking creature to sacrifice");
2013-10-15 22:39:10 -07:00
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
player,
2013-10-20 05:41:50 -07:00
choice
2013-10-15 22:39:10 -07:00
));
if (MagicCondition.METALCRAFT_CONDITION.accept(event.getSource())) {
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
player,
2013-10-20 05:41:50 -07:00
choice
2013-10-15 22:39:10 -07:00
));
}
}
});
}
}
]