Skip to content

Commit

Permalink
Merge pull request #5890 from IllianiCBT/moraleFix
Browse files Browse the repository at this point in the history
Corrected Morale Logic and Contract Type Checks
  • Loading branch information
IllianiCBT authored Jan 28, 2025
2 parents 474f69e + 2d08623 commit 6d6ae59
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions MekHQ/src/mekhq/campaign/mission/AtBContract.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,10 @@ public void checkMorale(Campaign campaign, LocalDate today) {
// This works with the regenerated Scenario Odds to crease very high intensity
// spikes in otherwise low-key Garrison-type contracts.
AtBMoraleLevel newMoraleLevel = switch (roll) {
case 0,1 -> STALEMATE;
case 2,3,4,5 -> ADVANCING;
case 6,7 -> DOMINATING;
case 8 -> OVERWHELMING;
default -> STALEMATE;
default -> STALEMATE; // 0-1
};

// If we have a StratCon enabled contract, regenerate Scenario Odds
Expand All @@ -529,7 +528,7 @@ public void checkMorale(Campaign campaign, LocalDate today) {
moraleLevel = newMoraleLevel;
routEnd = null;

if (contractType.isGarrisonType() && !contractType.isRiotDuty()) {
if (contractType.isGarrisonDuty()) {
updateEnemy(campaign, today); // mix it up a little
}
}
Expand Down Expand Up @@ -642,7 +641,7 @@ public void checkMorale(Campaign campaign, LocalDate today) {

// Additional morale updates if morale level is set to 'Routed' and contract type is a garrison type
if (moraleLevel.isRouted()) {
if (contractType.isGarrisonType() && !contractType.isRiotDuty()) {
if (contractType.isGarrisonType() || contractType.isReliefDuty()) {
routEnd = today.plusMonths(max(1, d6() - 3)).minusDays(1);
} else {
campaign.addReport("With the enemy routed, any remaining objectives have been" +
Expand Down

0 comments on commit 6d6ae59

Please sign in to comment.