magarena/release/Magarena/scripts/Lifesmith.groovy

25 lines
908 B
Groovy
Raw Normal View History

2013-05-17 23:11:32 -07:00
[
new MagicWhenOtherSpellIsCastTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack spell) {
return (permanent.isFriend(spell) &&
spell.getCardDefinition().isArtifact()) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}"))
),
this,
2013-05-17 23:11:32 -07:00
"PN may\$ pay {1}\$. If you do, you gain 3 life."
2013-04-12 19:32:25 -07:00
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicChangeLifeAction(event.getPlayer(),3));
}
}
2013-05-17 23:11:32 -07:00
}
]