magarena/release/Magarena/scripts/Skullcage.groovy

25 lines
966 B
Groovy
Raw Normal View History

2013-04-03 01:03:12 -07:00
[
new MagicAtUpkeepTrigger() {
2012-06-17 05:19:08 -07:00
@Override
2012-10-07 02:05:37 -07:00
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
return permanent.isOpponent(upkeepPlayer) ?
2012-06-17 05:19:08 -07:00
new MagicEvent(
2011-09-04 00:49:20 -07:00
permanent,
2012-10-07 02:05:37 -07:00
upkeepPlayer,
2011-09-04 00:49:20 -07:00
this,
2012-10-07 02:05:37 -07:00
"SN deals 2 damage to PN unless PN has exactly three or exactly four cards in hand."
):
2011-09-04 01:19:43 -07:00
MagicEvent.NONE;
2012-06-17 05:19:08 -07:00
}
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
2012-10-07 02:05:37 -07:00
final MagicPlayer opponent=event.getPlayer();
2012-06-17 05:19:08 -07:00
final int amount=opponent.getHandSize();
2012-10-07 02:05:37 -07:00
if (amount < 3 || amount > 4) {
final MagicDamage damage=new MagicDamage(event.getSource(),opponent,2);
2012-06-17 05:19:08 -07:00
game.doAction(new MagicDealDamageAction(damage));
}
}
2013-04-03 01:03:12 -07:00
}
]