-
Notifications
You must be signed in to change notification settings - Fork 188
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
Enhanced Ronin Event #6277
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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.
- 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.
MekHQ/src/mekhq/campaign/randomEvents/personalities/PersonalityController.java
Dismissed
Show dismissed
Hide dismissed
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
# 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
|
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
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.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
getRoninMessage
in theAggression
,Ambition
,Greed
andSocial
enums to format and retrieve messages for Ronin warriors.getRoninMessage
generates valid resource keys for allAggression
,Ambition
,Greed
andSocial
values.recruitRonin
with an instance ofRoninOffer
.AtBContract
into a newRoninOffer
class to improve modularity and maintainability.RoninOfferDialog
to handle Ronin character recruitment with in-character and out-of-character messaging.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.
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:
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.