magarena/release/Magarena/scripts/Wanderwine_Prophets.groovy

34 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-26 04:56:08 -07:00
[
new MagicWhenDamageIsDealtTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
return (damage.getSource() == permanent &&
damage.getTarget().isPlayer() &&
damage.isCombat()) ?
new MagicEvent(
permanent,
new MagicMayChoice(
MagicTargetChoice.SACRIFICE_MERFOLK
),
MagicSacrificeTargetPicker.create(),
this,
2013-05-26 04:56:08 -07:00
"PN may\$ sacrifice a Merfolk\$. " +
2013-04-12 19:32:25 -07:00
"If you do, take an extra turn after this one"
):
MagicEvent.NONE;
}
@Override
2013-05-26 04:56:08 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
event.processTargetPermanent(game,new MagicPermanentAction() {
public void doAction(final MagicPermanent creature) {
game.doAction(new MagicSacrificeAction(creature));
game.doAction(new MagicChangeExtraTurnsAction(event.getPlayer(),1));
}
});
}
}
2013-05-26 04:56:08 -07:00
}
]