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

Check for superheavy when determining IS crits for Clan structure #5230

Merged
merged 1 commit into from
Mar 9, 2024
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
22 changes: 11 additions & 11 deletions megamek/src/megamek/common/MiscType.java
Original file line number Diff line number Diff line change
Expand Up @@ -1307,19 +1307,19 @@ public int getCriticals(Entity entity, double size) {
return entity.locations() - 1;
}
} else if (hasFlag(F_ENDO_STEEL)) {
if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) {
return 7;
if (entity.isSuperHeavy()) {
return isClan() ? 4 : 7;
} else {
return 14;
return isClan() ? 7 : 14;
}
// Clan Endo Steel doesn't have variable crits
} else if (hasFlag(F_ENDO_STEEL_PROTO)) {
return entity.isSuperHeavy() ? 8 : 16;
} else if (hasFlag(F_ENDO_COMPOSITE)) {
if ((entity instanceof Mech) && ((Mech) entity).isSuperHeavy()) {
return 4;
if (entity.isSuperHeavy()) {
return isClan() ? 2 : 4;
} else {
return 7;
return isClan() ? 4 : 7;
}
// Clan Endo Composite doesn't have variable crits
} else if (hasFlag(F_FUEL)) {
return (int) Math.ceil(getTonnage(entity));
} else if (hasFlag(F_CARGO) || hasFlag(F_LIQUID_CARGO) || hasFlag(F_COMMUNICATIONS)) {
Expand Down Expand Up @@ -7644,7 +7644,7 @@ public static MiscType createISEndoSteelPrototype() {
misc.addLookupName("IS Endo Steel Prototype Structure");
misc.addLookupName("IS Endo-Steel Prototype Structure");
misc.tonnage = TONNAGE_VARIABLE;
misc.criticals = 16;
misc.criticals = CRITICALS_VARIABLE;
misc.hittable = false;
misc.spreadable = true;
misc.flags = misc.flags.or(F_ENDO_STEEL_PROTO);
Expand All @@ -7669,7 +7669,7 @@ public static MiscType createCLEndoSteel() {
misc.addLookupName("Clan EndoSteel Structure");
misc.addLookupName("Clan Endo Steel Structure");
misc.tonnage = TONNAGE_VARIABLE;
misc.criticals = 7;
misc.criticals = CRITICALS_VARIABLE;
misc.hittable = false;
misc.spreadable = true;
misc.flags = misc.flags.or(F_ENDO_STEEL);
Expand Down Expand Up @@ -7739,7 +7739,7 @@ public static MiscType createClanEndoComposite() {
misc.addLookupName("Clan Endo-Composite");
misc.addLookupName("Clan Endo-Composite Structure");
misc.tonnage = TONNAGE_VARIABLE;
misc.criticals = 4;
misc.criticals = CRITICALS_VARIABLE;
misc.hittable = false;
misc.spreadable = true;
misc.flags = misc.flags.or(F_ENDO_COMPOSITE);
Expand Down
Loading