magarena/release/Magarena/scripts/Gatekeeper_of_Malakir.groovy

32 lines
1.0 KiB
Groovy

[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPayedCost payedCost) {
return payedCost.isKicked() ?
new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_PLAYER,
this,
"Target player\$ sacrifices a creature."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.addEvent(new MagicSacrificePermanentEvent(
event.getSource(),
player,
MagicTargetChoice.SACRIFICE_CREATURE
));
}
});
}
}
]