diff --git a/MekHQ/src/mekhq/campaign/parts/MekLocation.java b/MekHQ/src/mekhq/campaign/parts/MekLocation.java index 90ebb7bc47..35f69c5c1c 100644 --- a/MekHQ/src/mekhq/campaign/parts/MekLocation.java +++ b/MekHQ/src/mekhq/campaign/parts/MekLocation.java @@ -23,6 +23,7 @@ import java.io.PrintWriter; import java.util.StringJoiner; +import megamek.common.MiscType; import mekhq.campaign.finances.Money; import mekhq.campaign.parts.enums.PartRepairType; import org.w3c.dom.Node; @@ -641,11 +642,11 @@ public String checkFixable() { } //certain other specific crits need to be left out (uggh, must be a better way to do this!) - if (slot.getType() == CriticalSlot.TYPE_SYSTEM - && (slot.getIndex() == Mech.ACTUATOR_HIP - || slot.getIndex() == Mech.ACTUATOR_SHOULDER - || slot.getIndex() == Mech.SYSTEM_LIFE_SUPPORT - || slot.getIndex() == Mech.SYSTEM_SENSORS)) { + if ((slot.getType() == CriticalSlot.TYPE_SYSTEM) + && ((slot.getIndex() == Mech.ACTUATOR_HIP) + || (slot.getIndex() == Mech.ACTUATOR_SHOULDER) + || (slot.getIndex() == Mech.SYSTEM_LIFE_SUPPORT) + || (slot.getIndex() == Mech.SYSTEM_SENSORS))) { continue; } @@ -667,6 +668,19 @@ public String checkFixable() { } } + if (slot.getType() == CriticalSlot.TYPE_EQUIPMENT) { + if ((slot.getMount() != null) && !slot.getMount().isDestroyed()) { + EquipmentType equipmentType = slot.getMount().getType(); + if (equipmentType.hasFlag(MiscType.F_NULLSIG)) { + return "Null-Signature System must be salvaged or scrapped first."; + } else if (equipmentType.hasFlag(MiscType.F_VOIDSIG)) { + return "Void-Signature System must be salvaged or scrapped first."; + } else if (equipmentType.hasFlag(MiscType.F_CHAMELEON_SHIELD)) { + return "Chameleon shield must be salvaged or scrapped first."; + } + } + } + if (slot.isRepairable()) { return "Repairable parts in " + unit.getEntity().getLocationName(loc) + " must be salvaged or scrapped first."; } diff --git a/MekHQ/src/mekhq/campaign/parts/MissingMekLocation.java b/MekHQ/src/mekhq/campaign/parts/MissingMekLocation.java index d43b66c1a1..b631c966bd 100644 --- a/MekHQ/src/mekhq/campaign/parts/MissingMekLocation.java +++ b/MekHQ/src/mekhq/campaign/parts/MissingMekLocation.java @@ -27,6 +27,7 @@ import megamek.common.IArmorState; import megamek.common.LandAirMech; import megamek.common.Mech; +import megamek.common.MiscType; import megamek.common.TechAdvancement; import mekhq.MekHqXmlUtil; import mekhq.campaign.Campaign; @@ -244,8 +245,8 @@ public String checkFixable() { //certain other specific crits need to be left out (uggh, must be a better way to do this!) if (slot.getType() == CriticalSlot.TYPE_SYSTEM) { // Skip Hip and Shoulder actuators - if ((slot.getIndex() == Mech.ACTUATOR_HIP - || slot.getIndex() == Mech.ACTUATOR_SHOULDER)) { + if ((slot.getIndex() == Mech.ACTUATOR_HIP) + || (slot.getIndex() == Mech.ACTUATOR_SHOULDER)) { continue; } if (unit.getEntity() instanceof LandAirMech) { @@ -265,7 +266,19 @@ public String checkFixable() { } } } + } else if (slot.getType() == CriticalSlot.TYPE_EQUIPMENT) { + if ((slot.getMount() != null) && !slot.getMount().isDestroyed()) { + EquipmentType equipmentType = slot.getMount().getType(); + if (equipmentType.hasFlag(MiscType.F_NULLSIG)) { + return "Null-Signature System must be salvaged or scrapped first. It can then be re-installed."; + } else if (equipmentType.hasFlag(MiscType.F_VOIDSIG)) { + return "Void-Signature System must be salvaged or scrapped first. It can then be re-installed."; + } else if (equipmentType.hasFlag(MiscType.F_CHAMELEON_SHIELD)) { + return "Chameleon shield must be salvaged or scrapped first. It can then be re-installed."; + } + } } + if (slot.isRepairable()) { return "Repairable parts in " + unit.getEntity().getLocationName(loc) + " must be salvaged or scrapped first. They can then be re-installed."; } diff --git a/MekHQ/src/mekhq/campaign/parts/equipment/EquipmentPart.java b/MekHQ/src/mekhq/campaign/parts/equipment/EquipmentPart.java index b590d82077..93788faaa6 100644 --- a/MekHQ/src/mekhq/campaign/parts/equipment/EquipmentPart.java +++ b/MekHQ/src/mekhq/campaign/parts/equipment/EquipmentPart.java @@ -405,7 +405,7 @@ public String checkFixable() { if (unit.isLocationBreached(loc)) { return unit.getEntity().getLocationName(loc) + " is breached."; } - + if (unit.isLocationDestroyed(loc)) { return unit.getEntity().getLocationName(loc) + " is destroyed."; } @@ -701,7 +701,7 @@ private static void checkWeaponBay(Unit unit, EquipmentType type, int equipmentN } // if we are still here then we need to check the other weapons, if any of them - // are usable then we should do the same thing. Otherwise all weapons are destroyed + // are usable then we should do the same thing. Otherwise all weapons are destroyed // and we should mark the bay as unusuable. for (int wId : weaponBay.getBayWeapons()) { final Mounted m = unit.getEntity().getEquipment(wId);