Skip to content

Commit

Permalink
Merge pull request #4187 from SJuliez/AS_Conversion_Various_Fixes_2
Browse files Browse the repository at this point in the history
AS conversion fixes
  • Loading branch information
SJuliez authored Feb 17, 2023
2 parents 06c73b1 + d9290d2 commit bf68720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,11 @@ protected void processForceBonus() {
modifierList.add("LECM");
}
if (element.hasSUA(MHQ)) {
int mhqValue = (int) element.getSUA(MHQ);
int mhqValue = element.getMHQ();
if (mhqValue <= 4) {
bonus += mhqValue;
} else {
bonus += 4 + Math.ceil(0.2 * mhqValue);
bonus += 4 + Math.ceil(0.2 * (mhqValue - 5));
}
modifierList.add("MHQ");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected void processMiscMounted(Mounted misc) {
} else if (miscType.hasFlag(F_VIRAL_JAMMER_HOMING)) {
assign(misc, HJ);
} else if (miscType.hasFlag(F_CARGO)) {
assign(misc, CT, (int) misc.getTonnage());
assign(misc, CT, misc.getTonnage());
} else if (miscType.hasFlag(F_HARJEL)) {
assign(misc, BHJ);
} else if (miscType.hasFlag(F_HARJEL_II)) {
Expand Down Expand Up @@ -540,9 +540,10 @@ protected void finalizeSpecials() {
element.getSpecialAbilities().removeSUA(CTxD);
report.addLine("Replace CT with CK",
AlphaStrikeHelper.formatAbility(CK, element.getSpecialAbilities(), element, ", "));
} else if (ctValue > 1) {
element.getSpecialAbilities().replaceSUA(CT, (int) Math.round(ctValue));
} else if (element.isLargeAerospace()) {
// Replace CT with a rounded value on large aerospace
if (ctValue != (int) ctValue) {
element.getSpecialAbilities().replaceSUA(CT, (int) Math.round(ctValue));
report.addLine("Final CT value",
AlphaStrikeHelper.formatAbility(CT, element.getSpecialAbilities(), element, ", "));
}
Expand Down

0 comments on commit bf68720

Please sign in to comment.