Skip to content

Fixed Non-Binary Pronoun Support for Personality Generator; Added Additional Quirks; Expanded Characteristic Variants; Fixed Personality Generator #6202

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 12 commits into from
Mar 10, 2025

Conversation

IllianiBird
Copy link
Collaborator

@IllianiBird IllianiBird commented Mar 9, 2025

  • Fixed description grammar to work for male, female and non-binary characters
  • Fixed personality generation to no longer generate empty personalities
  • Added 14 new personality quirks
  • Added missing unit test cases
  • Doubled the number of description variants for the primary characteristics (Aggression, Ambition, Greed, and Social) from 3 to 6.

REQUIRES

Requires MegaMek/megamek#6674

Dev Notes

This is the culmination of 5 dev days spent going through each of the now 2,353 different personality descriptions . At this point, outside of minor grammatical corrections, I really need the personality generator to be finished. Overall this has taken around 3 weeks of work to get where it is now. I'm hoping this will breathe new life into the characters in player's campaigns and better encourage emergent storytelling.

The next step will be tying it all into a random personality event system, but that's a ways off.

- Introduced `PronounData` record to encapsulate gender-based pronoun information and pluralization logic.
- Added a new test `testFromString_FromOrdinal` in `AggressionTest` to validate `Aggression.fromString` functionality.
- Expanded descriptions in `Aggression.properties` for various aggression traits, adding new variations to improve depth and clarity.
- Refined phrasing in existing descriptions to include conditional choices, improving gender-neutral language support and overall correctness.
- Added additional description variants for all ambition traits to improve narrative depth and flexibility.
- Integrated conditional messaging (`{7, choice}`) for dynamic pronoun and verb agreement.
…noun Handling

- Increased `MAXIMUM_VARIATIONS` in the `Greed` enum from 3 to 6 to support additional description variations.
- Refactored the pronoun handling logic in `getDescription` to leverage `PronounData` from `PersonalityController`, improving readability and maintainability.
- Updated `GreedTest` unit tests to include tests for the new `INSATIABLE` enum value and other edge cases.
- Expanded `Greed.properties` descriptions to accommodate new variations and integrated pluralization for gender-neutral pronouns.
- Replaced repetitive pronoun logic with `PronounData` for better encapsulation and code reuse.
- Increased `MAXIMUM_VARIATIONS` from 3 to 6 to accommodate additional description variants.
- Updated social descriptions in property files to support new variations and enhanced pluralization logic.
- Adjusted `Social.fromString` to handle more flexible input formats.
- Added test cases for validation of `fromString` functionality and expanded ordinal handling.
- Expanded the `ENCOURAGING` trait with four new detailed descriptions: `.3`, `.4`, and `.5`, enhancing its narrative depth.
- Fixed minor formatting consistency issue in `PERSUASIVE.description.1`.
- Introduced `PronounData` class to simplify logic for gender-specific pronouns within the `getDescription` method.
- Updated `getDescription` logic to streamline handling of intelligence descriptions by removing direct use of gender-specific enum descriptors.
- Added pluralization options via a new token (`{7}`) to improve flexibility in descriptions across all intelligence levels in resource files.
- Fixed incorrect logger reference in the `fromString` method, replacing `Greed.class` with `Intelligence.class`.
- Enhanced `IntelligenceTest` with a new test case (`testFromString_FromOrdinal`) to improve coverage and validate `fromString` over ordinal strings.
- Added inspection suppression annotations to the `Intelligence.properties` file for unused keys and parameters.
- Updated resource file to include pluralization logic in multiple intelligence descriptions.
- Reorganized `getTraitDescriptions` to accept individual parameters for cleaner separation of responsibilities.
- Moved handling of Intelligence and Personality Quirks descriptions out of `getTraitDescriptions` to simplify its scope.
- Improved clarity and modularity by separating personality trait description logic into distinct sections.
- Updated personality description assembly to handle Intelligence and Quirk descriptions separately and append them appropriately.
- Adjusted documentation to reflect new parameterized `getTraitDescriptions` method.
- Corrected the variable name from `pronounDate` to `pronounData` in the `Greed`, `Social`, `Intelligence`, `Ambition`, and `Aggression` enums for consistency and readability.
- Replaced repeated manual pronoun assignment logic in `PersonalityQuirk` with the `PronounData` helper class for better maintainability and cleaner code.
- Streamlined pronoun-related operations across all personality-related classes to use `PronounData`, improving uniformity in handling gendered text.
- Introduced five new personality quirks (`PANTSLESS`, `MAKES_CLOTHES`, `DESTINY`, `ACTS_SUSPICIOUSLY`, and updated `CHRONIC_LATENESS`) in `PersonalityQuirk` enum.
- Fixed formatting issues and standardized language in descriptions within `PersonalityQuirk.properties`.
- Updated description text to use consistent naming, pronouns, and choice-based value substitution for flexibility.
- Removed unused uppercase/lowercase variants in resource strings to simplify property usage.
- Added unit test to validate `PersonalityQuirk.fromString` for ordinal values, ensuring proper functionality of new quirks.
- Introduced new personality quirks in `PersonalityQuirk` enum, expanding character trait options.
- Fixed random generation logic in `PersonalityController` to correctly account for full enum range.
- Updated unit tests in `PersonalityQuirkTest` to reflect changes in personality quirks and ensure proper validation.
- Adjusted `PersonalityQuirk.properties` and descriptions for new quirks, enhancing narrative variety.
- Made minor formatting adjustments for consistency and clarity in resources and descriptions.
@IllianiBird IllianiBird added Bug Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature labels Mar 9, 2025
@IllianiBird IllianiBird self-assigned this Mar 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.13%. Comparing base (4e292ff) to head (5bb3dee).
Report is 35 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6202      +/-   ##
============================================
+ Coverage     11.12%   11.13%   +0.01%     
- Complexity     6421     6428       +7     
============================================
  Files          1062     1062              
  Lines        140674   140681       +7     
  Branches      20943    20946       +3     
============================================
+ Hits          15645    15665      +20     
+ Misses       123404   123388      -16     
- Partials       1625     1628       +3     

☔ 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 the Tests Issues or Pull Requests related to the project tests label Mar 9, 2025
Copy link
Collaborator

@psikomonkie psikomonkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Whoever merges this, please make sure MegaMek/megamek#6674 has been merged first. Thanks!

Scoppio added a commit to MegaMek/megamek that referenced this pull request Mar 10, 2025
- Added a method to check whether a character's gender is 'other' (i.e.
non-binary).

### REQUIRED
Required by MegaMek/mekhq#6202
@IllianiBird IllianiBird merged commit cd86472 into MegaMek:master Mar 10, 2025
4 checks passed
@IllianiBird IllianiBird deleted the personalitiesTheyThemSupport branch March 23, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature Tests Issues or Pull Requests related to the project tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants