From 2d086239cbb5688d8583727535d33e4a52c373ab Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Sun, 26 Jan 2025 15:50:49 -0600 Subject: [PATCH] Corrected Morale Logic and Contract Type Checks - Simplified morale roll outcomes by consolidating default cases. - Updated contract type checks to better handle Relief Duty contracts. - Ensured only Garrison Duty contracts changed the OpFor faction when ending a rout. This will stop Rebel OpFors suddenly turning into Clan OpFors on Security Duty and similar contracts. --- MekHQ/src/mekhq/campaign/mission/AtBContract.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/mission/AtBContract.java b/MekHQ/src/mekhq/campaign/mission/AtBContract.java index 17357cf54b..9b4a1c3c92 100644 --- a/MekHQ/src/mekhq/campaign/mission/AtBContract.java +++ b/MekHQ/src/mekhq/campaign/mission/AtBContract.java @@ -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 @@ -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 } } @@ -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" +