52 lines
1.9 KiB
Groovy
52 lines
1.9 KiB
Groovy
|
[
|
||
|
new MagicWhenPutIntoGraveyardTrigger() {
|
||
|
@Override
|
||
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
|
||
|
return (triggerData.fromLocation == MagicLocationType.Play) ?
|
||
|
new MagicEvent(
|
||
|
permanent,
|
||
|
new MagicSimpleMayChoice(
|
||
|
MagicSimpleMayChoice.GAIN_LIFE,
|
||
|
5,
|
||
|
MagicSimpleMayChoice.DEFAULT_YES
|
||
|
),
|
||
|
this,
|
||
|
"PN may\$ gain 5 life."
|
||
|
) :
|
||
|
MagicEvent.NONE;
|
||
|
}
|
||
|
@Override
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
if (event.isYes()) {
|
||
|
game.doAction(new MagicChangeLifeAction(event.getPlayer(),5));
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
|
||
|
@Override
|
||
|
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
|
||
|
return (otherPermanent!=permanent &&
|
||
|
otherPermanent.isFriend(permanent) &&
|
||
|
otherPermanent.isCreature() &&
|
||
|
otherPermanent.getPower()>=5) ?
|
||
|
new MagicEvent(
|
||
|
permanent,
|
||
|
new MagicSimpleMayChoice(
|
||
|
MagicSimpleMayChoice.GAIN_LIFE,
|
||
|
5,
|
||
|
MagicSimpleMayChoice.DEFAULT_YES
|
||
|
),
|
||
|
this,
|
||
|
"PN may\$ gain 5 life."
|
||
|
) :
|
||
|
MagicEvent.NONE;
|
||
|
}
|
||
|
@Override
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
if (event.isYes()) {
|
||
|
game.doAction(new MagicChangeLifeAction(event.getPlayer(),5));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|