diff --git a/MekHQ/src/mekhq/campaign/parts/BaArmor.java b/MekHQ/src/mekhq/campaign/parts/BaArmor.java index bc02e90385..20b1984602 100644 --- a/MekHQ/src/mekhq/campaign/parts/BaArmor.java +++ b/MekHQ/src/mekhq/campaign/parts/BaArmor.java @@ -23,6 +23,7 @@ import java.util.Objects; import megamek.common.EquipmentType; +import megamek.common.equipment.ArmorType; import mekhq.campaign.Campaign; import mekhq.campaign.finances.Money; import mekhq.campaign.work.IAcquisitionWork; @@ -43,7 +44,7 @@ public static boolean canBeIs(int type) { public static double getPointsPerTon(int t, boolean isClan) { - return 1.0/EquipmentType.getBaArmorWeightPerPoint(t, isClan); + return 1.0 / ArmorType.of(t, isClan).getWeightPerPoint(); } public BaArmor() { @@ -64,7 +65,7 @@ public BaArmor clone() { @Override public double getTonnage() { - return EquipmentType.getBaArmorWeightPerPoint(type, clan) * amount; + return ArmorType.of(type, clan).getWeightPerPoint() * amount; } public Money getPointCost() { diff --git a/MekHQ/src/mekhq/campaign/parts/ProtomekArmor.java b/MekHQ/src/mekhq/campaign/parts/ProtomekArmor.java index b069fac612..41913203e3 100644 --- a/MekHQ/src/mekhq/campaign/parts/ProtomekArmor.java +++ b/MekHQ/src/mekhq/campaign/parts/ProtomekArmor.java @@ -26,6 +26,7 @@ import megamek.common.EquipmentType; import megamek.common.Protomech; import megamek.common.TechAdvancement; +import megamek.common.equipment.ArmorType; import mekhq.campaign.Campaign; import mekhq.campaign.finances.Money; import mekhq.campaign.work.IAcquisitionWork; @@ -54,18 +55,18 @@ public ProtomekArmor clone() { @Override public double getTonnage() { - return EquipmentType.getProtomechArmorWeightPerPoint(type) * amount; + return ArmorType.of(type, true).getWeightPerPoint() * amount; } @Override public Money getActualValue() { return adjustCostsForCampaignOptions( - Money.of(amount * EquipmentType.getProtomechArmorCostPerPoint(type))); + Money.of(amount * ArmorType.of(type, true).getWeightPerPoint())); } @Override public double getTonnageNeeded() { - return amountNeeded / EquipmentType.getProtomechArmorWeightPerPoint(type); + return amountNeeded / ArmorType.of(type, true).getWeightPerPoint(); } @Override @@ -77,7 +78,7 @@ public Money getValueNeeded() { @Override public Money getStickerPrice() { // always in 5-ton increments - return Money.of(5.0 / EquipmentType.getProtomechArmorWeightPerPoint(type) * getArmorPointsPerTon() + return Money.of(5.0 / ArmorType.of(type, true).getWeightPerPoint() * getArmorPointsPerTon() * EquipmentType.getProtomechArmorCostPerPoint(type)); } @@ -117,7 +118,7 @@ public int getDifficulty() { @Override public double getArmorPointsPerTon() { - return 1.0 / EquipmentType.getProtomechArmorWeightPerPoint(type); + return 1.0 / ArmorType.of(type, true).getWeightPerPoint(); } @Override