magarena/release/Magarena/scripts/Highway_Robber.groovy

25 lines
896 B
Groovy

[
new MagicWhenComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer player) {
return new MagicEvent(
permanent,
MagicTargetChoice.TARGET_OPPONENT,
this,
"Target opponent\$ loses 2 life and PN gains 2 life."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event) {
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
game.doAction(new MagicChangeLifeAction(player,-2));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),2));
}
});
}
}
]