magarena/release/Magarena/scripts/Searing_Meditation.groovy

32 lines
1.3 KiB
Groovy

[
new MagicWhenLifeIsGainedTrigger() {
@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,
"You may\$ pay {2}\$. If you do, SN deals 2 " +
"damage to target creature or player\$."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
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));
}
});
}
}
}
]