magarena/release/Magarena/scripts/Black_Vise.groovy

34 lines
1.2 KiB
Groovy
Raw Normal View History

2013-05-27 07:36:17 -07:00
[
new MagicAtUpkeepTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
final MagicPlayer upkeepPlayer) {
final MagicTarget target = permanent.getChosenTarget();
return (upkeepPlayer == target) ?
new MagicEvent(
permanent,
upkeepPlayer,
this,
"PN deals X damage to PN " +
2013-05-27 07:36:17 -07:00
"where X is the number of cards in his or her hand minus 4."
):
2013-04-12 19:32:25 -07:00
MagicEvent.NONE;
}
@Override
2013-05-27 07:36:17 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
final MagicPlayer player = event.getPlayer();
final int amount = player.getHandSize() - 4;
if (amount > 0) {
final MagicDamage damage = new MagicDamage(
event.getPermanent(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
}
2013-05-27 07:36:17 -07:00
}
]