Skip to content

Commit

Permalink
WIP: implement 02-08-2024 atmospheric control rolls errata
Browse files Browse the repository at this point in the history
  • Loading branch information
Algebro7 committed Aug 6, 2024
1 parent 23c20c3 commit 8462622
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions megamek/src/megamek/common/Aero.java
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,16 @@ public int getThresh(int loc) {
return 0;
}

public int getHighestThresh() {
int max = damThresh[0];
for (int i = 1; i < damThresh.length; i++) {
if (damThresh[i] > max) {
max = damThresh[i];
}
}
return max;
}

/**
* Determine if the unit can be repaired, or only harvested for spares.
*
Expand Down
2 changes: 2 additions & 0 deletions megamek/src/megamek/common/IAero.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ default int getClusterMods() {

int getThresh(int loc);

int getHighestThresh();

boolean wasCritThresh();

void setCritThresh(boolean b);
Expand Down
4 changes: 3 additions & 1 deletion megamek/src/megamek/server/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19348,7 +19348,9 @@ void checkForPSRFromDamage() {
getGame().addControlRoll(damPRD);
} else {
// was the damage threshold exceeded this round?
if (((IAero) entity).wasCritThresh()) {
// Note errata: https://bg.battletech.com/forums/index.php?topic=72983.msg2024516#msg2024516
if ((((IAero) entity).wasCritThresh())
|| entity.damageThisRound > ((IAero) entity).getHighestThresh()) {
PilotingRollData damThresh = new PilotingRollData(entity.getId(), 0,
"damage threshold exceeded");
if (entity.hasQuirk(OptionsConstants.QUIRK_POS_EASY_PILOT)
Expand Down

0 comments on commit 8462622

Please sign in to comment.