magarena/release/Magarena/scripts/Sangromancer.groovy

51 lines
1.7 KiB
Groovy
Raw Normal View History

2013-05-28 01:20:13 -07:00
[
new MagicWhenOtherDiesTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
2013-06-23 18:29:26 -07:00
return (otherPermanent.isEnemy(permanent) &&
2012-09-21 07:26:17 -07:00
otherPermanent.isCreature()) ?
2012-06-17 05:19:08 -07:00
new MagicEvent(
2011-09-04 00:49:20 -07:00
permanent,
new MagicSimpleMayChoice(
2012-09-21 07:26:17 -07:00
MagicSimpleMayChoice.GAIN_LIFE,
3,
MagicSimpleMayChoice.DEFAULT_YES
),
2011-09-04 00:49:20 -07:00
this,
2013-05-28 01:20:13 -07:00
"PN may\$ gain 3 life."
) :
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
2013-05-28 01:20:13 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2012-08-30 07:05:16 -07:00
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
2012-06-17 05:19:08 -07:00
}
}
2013-05-28 01:20:13 -07:00
},
new MagicWhenDiscardedTrigger() {
2012-06-17 05:19:08 -07:00
@Override
public MagicEvent getEvent(final MagicPermanent permanent,final MagicCard card) {
return permanent.isEnemy(card) ?
2012-06-17 05:19:08 -07:00
new MagicEvent(
2011-09-04 00:49:20 -07:00
permanent,
new MagicSimpleMayChoice(
2012-09-21 07:26:17 -07:00
MagicSimpleMayChoice.GAIN_LIFE,
3,
2013-05-28 01:20:13 -07:00
MagicSimpleMayChoice.DEFAULT_YES
),
2011-09-04 00:49:20 -07:00
this,
2013-05-28 01:20:13 -07:00
"PN may\$ gain 3 life."
) :
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
2012-06-17 05:19:08 -07:00
@Override
2013-05-28 01:20:13 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
2012-08-30 07:05:16 -07:00
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
2012-06-17 05:19:08 -07:00
}
}
2013-05-28 01:20:13 -07:00
}
]