magarena/release/Magarena/scripts/Mycoid_Shepherd.groovy

52 lines
1.9 KiB
Groovy
Raw Normal View History

2013-05-29 22:57:04 -07:00
[
new MagicWhenPutIntoGraveyardTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (triggerData.fromLocation == MagicLocationType.Play) ?
2012-09-21 07:40:38 -07:00
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
5,
2013-05-29 22:57:04 -07:00
MagicSimpleMayChoice.DEFAULT_YES
),
2012-09-21 07:40:38 -07:00
this,
2013-05-29 22:57:04 -07:00
"PN may\$ gain 5 life."
) :
2012-09-21 07:40:38 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-29 22:57:04 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2012-08-30 07:02:06 -07:00
game.doAction(new MagicChangeLifeAction(event.getPlayer(),5));
2012-06-17 05:19:08 -07:00
}
}
2013-05-29 22:57:04 -07:00
},
new MagicWhenOtherPutIntoGraveyardFromPlayTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent!=permanent &&
otherPermanent.isFriend(permanent) &&
otherPermanent.isCreature() &&
otherPermanent.getPower()>=5) ?
2012-09-21 07:40:38 -07:00
new MagicEvent(
permanent,
new MagicSimpleMayChoice(
MagicSimpleMayChoice.GAIN_LIFE,
5,
2013-05-29 22:57:04 -07:00
MagicSimpleMayChoice.DEFAULT_YES
),
2012-09-21 07:40:38 -07:00
this,
2013-05-29 22:57:04 -07:00
"PN may\$ gain 5 life."
2012-09-21 07:40:38 -07:00
) :
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-29 22:57:04 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2012-08-30 07:02:06 -07:00
game.doAction(new MagicChangeLifeAction(event.getPlayer(),5));
2012-06-17 05:19:08 -07:00
}
}
2013-05-29 22:57:04 -07:00
}
]