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

Personality Revamp #5998

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Feb 7, 2025

  • Fixed bug that was causing characters to get negative and major personality traits more often than intended. This may result in some personality changes between <50.04 and 50.04.
  • Fixed a bug where personality would be generated twice.
  • Moved getPersonalityValue method out of Reputation class and into Personality Controller, as it made more sense for it to live there.
  • Refactored folder organization in RandomEvents folder. No functionality change.
  • Rewrote all personality descriptions. All personality descriptions now come in three flavors, effectively tripling the number of personality traits we support without actually increasing their number. What flavor a character will get is determined at character creation and cannot be changed, those individual traits can be changed as normal. This is true for the next two points, also.
  • Rewrote all intelligence descriptions. All intelligence descriptions also come in three flavors.
  • Rewrote all personality quirks. All personality quirks now come in six flavors. Three flavors for combat professions. Three flavors for support professions. Dependents no longer show personality quirks. Description will update whenever a character's primary role is changed, ensuring things are kept consistent. Quirk descriptions should mirror each other across the Combatant:Support divide.
  • Added a handful of new personality quirks.
  • Added unit tests to test the personality enums. This will ensure we can never end up in a situation where an enum has incomplete information.
  • Converted personality traits, quirks, and intelligence to use MHQInternationalization, without which this PR wouldn't be possible.

Taking everything into consideration we have gone from 120 individual personality characteristics to 360. Intelligence has gone from 24 to 72. And personality quirks have gone from 217 quirks (with one description each) to 229 individual quirks and 1,374 descriptions.

And for anyone wondering what the difference looks like, we go from this...
image

To this...
image

Moved personality-related classes and controllers from the "personnel.randomEvents" package to the "randomEvents.personalities" package. Updated all affected imports and references across various files to align with the new structure. Added a helper method to `PersonalityController` for calculating personality values.
Replaced ordinal-based traits with name-based handling for better readability, removing outdated compatibility logic. Centralized resource management for personality descriptions using properties files, improving maintainability and localization support. Streamlined enum trait methods and added descriptive accessors for consistency.
This update introduced new fields for personality trait description indices and initialized them with random values using `randomInt(3)`. The changes enable more detailed and randomized personality descriptions and extended XML handling for saving and loading these indices. Additionally, personality description property files were updated to support multiple descriptions per trait.
Revised character trait descriptions to use gender-neutral pronouns and phrasing, enhancing inclusivity. This applies to both Aggression and Ambition property files across multiple traits.
Added ".regexp" suffix to resource keys in personality enums to align with expected format. This ensures proper localization lookup and resolves potential inconsistencies in description retrieval.
Replaced existing description keys with `.regexp` counterparts for better consistency and potential adaptability. This change aligns the property structure to a more standardized format across the file.
Revised and expanded intelligence and greed property descriptions to use regex for enhanced flexibility and customization. Corrected terminology inconsistencies, replacing 'Mech with 'Mek across multiple entries to ensure alignment with proper usage.
…rals

Adjusted the personality description logic to include proper paragraph formatting. Fixed single-quote escaping in resource files to ensure consistency and prevent errors.
Replaced hardcoded names and pronouns with dynamic placeholders in Social.properties. This improves reusability and allows descriptions to adapt to different characters automatically.
Simplified property key structure by removing ".regexp" suffix in Intelligence and Aggression property files. This ensures consistency and reduces redundancy in key naming while maintaining the same functional content.
Expanded the descriptions for all Personality Quirks, adding nuance and depth through multiple detailed variants. This enhances the context and characterization, creating more immersive and relatable attributes for each quirk.
…descriptions.

Updated descriptions in resource files for better narrative depth and clarity, distinguishing between combatant and civilian personas. This improves immersion and contextual storytelling for characters.
Expanded the descriptions of various personality quirks in the `PersonalityQuirk.properties` file. Each quirk now includes nuanced backstories and motivations tailored to both combatant and civilian contexts, enhancing depth and character immersion.
Removed "DEBRIS_SLINGER" from quirks, updated civilian roles to support roles, and added numerous new personality quirks to enhance diversity. Adjusted descriptions to align with the support role context for consistency.
Added campaign context to personality generation and description logic, enabling context-sensitive behavior for factions and roles. Updated related classes and methods to support this refactor, ensuring accurate generation and descriptions based on campaign information.
# Conflicts:
#	MekHQ/src/mekhq/campaign/personnel/Person.java
#	MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java
Moved the `getPersonalityValue` method from `CommandRating` to `PersonalityController` to centralize personality-related logic. Updated imports and documentation to align with the refactor. Consolidated copyright year updates across multiple files.
Added test classes for personality-related enums (Greed, Aggression, Social, Intelligence, Ambition, and PersonalityQuirk). These include validation for string parsing, labels, and descriptions to ensure proper functionality.
Replaced redundant calls to PersonalityController with a static import for writeDescription. Ensured consistent usage of writeDescription during role updates and name changes for improved code clarity and maintainability.
@IllianiCBT IllianiCBT added Bug Personnel Personnel-related Issues Tests Issues or Pull Requests related to the project tests labels Feb 7, 2025
@IllianiCBT IllianiCBT self-assigned this Feb 7, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.38%. Comparing base (a428dfd) to head (cde0655).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5998      +/-   ##
============================================
+ Coverage     10.32%   10.38%   +0.06%     
- Complexity     6113     6129      +16     
============================================
  Files          1038     1038              
  Lines        139294   139379      +85     
  Branches      20662    20673      +11     
============================================
+ Hits          14382    14479      +97     
+ Misses       123468   123457      -11     
+ Partials       1444     1443       -1     

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

Replaced numerical keys with descriptive "lance" keys for Inner Sphere terminology in PersonalityQuirk.properties. This enhances clarity and improves maintainability of resource definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Personnel Personnel-related Issues 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