tweaking usage of getTotalPower to include new Boolean

This commit is contained in:
Northmoc
2021-01-31 14:00:37 -05:00
parent f876cb934a
commit 0e9f24cafd
3 changed files with 7 additions and 3 deletions

View File

@@ -1179,7 +1179,7 @@ public class AiAttackController {
CardPredicates.hasKeyword(Keyword.LIFELINK))).isEmpty(); CardPredicates.hasKeyword(Keyword.LIFELINK))).isEmpty();
// total power of the defending creatures, used in predicting whether a gang block can kill the attacker // total power of the defending creatures, used in predicting whether a gang block can kill the attacker
int defPower = CardLists.getTotalPower(validBlockers, true); int defPower = CardLists.getTotalPower(validBlockers, true, false);
if (!hasCombatEffect) { if (!hasCombatEffect) {
for (KeywordInterface inst : attacker.getKeywords()) { for (KeywordInterface inst : attacker.getKeywords()) {

View File

@@ -131,8 +131,10 @@ public class CostTapType extends CostPartWithList {
} }
typeList = CardLists.filter(typeList, Presets.UNTAPPED); typeList = CardLists.filter(typeList, Presets.UNTAPPED);
boolean isCrew=false;
if (ability.hasParam("Crew")) { if (ability.hasParam("Crew")) {
typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew Vehicles."); typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew Vehicles.");
isCrew=true;
} }
if (sameType) { if (sameType) {
@@ -146,7 +148,7 @@ public class CostTapType extends CostPartWithList {
if (totalPower) { if (totalPower) {
final int i = Integer.parseInt(totalP); final int i = Integer.parseInt(totalP);
return CardLists.getTotalPower(typeList, true) >= i; return CardLists.getTotalPower(typeList, true, isCrew) >= i;
} }
final Integer amount = this.convertAmount(); final Integer amount = this.convertAmount();

View File

@@ -1187,8 +1187,10 @@ public class HumanCostDecision extends CostDecisionMakerBase {
source, ability); source, ability);
typeList = CardLists.filter(typeList, Presets.UNTAPPED); typeList = CardLists.filter(typeList, Presets.UNTAPPED);
boolean isCrew=false;
if (ability.hasParam("Crew")) { if (ability.hasParam("Crew")) {
typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew Vehicles."); typeList = CardLists.getNotKeyword(typeList, "CARDNAME can't crew Vehicles.");
isCrew=true;
} }
if (c == null && !amount.equals("Any")) { if (c == null && !amount.equals("Any")) {
@@ -1247,7 +1249,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
inp.setCancelAllowed(true); inp.setCancelAllowed(true);
inp.showAndWait(); inp.showAndWait();
if (inp.hasCancelled() || CardLists.getTotalPower(inp.getSelected(), true) < i) { if (inp.hasCancelled() || CardLists.getTotalPower(inp.getSelected(), true, isCrew) < i) {
return null; return null;
} }
return PaymentDecision.card(inp.getSelected()); return PaymentDecision.card(inp.getSelected());