Skip to content

Commit

Permalink
Merge pull request #4065 from SJuliez/AS_Corrections
Browse files Browse the repository at this point in the history
More Alpha Strike corrections
  • Loading branch information
SJuliez authored Dec 26, 2022
2 parents dcd6349 + 7573617 commit 3c71348
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static boolean hideSpecial(BattleForceSUA sua, ASCardDisplayable element)
|| (element.isLargeAerospace() && (sua == STD))
|| (element.usesCapitalWeapons() && sua.isAnyOf(MSL, SCAP, CAP))
|| (element.isType(BM, PM) && (sua == SOA))
|| (element.isType(CV, BM) && (sua == SRCH))
|| (element.isBattleMek() && (sua == SRCH))
|| (!element.isLargeAerospace() && sua.isDoor())
|| (hasAutoSeal(element) && (sua == SEAL));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,11 @@ protected double determineSpecialsDamage(WeaponType weaponType, Mounted linked,
* Only used for the damage specials LRM, SRM, TOR, IATM, AC, FLK
*/
protected static boolean qualifiesForSpecial(double[] damage, BattleForceSUA dmgType) {
if (dmgType.isAnyOf(FLK, TOR, IF, REAR, TUR, MSL, CAP, SCAP, STD, PNT)
if (dmgType.isAnyOf(FLK, TOR, REAR, TUR, MSL, CAP, SCAP, STD, PNT)
&& damage[0] + damage[1] + damage[2] + damage[3] > 0) {
return true;
} else if (dmgType == IF) {
return damage[2] > 0;
} else {
return roundUpToTenth(damage[1]) >= 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ protected void finalizeSpecials() {
if (element.getFullArmor() == 0) {
element.getSpecialAbilities().removeSUA(BAR);
}

// A unit with ENE doesn't need any type of CASE
if (element.hasSUA(ENE)) {
element.getSpecialAbilities().removeSUA(CASE);
element.getSpecialAbilities().removeSUA(CASEII);
element.getSpecialAbilities().removeSUA(CASEP);
}
}

/** Adds the sua(s) to the element and writes a report line for each, if it is not yet present. */
Expand Down

0 comments on commit 3c71348

Please sign in to comment.