magarena/release/Magarena/scripts/Mentor_of_the_Meek.groovy

30 lines
1.1 KiB
Groovy

[
new MagicWhenOtherComesIntoPlayTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
final MagicPlayer player = permanent.getController();
return (otherPermanent != permanent &&
otherPermanent.isCreature() &&
otherPermanent.getController() == player &&
otherPermanent.getPower() <= 2) ?
new MagicEvent(
permanent,
player,
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(),1));
}
}
}
]