Nethroi (IKO)

This commit is contained in:
Tim Mocny
2021-02-14 00:57:22 +00:00
committed by Anthony Calosa
parent 47fcd88366
commit d7f0665bae
8 changed files with 116 additions and 2 deletions

View File

@@ -212,6 +212,20 @@ public final class InputSelectTargets extends InputSyncronizedBase {
}
}
if (sa.hasParam("MaxTotalTargetPower")) {
int maxTotalPower = tgt.getMaxTotalPower(sa.getHostCard(), sa);
if (maxTotalPower > 0) {
int soFar = Aggregates.sum(sa.getTargets().getTargetCards(), CardPredicates.Accessors.fnGetNetPower);
if (!sa.isTargeting(card)) {
soFar += card.getNetPower();
}
if (soFar > maxTotalPower) {
showMessage(sa.getHostCard() + " - Cannot target this card (power limit exceeded)");
return false;
}
}
}
// If all cards must have different controllers
if (tgt.isDifferentControllers()) {
final List<Player> targetedControllers = new ArrayList<>();