Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update refit classes based on CamOps #3662

Merged
merged 2 commits into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions MekHQ/src/mekhq/campaign/parts/Refit.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,39 +546,28 @@ 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 {
Expand Down