magarena/release/Magarena/scripts/Lunar_Mystic.groovy

29 lines
957 B
Groovy

[
new MagicWhenOtherSpellIsCastTrigger() {
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicCardOnStack spell) {
return (permanent.isFriend(spell) &&
spell.getCardDefinition().isInstant()) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}"))
),
this,
"PN may\$ pay {1}\$. If you do, draw a card."
):
MagicEvent.NONE;
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer(),1));
}
}
}
]