magarena/release/Magarena/scripts/Searing_Meditation.groovy

32 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-26 23:59:17 -07:00
[
new MagicWhenLifeIsGainedTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicLifeChangeTriggerData lifeChange) {
return permanent.isController(lifeChange.player) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{2}")),
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER
),
new MagicDamageTargetPicker(2),
this,
2013-05-26 23:59:17 -07:00
"You may\$ pay {2}\$. If you do, SN deals 2 " +
"damage to target creature or player\$."
2013-04-12 19:32:25 -07:00
):
MagicEvent.NONE;
}
@Override
2013-05-26 23:59:17 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
event.processTarget(game,new MagicTargetAction() {
public void doAction(final MagicTarget target) {
final MagicDamage damage = new MagicDamage(event.getPermanent(),target,2);
game.doAction(new MagicDealDamageAction(damage));
}
});
}
}
2013-05-26 23:59:17 -07:00
}
]