magarena/release/Magarena/scripts/Mentor_of_the_Meek.groovy

28 lines
1010 B
Groovy

[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
otherPermanent.isCreature() &&
otherPermanent.isFriend(permanent) &&
otherPermanent.getPower() <= 2) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}"))
),
this,
"You 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()));
}
}
}
]