magarena/release/Magarena/scripts/Sangromancer.groovy

51 lines
1.7 KiB
Groovy

[
new MagicWhenOtherDiesTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent.isEnemy(permanent) &&
otherPermanent.isCreature()) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
3,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ gain 3 life."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
}
}
},
new MagicWhenDiscardedTrigger() {
@Override
public MagicEvent getEvent(final MagicPermanent permanent,final MagicCard card) {
return permanent.isEnemy(card) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
3,
MagicSimpleMayChoice.DEFAULT_YES
),
this,
"PN may\$ gain 3 life."
) :
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
}
}
}
]