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

Refactored Phenotype Enum; Added ATOW Attributes to Character Generation; Added 'Extra Attribute Randomization' Campaign Option #6564

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

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Apr 6, 2025

Dev Notes

Phenotypes

Certain phenotypes increase or decrease attributes. Some phenotypes also provide specific Traits (SPAs, in our nomenclature). Both of these cases are now fully implemented. I also went ahead and cleaned up the enum a bit, switching it over to i18n and updating the Unit Tests.

Professions

ATOW includes a few archetypes which offer suggested starting points for each attribute score. I've set up the code so that characters will generate (on average) with those attribute scores. However, a few of the examples provided in the manuals are straight up awful.

The Tanker archetype is the worst example. If I were to implement that Archetype most vehicle crew would spawn with a -1 penalty to both gunnery and piloting. Needless to say, that shan't be happening.

So while the code is set up to handle role-based attribute starting points, currently they're all set up to infer no modifier. I'm hoping to encourage a knowledgeable community member into providing some suggested starting attributes for our different professions. Once that's been sourced I can go in an update this (possibly in a separate PR).

Edit: This turned out to be an error in the manuals. I've since gone through and updated the Professions to have appropriate starting Attribute scores.

Campaign Options & Character Generation

When a character is generated, they are done so with 5 in every Attribute. A d6 is then rolled for each Attribute. On a roll of 1 the Attribute is decreased by 1; on a roll of 6 the Attribute is increased by 1.

In Campaign Options players can enable 'Extra Random Attributes'. This works identical to the above, however the d6 will 'explode'. What this means is if you roll a 1, you decrease the Attribute by 1 and then roll again. And keep going until you stop rolling 1s (or hit the minimum Attribute score of 1 - this isn't Traveller, nobody is dying in character creation). Conversely, if you roll a 6 you keep increasing the Attribute score by 1 until you stop rolling 6s (or hit the maximum Attribute score of 10).

- Replaced static resource-based getters in `Phenotype` with dynamic methods using resource bundles (`getLabel`, `getTooltip`, `getShortName`).
- Introduced attribute modifiers and bonus traits for `Phenotype`.
- Added the `isTrueborn` method for Clan phenotype classification.
- Deprecation of legacy methods like `getToolTipText`, `getName`, `parseFromString`, and `getGroupingName`.
- Reimplemented parsing logic with the `fromString` method supporting legacy inputs, labels, and ordinal formats.
- Implemented and applied random attribute generation in `RandomSkillPreferences` and `DefaultPersonnelGenerator`.
- Added UI elements and tooltips for randomizing attributes.
- Enhanced unit tests for attribute randomization and label validity.
- Added phenotype-based SPA generation by incorporating bonus traits from a character's phenotype.
- Imported `LVL3_ADVANTAGES` and adjusted logic to acquire phenotype traits as abilities.
- Refactored minor formatting issues for improved readability.
@IllianiCBT IllianiCBT added Personnel Personnel-related Issues Tests Issues or Pull Requests related to the project tests Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule labels Apr 6, 2025
@IllianiCBT IllianiCBT self-assigned this Apr 6, 2025
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.58%. Comparing base (e0ebe3a) to head (fc015ff).
Report is 19 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6564      +/-   ##
============================================
+ Coverage     11.57%   11.58%   +0.01%     
+ Complexity     6401     6393       -8     
============================================
  Files          1085     1085              
  Lines        139499   139615     +116     
  Branches      21514    21546      +32     
============================================
+ Hits          16149    16181      +32     
- Misses       121776   121863      +87     
+ Partials       1574     1571       -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.

…and align with localized key usage.

- Refactored and standardized string formatting across affected files for improved readability.
- Removed hardcoded personnel role strings from `Personnel.properties` and introduced `PersonnelRole.properties` to centralize localization resources.
- Replaced `parseFromString` method with `fromString` for improved method naming and expanded functionality, including handling deprecated names and case variations.
- Added unit tests to validate new `getLabel` functionality, `fromString` method, and missing resource keys for roles.
- Updated XML generation and parsing methods to utilize the new role localization handling with `getLabel`.
@IllianiCBT
Copy link
Collaborator Author

Updated to incorporate the ATOW and ATOW:Companion attributes.

I'm going to mark this as draft, as there is one last thing I want to do.

@IllianiCBT IllianiCBT marked this pull request as draft April 6, 2025 22:42
…te random roleplay attributes for personnel.es.
…Random Roleplay Attributes" to "Reset Roleplay Attributes."
@IllianiCBT
Copy link
Collaborator Author

Added a personnel right-click menu GM option to set ATOW Attributes for existing characters.

@IllianiCBT IllianiCBT marked this pull request as ready for review April 6, 2025 22:58
@IllianiCBT
Copy link
Collaborator Author

Flipping this back to live from draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule 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.

1 participant