8000 Enhanced Ronin Event by IllianiBird · Pull Request #6277 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enhanced Ronin Event #6277

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

Merged
merged 17 commits into from
Mar 23, 2025
Merged

Enhanced Ronin Event #6277

merged 17 commits into from
Mar 23, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented Mar 14, 2025
  • Implemented getRoninMessage in the Aggression, Ambition, Greed and Social enums to format and retrieve messages for Ronin warriors.
  • Added corresponding unit tests to ensure getRoninMessage generates valid resource keys for all Aggression, Ambition, Greed and Social values.
  • Simplified recruitment calls by replacing recruitRonin with an instance of RoninOffer.
  • Modified RoninOffer to randomize Ronin personnel roles between MEKWARRIOR and AEROSPACE_PILOT.
  • Integrated RandomSkillPreferences in preparation for conflict resolution with Refactored Skill Overrides; Added Randomization Logic; Added AeroSpace Ronin #6273
  • Extracted Ronin recruitment logic from AtBContract into a new RoninOffer class to improve modularity and maintainability.
  • Introduced RoninOfferDialog to handle Ronin character recruitment with in-character and out-of-character messaging.
  • Created generateBigPersonality method to assign detailed personality traits for major characters, ensuring unique profiles.

Requirements

Requires #6295

Dev Notes

Currently, each month (while on an AtB contract) there is a chance a Veteran MekWarrior will randomly join the campaign. In 50.03 these were rebranded as 'Ronin'. With some minor alterations. In 50.05 they will be playing a much bigger role as part of the Recruitment Overhaul.

In preparation for those changes I've gone ahead and isolated the ronin code into its own class. Furthermore, I went ahead and improved the event presentation. Now, when a Ronin event occurs, the player will be presented with a message from their HR representative.

image

If the message is accepted, the player will be presented with a follow-up message from the Ronin themselves. The text in this message will be unique, based on the personality of the Ronin themselves. There are 120 different messages the player can receive. I've included some examples below:

image image image image

Another reason why we've moved to these dialogs is that it gives the player the opportunity to refuse the Ronin, if they don't align with their campaign.

Finally, I've added a 1in4 chance that a Ronin will be a AeroSpace Pilot instead of a MekWarrior.

- Implemented a new method `getRoninMessage` in the `Aggression` enum to generate formatted messages for Ronin warrior recruitment.
- Added Javadoc documentation for the new method explaining its purpose and usage.
- Created a corresponding unit test, `testGetRoninMessage_notInvalid`, to ensure the validity of the generated messages.
- Updated the unit tests to iterate through all `Aggression` enum values for comprehensive coverage.
- Introduced `getRoninMessage` method in `Ambition` enum for generating formatted messages when a Ronin warrior expresses interest.
- Added Javadoc explaining the usage and parameters of the new method.
- Implemented a unit test `testGetRoninMessage_notInvalid` to validate the correctness of `getRoninMessage`.
- Ensured the unit test iterates through all `Ambition` values and variations to verify resource key validity.
- Implemented `getRoninMessage` in the `Greed` enum to format and retrieve messages for Ronin warriors.
- Added a corresponding unit test to ensure `getRoninMessage` generates valid resource keys for all `Greed` values.
- Ensured compatibility with the commander's address parameter for accurate message formatting.
- Introduced the `getRoninMessage` method in the `Social` enum to handle formatting and retrieval of Ronin messages.
- Updated Javadoc to document the functionality of the new method, specifying its purpose and parameters.
- Added a corresponding unit test, `testGetRoninMessage_notInvalid`, to validate the output for all `Social` traits and variations.
- Ensured the message generation uses resource keys and integrates the provided commander address dynamically.
- Introduced `RoninOfferDialog` to handle Ronin character recruitment with in-character and out-of-character messaging.
- Created `generateBigPersonality` method to assign detailed personality traits for major characters, ensuring unique profiles.
- Integrated Ronin offer dialogs and personality generation into the `AtBContract` workflow.
- Removed redundant line breaks in the Ronin offer report for cleaner presentation.
- Adjusted table width from 100% to 75% for improved aesthetics.
- Removed unnecessary bullet points from skills and abilities lists.
- Simplified "no abilities" message for consistency and brevity.
- Extracted Ronin recruitment logic from `AtBContract` into a new `RoninOffer` class to improve modularity and maintainability.
- Simplified recruitment calls by replacing `recruitRonin` with an instance of `RoninOffer`.
- Added collection reversal for skill display logic in `RoninOfferDialog` for better data presentation.
- Removed redundant method `recruitRonin` from `AtBContract`.
- Eliminated unused imports across updated files.
…ARRIOR and AEROSPACE_PILOT.

