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

Corrected Morale Logic and Contract Type Checks #5890

Merged
merged 1 commit into from
Jan 28, 2025
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
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
Loading