33 lines
1.1 KiB
Groovy
33 lines
1.1 KiB
Groovy
|
[
|
||
|
new MagicAtUpkeepTrigger() {
|
||
|
@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
|
||
|
public void executeEvent(final MagicGame game, final MagicEvent event) {
|
||
|
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));
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
Black_Vise.T2
|
||
|
]
|