magarena/release/Magarena/scripts/The_Rack.groovy

33 lines
1.1 KiB
Groovy
Raw Normal View History

2013-05-18 18:20:37 -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) {
return (upkeepPlayer == permanent.getChosenTarget()) ?
new MagicEvent(
permanent,
upkeepPlayer,
this,
"SN deals X damage to PN where X is 3 minus the number of cards in his or her hand."
):
MagicEvent.NONE;
}
@Override
2013-05-18 18:20:37 -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 = 3 - player.getHandSize();
if (amount > 0) {
final MagicDamage damage = new MagicDamage(
event.getSource(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
}
2013-05-18 18:20:37 -07:00
},
Black_Vise.T2
]