magarena/release/Magarena/scripts/Mentor_of_the_Meek.groovy

28 lines
1.0 KiB
Groovy
Raw Normal View History

2013-05-18 19:57:17 -07:00
[
new MagicWhenOtherComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPermanent otherPermanent) {
return (otherPermanent != permanent &&
otherPermanent.isCreature() &&
2013-06-06 06:03:49 -07:00
otherPermanent.isFriend(permanent) &&
2013-04-12 19:32:25 -07:00
otherPermanent.getPower() <= 2) ?
new MagicEvent(
permanent,
new MagicMayChoice(
new MagicPayManaCostChoice(MagicManaCost.create("{1}"))
),
this,
2013-05-18 19:57:17 -07:00
"You may\$ pay {1}\$. If you do, draw a card."
2013-04-12 19:32:25 -07:00
):
MagicEvent.NONE;
}
@Override
2013-05-18 19:57:17 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
if (event.isYes()) {
game.doAction(new MagicDrawAction(event.getPlayer()));
2013-04-12 19:32:25 -07:00
}
}
2013-05-18 19:57:17 -07:00
}
]