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

Added Potential Difficulty Spikes to Garrison-Type Contracts #5690

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

IllianiCBT
Copy link
Collaborator

  • Changed the special handler that causes some contract types to start at 'Routed' to only apply to Garrison contracts. Rather than all Garrison-type contracts.
  • Updated 'Peaceful' morale level to include clearer tooltips.
  • Added the ability for reinforcements on Garrison-Type contracts to arrive with morale between Stalemate and Overwhelming.
  • Added the possibility for reinforcements on Garrison-type contracts to arrive with a substantially spiked scenario chance, representing a more substantial attack.
  • Added early contract end to Riot Duty contracts. Once the riots have been quelled these contracts will end, rather than essentially becoming Garrison Duty contracts by another name.

Fix #5689

Refactored morale adjustments to introduce variable morale levels, improving dynamic contract outcomes. Added logic to regenerate scenario odds for StratCon-enabled contracts, incorporating multipliers for higher intensity scenarios. Replaced redundant calls to `Compute.randomInt` with `randomInt` for consistency.
Standardized morale level updates and clarified Garrison contract checks by replacing `isGarrisonType` with `isGarrisonDuty` for consistency. Adjusted morale logic, randomization, and scenario odds processing to improve code accuracy and readability. Updated tooltip text to better describe a Garrison state scenario.
Previously, enemy updates were applied universally during morale changes. Added a condition to limit updates to garrison contracts that are not riot duty, ensuring more accurate behavior. This prevents unintended changes in scenarios outside the specified contract types.
@IllianiCBT IllianiCBT added the StratCon Bugs relating strictly to StratCon label Jan 7, 2025
@IllianiCBT IllianiCBT self-assigned this Jan 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.03%. Comparing base (4cf3be1) to head (09ec58a).
Report is 58 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5690   +/-   ##
=========================================
  Coverage     10.02%   10.03%           
- Complexity     6068     6069    +1     
=========================================
  Files          1074     1074           
  Lines        141641   141659   +18     
  Branches      20645    20652    +7     
=========================================
+ Hits          14206    14209    +3     
- Misses       126063   126081   +18     
+ Partials       1372     1369    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// 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 -> AtBMoraleLevel.STALEMATE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format makes these tables so much cleaner!

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sleet01 Sleet01 merged commit ff53b77 into MegaMek:master Jan 9, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
StratCon Bugs relating strictly to StratCon
Projects
None yet
3 participants