- Integrated RandomSkillPreferences to allow optional extra randomness in Ronin skill assignment.
@IllianiBird IllianiBird added AtB Legacy Improvement Improves a legacy setup's handling. Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature labels Mar 14, 2025
@IllianiBird IllianiBird self-assigned this Mar 14, 2025
- Introduced the standard MekHQ file header to RoninOfferDialog.java for legal and informational consistency.
- Ensures compliance with GPL requirements and provides copyright and licensing details.
- Matches the format used across other files in the project.
@IllianiBird IllianiBird added the Tests Issues or Pull Requests related to the project tests label Mar 14, 2025
@codecov-commenter
Copy link
codecov-commenter commented Mar 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.32%. Comparing base (eab8269) to head (4709815).
Report is 43 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6277      +/-   ##
============================================
- Coverage     11.33%   11.32%   -0.02%     
  Complexity     6267     6267              
============================================
  Files          1069     1070       +1     
  Lines        135662   135866     +204     
  Branches      20974    21009      +35     
============================================
+ Hits          15374    15382       +8     
- Misses       118745   118939     +194     
- Partials       1543     1545       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IllianiBird IllianiBird added New Feature Used with the RFE tag to indicate a new feature For New Dev Cycle and removed New Feature Used with the RFE tag to indicate a new feature labels Mar 16, 2025
# Conflicts:
#	MekHQ/src/mekhq/campaign/mission/AtBContract.java
- Updated the Ronin skill assignment to use `overrideSkills` with fixed parameters, ensuring consistent initialization.
- Consolidated loyalty and advantages reroll logic by using `ronin.getSkillLevel` for determining skill level.
- Removed unnecessary imports from `HireBulkPersonnelDialog` and replaced them with relevant utility imports.
- Enhanced readability and maintainability by improving method calls and parameter clarity.
- Removed `RoninOfferDialog` class and migrated its logic to `RoninOffer` for better centralization of Ronin recruitment interactions.
- Updated recruitment process to include fee based on whether StratCon is enabled, or not.
- Updated dialogs to utilize the new 'GenericImmersiveMessageDialog' class
@IllianiBird
Copy link
Collaborator Author
  • Removed RoninOfferDialog class and migrated its logic to RoninOffer for better centralization of Ronin recruitment interactions.
  • Updated recruitment process to include fee based on whether StratCon is enabled, or not.
  • Updated dialogs to utilize the new 'GenericImmersiveMessageDialog' class

if (message.isBlank()) {
return getFormattedTextAt(RESOURCE_BUNDLE, "message.ic.fallback", commanderAddress);
} else {
return String.format(message, commanderAddress);

Check warning

Code scanning / CodeQL

Unused format argument Warning

This format call refers to 0 argument(s) but supplies 1 argument(s).
# Conflicts:
#	MekHQ/src/mekhq/campaign/mission/AtBContract.java
@IllianiBird
Copy link
Collaborator Author

Updated to 50.05

# Conflicts:
#	MekHQ/src/mekhq/campaign/mission/AtBContract.java
- Refactored imports to include static imports for `TANK` and `AEROSPACEFIGHTER` for consistency and readability.
- Updated unit counting logic to use these static imports, improving code clarity.
@IllianiBird IllianiBird merged commit 2344aa9 into MegaMek:master Mar 23, 2025
6 checks passed
@IllianiBird IllianiBird deleted the ronin branch March 23, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AtB Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature Legacy Improvement Improves a legacy setup's handling. Tests Issues or Pull Requests related to the project tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0