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 Campaign Option to Randomize New Unit Quality #4158

Merged
merged 7 commits into from
Jun 8, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Jun 6, 2024

Requires: #4150

This PR adds a new campaign option to have new Units generate with randomized Quality ratings. I based the chance for each rating on the AtB Mek Quality table.

This table is based on a 2d6 + modifier roll, with results clamped within 2 and 12. Please note that Unit Quality is one of those cases where F is the best quality and A is the worst. The original AtB table appears to have unit quality incorrectly flipped around, so I factored for that.

image

Random Company Generator is affected by these changes, but applies a +2 modifier for the campaign commanders' roll, and a +1 modifier for officer rolls.

- Implemented getRandomUnitQuality method to generate quality of unit based on 2d6 roll and a modifier
- Added checkbox for enabling/disabling random new unit quality
- Updated related settings and tooltips in CampaignOptionsDialog.properties
- Updated set and get methods in CampaignOptions.java
- Adjusted the UI to accommodate the new option in CampaignOptionsPane.java
@IllianiCBT IllianiCBT changed the title Randomized new unit quality Added Option to Randomize New Unit Quality Jun 6, 2024
@IllianiCBT IllianiCBT changed the title Added Option to Randomize New Unit Quality Added Campaign Option to Randomize New Unit Quality Jun 6, 2024
@IllianiCBT IllianiCBT self-assigned this Jun 6, 2024
@SJuliez
Copy link
Member

SJuliez commented Jun 6, 2024

This seems to include the changes of previous PRs. Better reolve the conflict, then update so the difference is easier to see.

# Conflicts:
#	MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties
@IllianiCBT
Copy link
Collaborator Author

Conflicts resolved

# Conflicts:
#	MekHQ/src/mekhq/campaign/Campaign.java
@IllianiCBT
Copy link
Collaborator Author

Resolved conflicts

@codecov-commenter
Copy link

codecov-commenter commented Jun 8, 2024

Codecov Report

Attention: Patch coverage is 6.38298% with 88 lines in your changes missing coverage. Please review.

Project coverage is 10.27%. Comparing base (8491c48) to head (556b189).
Report is 1 commits behind head on master.

Current head 556b189 differs from pull request most recent head 1d2a07e

Please upload reports for the commit 1d2a07e to get more accurate results.

Files Patch % Lines
MekHQ/src/mekhq/gui/panes/CampaignOptionsPane.java 0.00% 16 Missing ⚠️
...rs/companyGenerators/AbstractCompanyGenerator.java 0.00% 13 Missing ⚠️
MekHQ/src/mekhq/campaign/unit/Unit.java 0.00% 12 Missing ⚠️
MekHQ/src/mekhq/campaign/mission/AtBContract.java 0.00% 9 Missing ⚠️
...ign/storyarc/storytrigger/AddUnitStoryTrigger.java 0.00% 6 Missing ⚠️
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 5 Missing ⚠️
...ekhq/gui/adapter/ProcurementTableMouseAdapter.java 0.00% 5 Missing ⚠️
MekHQ/src/mekhq/campaign/CampaignOptions.java 42.85% 4 Missing ⚠️
MekHQ/src/mekhq/gui/CampaignGUI.java 0.00% 4 Missing ⚠️
MekHQ/src/mekhq/gui/dialog/GMToolsDialog.java 0.00% 4 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4158      +/-   ##
============================================
- Coverage     10.28%   10.27%   -0.01%     
+ Complexity     5816     5809       -7     
============================================
  Files           921      920       -1     
  Lines        125827   125726     -101     
  Branches      18603    18600       -3     
============================================
- Hits          12944    12923      -21     
+ Misses       111613   111532      -81     
- Partials       1270     1271       +1     

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

IllianiCBT and others added 2 commits June 8, 2024 12:44
# Conflicts:
#	MekHQ/src/mekhq/campaign/Quartermaster.java
#	MekHQ/src/mekhq/campaign/mission/AtBContract.java
#	MekHQ/src/mekhq/campaign/storyarc/storytrigger/AddUnitStoryTrigger.java
#	MekHQ/src/mekhq/campaign/universe/generators/companyGenerators/AbstractCompanyGenerator.java
#	MekHQ/src/mekhq/gui/CampaignGUI.java
#	MekHQ/src/mekhq/gui/adapter/ProcurementTableMouseAdapter.java
#	MekHQ/src/mekhq/gui/dialog/GMToolsDialog.java
#	MekHQ/src/mekhq/gui/dialog/MekHQUnitSelectorDialog.java
#	MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java
@SJuliez SJuliez merged commit edfbec8 into MegaMek:master Jun 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants