magarena/release/Magarena/scripts/Subversion.groovy

24 lines
825 B
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
this,
"Your opponent loses 1 life. You gain 1 life."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
game.doAction(new MagicChangeLifeAction(player.getOpponent(),-1));
game.doAction(new MagicChangeLifeAction(player,1));
}
}
]