magarena/release/Magarena/scripts/Bloodgift_Demon.groovy

25 lines
935 B
Groovy

[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_PLAYER,
this,
"Target player\$ draws a card and loses 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 MagicDrawAction(player,1));
game.doAction(new MagicChangeLifeAction(player,-1));
}
});
}
}
]