-
Notifications
You must be signed in to change notification settings - Fork 178
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
Implemented Incremental Loyalty Changes #4441
Implemented Incremental Loyalty Changes #4441
Conversation
New service logger messages were added for statuses 'SACKED' and 'LEFT'. In addition, turnover retirement information is now temporarily stored across new day events, allowing its retrieval on a new day.
In the `Person` class, when a person's status was updated to 'Dead', checks were added to determine if the person has living children. If the person had children and no living parents remain, the children are logged as orphans.
Enhanced the way the game handles the death of a character within a relationship. Introduced comprehensive checks and notifications for the status of family members upon a character's death, including living spouses, children, and parents. Logs were also updated to differentiate between 'divorced' and 'widowed'.
Added new functionality to manage character loyalty changes in various scenarios including childbirth, death of family members, or financial matters. Refactored multiple notification messages related to finance handling to be more descriptive and provide more accurate information.
The 'useLeadershipChangeRefresh' variable was removed from CampaignOptions and all related settings, methods and bindings. This included the GUI components associated with this option, its XML handlers and its references in the properties file.
The loyalty refreshing logic has been refactored and improved. Removed multiple calls to 'refreshLoyalty()' method across different personnel status conditions. Instead, a new 'massChangeLoyalty()' method is introduced which triggers a loyalty change for the entire unit when the current character is a campaign commander who hasn't resigned or retired.
The condition in the 'Person.java' file for triggering a loyalty change has been modified. Previously, the loyalty change would occur if the character had living parents. The way it works now, the loyalty change is only triggered if the character still qualifies as a child.
The default loyalty value for the Person class in MekHQ was changed from 0 to 9.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4441 +/- ##
============================================
- Coverage 10.24% 10.23% -0.02%
+ Complexity 5809 5807 -2
============================================
Files 924 925 +1
Lines 126436 126569 +133
Branches 18766 18807 +41
============================================
- Hits 12953 12949 -4
- Misses 112208 112343 +135
- Partials 1275 1277 +2 ☔ View full report in Codecov by Sentry. |
The update includes modifications in PersonnelTableMouseAdapter file. It now processes loyalty changes whenever prisoners are executed or jettisoned.
The logic for executing and jettisoning prisoners has been consolidated into a single method to avoid code duplication. This simplification provides clearer path and less maintenance, improving overall code health. The prompt messages have also been updated to include information about the potential loyalty changes that could occur as a result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and I think it works.
This PR attempts to make Loyalty more dynamic by introducing event-based Loyalty changes. Now, as personnel 'live' their lives events may occur which result in Loyalty being tested. Sometimes it will improve, other times it will be reduced.
Triggering events include...
Both Turnover & Retention and Education documentation have been updated to reflect these changes.
Important
This PR merges in changes made in #4439 and #4440 and must be merged last to avoid conflicts.