@Override public double calculateWeight() { double totalWeight = 0.0; for (int i = 0; i < ba.getTroopers(); i++) { totalWeight += calculateWeight(i); } return totalWeight; }
@Override public double getWeight() { return ba.getTrooperWeight() * ba.getTroopers(); }
/** * Returns the number of Troopers in the BattleArmor squad, since locations * for BattleArmor correspond to the different suits instead of the actual * mount locations for equipment. */ @Override public int locations() { int retVal = Math.round(getTroopers()); if (retVal == 0) { // Return one more than the maximum number of men in the unit. if (!isInitialized) { retVal = 6 + 1; } else if (isClan()) { retVal = 5 + 1; } else { retVal = 4 + 1; } } else { retVal++; } return retVal; }
@Override public boolean correctWeight(StringBuffer buff, boolean showO, boolean showU) { double weightSum = calculateWeight(); double weight = getWeight(); boolean correct = true; String baDesig = ba.getLocationAbbr(BattleArmor.LOC_SQUAD); if (showO && ((weight + getMaxOverweight()) < weightSum)) { buff.append(baDesig + "Weight: ").append(calculateWeight()) .append(" is greater than ").append(getWeight()) .append("\n"); correct = false; } if (showU && ((weight - getMinUnderweight()) > weightSum)) { buff.append("Weight: ").append(calculateWeight()) .append(" is less than ").append(getWeight()).append("\n"); correct = false; } for (int t = 1; t < ba.getTroopers(); t++) { double trooperWeight = calculateWeight(t); if (trooperWeight > ba.getTrooperWeight()) { buff.append("Trooper " + t + " Weight: " + trooperWeight + " is greater than " + ba.getTrooperWeight() + "\n"); correct = false; } } return correct; }
public String checkDeployment() { if (!isFunctional()) { return "unit is not functional"; } if (isUnmanned()) { return "unit has no pilot"; } if(isRefitting()) { return "unit is being refit"; } if(entity instanceof Tank && getActiveCrew().size() < getFullCrewSize()) { return "This vehicle requires a crew of " + getFullCrewSize(); } //Taharqa: I am not going to allow BattleArmor units with unmanned suits to deploy. It is //possible to hack this to work in MM, but it becomes a serious problem when the unit becomes //a total loss because the unmanned suits are also treated as destroyed. I tried hacking something //together in ResolveScenarioTracker and decided that it was not right. If someone wants to deploy //a non-full strength BA unit, they can salvage the suits that are unmanned and then they can deploy //it if(entity instanceof BattleArmor) { for(int i = BattleArmor.LOC_TROOPER_1; i <= ((BattleArmor)entity).getTroopers(); i++) { if(entity.getInternal(i) == 0) { return "This BattleArmor unit has empty suits. Fill them with pilots or salvage them."; } } } return null; }
double tonnage = entity.getWeight(); if (entity instanceof BattleArmor) { tonnage = ((BattleArmor)entity).getTrooperWeight() * ((BattleArmor)entity).getTroopers();
return 25; } else if(en instanceof BattleArmor) { return ((BattleArmor)en).getTroopers() * 50; } else if(en instanceof Infantry) { return ((Infantry)en).getSquadN()*10;
int internal = 0; int men = Math.round(ba.getTroopers());
damage += getTroopers() * 2;
t.setWeight(t.getTroopers());
for(int i = BattleArmor.LOC_TROOPER_1; i <= ((BattleArmor)entity).getTroopers(); i++) { bestSuits.put(Integer.toString(i), entity.getArmorForReal(i)); if(entity.getInternal(i)<0) {
int critsUsed[][] = new int[ba.getTroopers() + 1] [BattleArmor.MOUNT_NUM_LOCS]; int numAPWeapons[][] = new int[ba.getTroopers() + 1] [BattleArmor.MOUNT_NUM_LOCS]; int numAMWeapons[][] = new int[ba.getTroopers() + 1] [BattleArmor.MOUNT_NUM_LOCS]; int numSSWMs = 0; for (int t = 0; t <= ba.getTroopers(); t++) { critsUsed[t][m.getBaMountLoc()] += critSize; if ((m.getType() instanceof WeaponType) for (int t = 0; t <= ba.getTroopers(); t++) { for (int loc = 0; loc < BattleArmor.MOUNT_NUM_LOCS; loc++) { if (critsUsed[t][loc] > ba.getNumCrits(loc)) {
damage += ((BattleArmor) ae).getVibroClaws(); if (((BattleArmor) ae).hasMyomerBooster()) { damage += ((BattleArmor) ae).getTroopers() * 2;
verifier.baOption, null); double maxTrooperWeight = 0; for (int i = 1; i < ba.getTroopers(); i++){ double trooperWeight = testBA.calculateWeight(i); if (trooperWeight > maxTrooperWeight){
for (int loc = 1; loc <= ba.getTroopers(); loc++) { hit.setLocation(loc); vPhaseReport.addAll(server.damageEntity(entity, hit,
for (int loc = 1; loc <= ba.getTroopers(); loc++) { hit.setLocation(loc); vPhaseReport.addAll(server.damageEntity(entity, hit,