magarena/release/Magarena/scripts/Doomgape.groovy

29 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-19 00:49:58 -07:00
[
new MagicAtUpkeepTrigger() {
2012-09-21 19:57:04 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isController(upkeepPlayer) ?
new MagicEvent(
permanent,
MagicTargetChoice.SACRIFICE_CREATURE,
MagicSacrificeTargetPicker.create(),
this,
2013-06-23 18:29:26 -07:00
"Sacrifice a creature. " +
2012-09-21 19:57:04 -07:00
"PN gains life equal to that creature's toughness."
):
MagicEvent.NONE;
}
2011-09-07 21:34:26 -07:00
@Override
2013-05-19 00:49:58 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game,new MagicPermanentAction() {
2011-09-07 21:34:26 -07:00
public void doAction(final MagicPermanent creature) {
final int toughness=creature.getToughness();
2011-09-07 21:34:26 -07:00
game.doAction(new MagicSacrificeAction(creature));
2012-08-30 06:09:27 -07:00
game.doAction(new MagicChangeLifeAction(event.getPlayer(),toughness));
2011-09-07 21:34:26 -07:00
}
});
}
2013-05-19 00:49:58 -07:00
}
]