magarena/release/Magarena/scripts/Kessig_Malcontents.groovy

35 lines
1.3 KiB
Groovy
Raw Normal View History

2013-05-26 03:50:19 -07:00
[
new MagicWhenComesIntoPlayTrigger() {
2013-04-12 19:32:25 -07:00
@Override
public MagicEvent executeTrigger(
final MagicGame game,
final MagicPermanent permanent,
2013-06-19 07:23:35 -07:00
final MagicPayedCost payedCost) {
final int amount = permanent.getController().getNrOfPermanents(MagicSubType.Human);
2013-04-12 19:32:25 -07:00
return new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_PLAYER,
new MagicDamageTargetPicker(amount),
this,
2013-05-26 03:50:19 -07:00
"SN deals damage to target player\$ " +
2013-04-12 19:32:25 -07:00
"equal to the number of Humans PN controls."
);
}
2013-06-23 18:29:26 -07:00
2013-04-12 19:32:25 -07:00
@Override
2013-05-26 03:50:19 -07:00
public void executeEvent(final MagicGame game, final MagicEvent event) {
2013-04-12 19:32:25 -07:00
event.processTargetPlayer(game,new MagicPlayerAction() {
public void doAction(final MagicPlayer player) {
final int amount = event.getPlayer().getNrOfPermanents(MagicSubType.Human);
2013-04-12 19:32:25 -07:00
final MagicDamage damage = new MagicDamage(
event.getSource(),
player,
amount
);
game.doAction(new MagicDealDamageAction(damage));
}
});
}
2013-05-26 03:50:19 -07:00
}
]