Skip to content

Commit

Permalink
Merge pull request #2412 from MegaMek/bar_armor_bv
Browse files Browse the repository at this point in the history
Fix armor BV calculation for SV BAR armor
  • Loading branch information
neoancient authored Nov 21, 2020
2 parents c662714 + cc189a5 commit 4c002b7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
41 changes: 22 additions & 19 deletions megamek/src/megamek/common/Aero.java
Original file line number Diff line number Diff line change
Expand Up @@ -1375,25 +1375,28 @@ public int calculateBattleValue(boolean ignoreC3, boolean ignorePilot) {
// total armor points

switch (getArmorType(loc)) {
case EquipmentType.T_ARMOR_COMMERCIAL:
armorMultiplier = 0.5;
break;
case EquipmentType.T_ARMOR_HARDENED:
armorMultiplier = 2.0;
break;
case EquipmentType.T_ARMOR_REACTIVE:
case EquipmentType.T_ARMOR_REFLECTIVE:
case EquipmentType.T_ARMOR_BALLISTIC_REINFORCED:
armorMultiplier = 1.5;
break;
case EquipmentType.T_ARMOR_LC_LAMELLOR_FERRO_CARBIDE:
case EquipmentType.T_ARMOR_FERRO_LAMELLOR:
case EquipmentType.T_ARMOR_ANTI_PENETRATIVE_ABLATION:
armorMultiplier = 1.2;
break;
default:
armorMultiplier = 1.0;
break;
case EquipmentType.T_ARMOR_COMMERCIAL:
armorMultiplier = 0.5;
break;
case EquipmentType.T_ARMOR_HARDENED:
armorMultiplier = 2.0;
break;
case EquipmentType.T_ARMOR_REACTIVE:
case EquipmentType.T_ARMOR_REFLECTIVE:
case EquipmentType.T_ARMOR_BALLISTIC_REINFORCED:
armorMultiplier = 1.5;
break;
case EquipmentType.T_ARMOR_LC_LAMELLOR_FERRO_CARBIDE:
case EquipmentType.T_ARMOR_FERRO_LAMELLOR:
case EquipmentType.T_ARMOR_ANTI_PENETRATIVE_ABLATION:
armorMultiplier = 1.2;
break;
default:
armorMultiplier = 1.0;
break;
}
if (hasBARArmor(loc)) {
armorMultiplier *= getBARRating(loc) / 10.0;
}

if (blueShield) {
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/Tank.java
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ public int calculateBattleValue(boolean ignoreC3, boolean ignorePilot) {
bvText.append(startColumn);
bvText.append(endColumn);
bvText.append(startColumn);
double armorBV = (getArmor(loc) + modularArmor) * armorMultiplier * (getBARRating(loc) / 10);
double armorBV = (getArmor(loc) + modularArmor) * armorMultiplier * (getBARRating(loc) / 10.0);
bvText.append(armorBV);
dbv += armorBV;
bvText.append(endColumn);
Expand Down

0 comments on commit 4c002b7

Please sign in to comment.