From d983fcefe3b7e46e81a51d9c0f83dc6cf60ed684 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Sat, 6 May 2023 15:44:01 -0500 Subject: [PATCH 1/2] Add rules reference for refit classes --- MekHQ/src/mekhq/campaign/parts/Refit.java | 1 + 1 file changed, 1 insertion(+) diff --git a/MekHQ/src/mekhq/campaign/parts/Refit.java b/MekHQ/src/mekhq/campaign/parts/Refit.java index d7360aeeb2..e99dbad606 100644 --- a/MekHQ/src/mekhq/campaign/parts/Refit.java +++ b/MekHQ/src/mekhq/campaign/parts/Refit.java @@ -546,6 +546,7 @@ public void calculate() { } /*CHECK REFIT CLASS*/ + // See Campaign Operations, page 211 as of third printing if (nPart instanceof MissingEnginePart) { if (oldUnit.getEntity().getEngine().getRating() != newUnit.getEntity().getEngine().getRating()) { updateRefitClass(CLASS_D); From e1eef28f283fb378e1e3a965129c30beba2d34d8 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Sat, 6 May 2023 16:31:42 -0500 Subject: [PATCH 2/2] Update refit classes to reflect Campaign Operations Engines, gyros, armor, cockpits, and myomer have different refit classes now. Actuators do not get special treatment. Some edge cases may still need to be added, such as Full-Head Ejection. --- MekHQ/src/mekhq/campaign/parts/Refit.java | 28 +++++++---------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/parts/Refit.java b/MekHQ/src/mekhq/campaign/parts/Refit.java index e99dbad606..1fdad03bb6 100644 --- a/MekHQ/src/mekhq/campaign/parts/Refit.java +++ b/MekHQ/src/mekhq/campaign/parts/Refit.java @@ -548,38 +548,26 @@ public void calculate() { /*CHECK REFIT CLASS*/ // See Campaign Operations, page 211 as of third printing if (nPart instanceof MissingEnginePart) { - if (oldUnit.getEntity().getEngine().getRating() != newUnit.getEntity().getEngine().getRating()) { - updateRefitClass(CLASS_D); - } - if (newUnit.getEntity().getEngine().getEngineType() != oldUnit.getEntity().getEngine().getEngineType()) { - updateRefitClass(CLASS_F); + if (oldUnit.getEntity().getEngine().getRating() != newUnit.getEntity().getEngine().getRating() || newUnit.getEntity().getEngine().getEngineType() != oldUnit.getEntity().getEngine().getEngineType()) { + updateRefitClass(customJob ? CLASS_E : CLASS_D); } if (((MissingEnginePart) nPart).getEngine().getSideTorsoCriticalSlots().length > 0) { locationHasNewStuff[Mech.LOC_LT] = true; locationHasNewStuff[Mech.LOC_RT] = true; } } else if (nPart instanceof MissingMekGyro) { - updateRefitClass(CLASS_F); + updateRefitClass(CLASS_D); } else if (nPart instanceof MissingMekLocation) { replacingLocations = true; - if (((Mech) newUnit.getEntity()).hasTSM(true) != ((Mech) oldUnit.getEntity()).hasTSM(true)) { - updateRefitClass(CLASS_E); - } else { - updateRefitClass(CLASS_F); - } + + // If a location is being replaced, the internal structure or myomer must have been changed. + updateRefitClass(CLASS_F); } else if (nPart instanceof Armor) { - updateRefitClass(CLASS_C); + updateRefitClass(CLASS_A); locationHasNewStuff[nPart.getLocation()] = true; } else if (nPart instanceof MissingMekCockpit) { - updateRefitClass(CLASS_F); + updateRefitClass(CLASS_E); locationHasNewStuff[Mech.LOC_HEAD] = true; - }else if (nPart instanceof MissingMekActuator) { - if (isOmniRefit && nPart.isOmniPoddable()) { - updateRefitClass(CLASS_OMNI); - } else { - updateRefitClass(CLASS_D); - } - locationHasNewStuff[nPart.getLocation()] = true; } else if (nPart instanceof MissingInfantryMotiveType || nPart instanceof MissingInfantryArmorPart) { updateRefitClass(CLASS_A); } else {