-
Notifications
You must be signed in to change notification settings - Fork 188
Added AToW Wealth, Connections, Unlucky*, and Reputation Traits; Combat Sense, and Combat Paralysis SPAs; Integrated These Into CamOps Reputation #6540
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
Conversation
…Reputation - Integrated AToW (A Time of War) Wealth and Connections-based SPAs into `PersonnelOptions` and corresponding XML configurations. - Introduced new skill levels for wealth (negative to TP10) and connections (TP1 to TP10) with associated attributes and modifiers. - Updated `PersonnelOptions.java` to handle and initialize these new SPAs, ensuring compatibility with existing options.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6540 +/- ##
============================================
- Coverage 11.53% 11.53% -0.01%
+ Complexity 6373 6368 -5
============================================
Files 1084 1084
Lines 139319 139317 -2
Branches 21500 21500
============================================
- Hits 16076 16070 -6
- Misses 121671 121674 +3
- Partials 1572 1573 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…at_paralysis` in the default SPA file.
- Moved all skill-related classes into a discrete package
… Handling - Introduced `SkillAttribute` enum to represent attributes associated with skills. - Includes attributes such as REFLEXES, DEXTERITY, CHARISMA, etc. - Provides a utility method `fromString` for parsing input strings or integers. - Updated `SkillType` class: - Added references to `SkillAttribute` and `SkillSubType`. - Integrated new attributes `firstAttribute`, `secondAttribute`, and `subType`. - Deprecated methods `isCombatSkill`, `isPiloting`, and `isGunnery` in favor of `isSubTypeOf` methods. - Enhanced XML deserialization to handle new attributes and ensure backward compatibility. - Implemented a robust compatibility handler for legacy `SkillType` definitions. - Ensures compliance with new standards by updating subtype and attributes where missing.
- Introduced multiple new roleplay-specific skill subtypes: - Added ROLEPLAY_ART, ROLEPLAY_INTEREST, ROLEPLAY_SCIENCE, and ROLEPLAY_SECURITY. - Extended SkillType to include numerous new roleplay-oriented skills across various categories: - General skills like Acrobatics, Acting, Animal Handling, Climbing, and Languages. - Artistic pursuits like Dancing, Drawing, Painting, and Writing. - Interests such as History, Literature, Holo-Games, and Sports. - Science disciplines like Biology, Chemistry, Mathematics, and Physics. - Security-related skills like Cryptography, Sensor Operations, and Stealth. - Implemented methods for organized roleplay skill management, categorization, and dynamic randomization to ensure balance. - Updated skill creation and lookup infrastructure to support and initialize the new roleplay skills seamlessly.
…`lookupHash.get`, removing an unnecessary local variable. - Adjusted `roleplaySkillsModifier` values in `RandomSkillPreferences` to better scale with experience levels.
- Introduced "Ultra-Green" option to both Command and Roleplay skills with configurable modifiers. - Extended skill generation logic to include Ultra-Green experience level handling. - Updated GUI to support Ultra-Green modifiers, including additional fields in the Command and Roleplay Skills panels. - Adjusted roleplay skill modifiers to support a broader range of values. - Refactored skill generation code for modularity and maintainability, introducing `generateRoleplaySkills` for centralized logic. - Updated tooltips and properties to reflect the new Ultra-Green category.
- Introduced a new `SUPPORT_COMMAND` sub-type to the `SkillSubType` enum. - Updated skill definitions (`TACTICS`, `STRATEGY`, and `LEADER`) to use the new `SUPPORT_COMMAND` sub-type. - Adjusted skill generation logic to account for `SUPPORT_COMMAND` and prevent duplicate skill assignments. - Updated UI logic in `SkillsTab` for proper classification and handling of the new sub-type.
…Reputation - Integrated AToW (A Time of War) Wealth and Connections-based SPAs into `PersonnelOptions` and corresponding XML configurations. - Introduced new skill levels for wealth (negative to TP10) and connections (TP1 to TP10) with associated attributes and modifiers. - Updated `PersonnelOptions.java` to handle and initialize these new SPAs, ensuring compatibility with existing options.
…eputation, Unlucky) - Implemented new traits (Connections, Wealth, Reputation, Unlucky) to `Person` class, complete with getter and setter methods. - Updated the GUI to display and edit the new traits in applicable panels like `PersonViewPanel` and `CreateCharacterDialog`. - Adjusted XML import/export functionality to handle the new traits. - Incorporated additional logic where necessary to integrate traits into gameplay mechanics (e.g. how edge is affected by "Unlucky"). - Updated text resources in `CreateCharacterDialog.properties` and `GUI.properties` to include new trait labels and tooltips.
…eputation, Unlucky) - Implemented new traits (Connections, Wealth, Reputation, Unlucky) to `Person` class, complete with getter and setter methods. - Updated the GUI to display and edit the new traits in applicable panels like `PersonViewPanel` and `CreateCharacterDialog`. - Adjusted XML import/export functionality to handle the new traits. - Incorporated additional logic where necessary to integrate traits into gameplay mechanics (e.g. how edge is affected by "Unlucky"). - Updated text resources in `CreateCharacterDialog.properties` and `GUI.properties` to include new trait labels and tooltips.
- Added the columns `Connections`, `Wealth`, `Reputation`, and `Unlucky` to the `PersonnelTableModelColumn` class. - Updated test coverage in `PersonnelTableModelColumnTest` to include these new columns. - Ensured proper sorting functionality for the new columns by assigning `IntegerStringSorter` to them.
…cleaner and more consistent integer parsing.
Exactly what it says on the tin. This is the MegaMek portion of MegaMek/mekhq#6540
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.
Overall good. Most changes are just EC updates. The items marked are cases of CQL improvements and since the files are changing anyways, might as well get them done at the same time.
MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties
Outdated
Show resolved
Hide resolved
/** | ||
* @deprecated Use {@link #toString(PersonnelOptions, int)} instead. | ||
*/ | ||
@Override | ||
@Deprecated(since = "0.50.05", forRemoval = false) | ||
public String toString() { | ||
return toString(new PersonnelOptions(), 0); | ||
} | ||
|
||
public String toString(PersonnelOptions options, int reputation) { | ||
if (isCountUp()) { | ||
return "+" + getFinalSkillValue(); | ||
return "+" + getFinalSkillValue(options, reputation); | ||
} else { | ||
return getFinalSkillValue() + "+"; | ||
return getFinalSkillValue(options, reputation) + "+"; | ||
} |
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.
We don't deprecate a core method. Have it use the built in values to generate one. So if the options are passed in at some point, they should be stored somewhere and then used in the toString
method.
This is the (Java) Way.
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.
MekHQ/src/mekhq/campaign/rating/CamOpsReputation/ReputationController.java
Outdated
Show resolved
Hide resolved
# Conflicts: # MekHQ/src/mekhq/CampaignPreset.java # MekHQ/src/mekhq/campaign/Campaign.java # MekHQ/src/mekhq/campaign/CampaignOptions.java # MekHQ/src/mekhq/campaign/MercRosterAccess.java # MekHQ/src/mekhq/campaign/againstTheBot/AtBConfiguration.java # MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java # MekHQ/src/mekhq/campaign/market/PersonnelMarket.java # MekHQ/src/mekhq/campaign/market/contractMarket/AtbMonthlyContractMarket.java # MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java # MekHQ/src/mekhq/campaign/mission/AtBScenario.java # MekHQ/src/mekhq/campaign/mod/am/InjuryUtil.java # MekHQ/src/mekhq/campaign/parts/Avionics.java # MekHQ/src/mekhq/campaign/parts/CombatInformationCenter.java # MekHQ/src/mekhq/campaign/parts/FireControlSystem.java # MekHQ/src/mekhq/campaign/parts/LandingGear.java # MekHQ/src/mekhq/campaign/parts/MekActuator.java # MekHQ/src/mekhq/campaign/parts/MekLifeSupport.java # MekHQ/src/mekhq/campaign/parts/MekSensor.java # MekHQ/src/mekhq/campaign/parts/ProtoMekJumpJet.java # MekHQ/src/mekhq/campaign/parts/ProtoMekLegActuator.java # MekHQ/src/mekhq/campaign/parts/ProtoMekSensor.java # MekHQ/src/mekhq/campaign/parts/SpacecraftEngine.java # MekHQ/src/mekhq/campaign/parts/Thrusters.java # MekHQ/src/mekhq/campaign/personnel/Person.java # MekHQ/src/mekhq/campaign/personnel/PersonUtility.java # MekHQ/src/mekhq/campaign/personnel/SpecialAbility.java # MekHQ/src/mekhq/campaign/personnel/education/Academy.java # MekHQ/src/mekhq/campaign/personnel/generator/AbstractPersonnelGenerator.java # MekHQ/src/mekhq/campaign/personnel/generator/AbstractSkillGenerator.java # MekHQ/src/mekhq/campaign/personnel/generator/DefaultSkillGenerator.java # MekHQ/src/mekhq/campaign/personnel/skills/Skill.java # MekHQ/src/mekhq/campaign/personnel/skills/enums/SkillAttribute.java # MekHQ/src/mekhq/campaign/personnel/turnoverAndRetention/RetirementDefectionTracker.java # MekHQ/src/mekhq/campaign/randomEvents/RoninOffer.java # MekHQ/src/mekhq/campaign/randomEvents/prisoners/EventEffectsManager.java # MekHQ/src/mekhq/campaign/randomEvents/prisoners/PrisonEscapeScenario.java # MekHQ/src/mekhq/campaign/rating/CamOpsReputation/AverageExperienceRating.java # MekHQ/src/mekhq/campaign/rating/CamOpsReputation/CommandRating.java # MekHQ/src/mekhq/campaign/storyarc/storypoint/CreateCharacterStoryPoint.java # MekHQ/src/mekhq/campaign/stratcon/SupportPointNegotiation.java # MekHQ/src/mekhq/campaign/unit/Unit.java # MekHQ/src/mekhq/campaign/unit/actions/HirePersonnelUnitAction.java # MekHQ/src/mekhq/campaign/universe/generators/companyGenerators/AbstractCompanyGenerator.java # MekHQ/src/mekhq/gui/BriefingTab.java # MekHQ/src/mekhq/gui/CampaignGUI.java # MekHQ/src/mekhq/gui/CommandCenterTab.java # MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java # MekHQ/src/mekhq/gui/campaignOptions/CampaignOptionsPane.java # MekHQ/src/mekhq/gui/campaignOptions/CreateCampaignPreset.java # MekHQ/src/mekhq/gui/campaignOptions/contents/AbilitiesTab.java # MekHQ/src/mekhq/gui/campaignOptions/contents/AdvancementTab.java # MekHQ/src/mekhq/gui/campaignOptions/contents/PersonnelTab.java # MekHQ/src/mekhq/gui/campaignOptions/contents/RulesetsTab.java # MekHQ/src/mekhq/gui/campaignOptions/contents/SkillsTab.java # MekHQ/src/mekhq/gui/dialog/BatchXPDialog.java # MekHQ/src/mekhq/gui/dialog/CampaignExportWizard.java # MekHQ/src/mekhq/gui/dialog/CreateCharacterDialog.java # MekHQ/src/mekhq/gui/dialog/CustomizePersonDialog.java # MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java # MekHQ/src/mekhq/gui/enums/PersonnelTableModelColumn.java # MekHQ/src/mekhq/gui/model/CrewListModel.java # MekHQ/src/mekhq/gui/view/ContractSummaryPanel.java # MekHQ/src/mekhq/gui/view/PersonViewPanel.java # MekHQ/src/mekhq/module/atb/AtBEventProcessor.java # MekHQ/src/mekhq/module/atb/PersonnelMarketAtB.java # MekHQ/unittests/mekhq/campaign/autoresolve/ResolverTest.java # MekHQ/unittests/mekhq/campaign/personnel/education/AcademyTests.java # MekHQ/unittests/mekhq/campaign/randomEvents/prisoners/EventEffectsManagerTest.java # MekHQ/unittests/mekhq/campaign/randomEvents/prisoners/PrisonerMissionEndEventTest.java # MekHQ/unittests/mekhq/campaign/rating/FieldManualMercRevDragoonsRatingTest.java # MekHQ/unittests/mekhq/gui/dialog/nagDialogs/nagLogic/UntreatedPersonnelNagLogicTest.java
# Conflicts: # MekHQ/src/mekhq/campaign/personnel/Person.java # MekHQ/src/mekhq/campaign/personnel/PersonnelOptions.java # MekHQ/src/mekhq/campaign/unit/Unit.java
- Added a new `parseInt(String value)` method in `MathUtility` to handle integer parsing with a default fallback of `0`. - Updated all direct `Integer.parseInt` calls in the `Person` class to use the safer `MathUtility.parseInt` method. - Improved robustness of the codebase by handling potential parsing errors more gracefully. - Ensured consistency in integer parsing logic and reduced repetitive code.
- Replaced `MathUtility.parseInt` with `Integer.parseInt` in `SkillAttribute` and `SkillSubType` enum parsing to ensure errors are logged when parsing fails. - Added comments explaining the change to improve future maintainability.
- Replaced manual parsing and exception handling with `MathUtility.parseInt` for cleaner and more consistent code. - Simplified and streamlined value parsing for `toughness`, `connections`, `wealth`, `reputation`, `unlucky`, and `loyalty` properties. - Removed redundant `try-catch` blocks for number parsing. - Ensured default/fallback values are used via `MathUtility` where parsing fails, improving code reliability.
- Replaced `Integer.parseInt` with `MathUtility.parseInt` across `SkillType.java` for safer integer parsing with defaults. - Improved code robustness by providing fallback values when parsing fails. - Imported `MathUtility` to facilitate the change.
- Eliminated outdated code for renaming "Gunnery/Protomek" skill to "Gunnery/ProtoMek". - Cleanup improves maintainability by removing legacy compatibility logic introduced in version 0.49.12. - Ensures the codebase remains streamlined and up-to-date with current standards.
- Replaced direct `Integer.parseInt` calls with `MathUtility.parseInt` for more robust integer parsing. - Updated `ReputationController.java` to ensure consistent use of the utility method. - Improved error handling and code readability by relying on `MathUtility` for parsing logic.
The only thing I'm going to be hard up on is the deprecation of the toString method. It's a core method. If you're going to replace it with another method, change its name so it's not causing issues elsewhere. |
- Improved and standardized JavaDoc comments for better readability and clarity. - Replaced inline lists in comments with structured HTML `<ul>` and `<li>` elements for better formatting. - Enhanced skill level documentation to include "Heroic" and "Legendary" tiers. - Removed unused imports, streamlining the code and improving maintainability.
Requirements
Requires MegaMek/megamek#6829
Dev Notes
Wow this spiraled... Only thing to note is that Unlucky isn't RAW. As we can't really implement the GM interaction into mhq instead it just reduces available Edge.