magarena/release/Magarena/scripts/Skullcage.groovy

27 lines
999 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(
2011-08-13 02:16:33 -07:00
final MagicGame game,
2013-03-22 22:00:53 -07:00
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
}
]