magarena/release/Magarena/scripts/Falkenrath_Noble.groovy

25 lines
981 B
Groovy

[
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return otherPermanent.isCreature() ?
new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_PLAYER,
this,
"Target player\$ loses 1 life and PN gains 1 life."
) :
MagicEvent.NONE;
}
@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,-1));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
}
});
}
}
]