magarena/incomplete/Damia__Sage_of_Stone.groovy

23 lines
880 B
Groovy
Raw Normal View History

2014-04-21 22:51:35 -07:00
[
new MagicAtUpkeepTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
return (permanent.isController(upkeepPlayer) && upkeepPlayer.getHandSize() < 7) ?
new MagicEvent(
permanent,
this,
"If PN has fewer than seven cards in hand, draw cards equal to the difference."
):
MagicEvent.NONE
2014-04-21 22:51:35 -07:00
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
final MagicPlayer player = event.getPlayer();
final int amount = 7 - player.getHandSize();
if (amount > 0) {
game.doAction(new MagicDrawAction(event.getPlayer(),amount));
}
2014-04-21 22:51:35 -07:00
}
}
]