Skip to content

Conversation

@IllianiBird
Copy link
Collaborator

Under vanilla AM an individual Injury is worth n TW Hits, where n is the severity of the injury. This was a semi-random value based on the injury type and some math. This made it hard to know truly how many Hits a character would have, going into a scenario if they were pre-injured. With AAM I wanted to remove a lot of this ambiguity. Now all injuries - that are not records of prosthetic of implant surgery - are worth 1 Hit. If a character has 3 Injuries, they have 3 Hits. Simple.

@IllianiBird IllianiBird self-assigned this Nov 20, 2025
@IllianiBird IllianiBird added the Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature label Nov 20, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner November 20, 2025 03:48
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.73%. Comparing base (f130d04) to head (38d27b8).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/personnel/Injury.java 40.00% 5 Missing and 1 partial ⚠️
MekHQ/src/mekhq/campaign/personnel/Person.java 50.00% 1 Missing ⚠️
...edical/advancedMedicalAlternate/InjurySubType.java 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8254   +/-   ##
=========================================
  Coverage     11.72%   11.73%           
- Complexity     7532     7535    +3     
=========================================
  Files          1271     1271           
  Lines        162724   162753   +29     
  Branches      24515    24521    +6     
=========================================
+ Hits          19082    19097   +15     
- Misses       141644   141657   +13     
- Partials       1998     1999    +1     

☔ 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.

@HammerGS HammerGS requested a review from Copilot November 21, 2025 02:36
Copilot finished reviewing on behalf of HammerGS November 21, 2025 02:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the Alt Advanced Medical system to ensure that all injuries (except prosthetics and flaws) count as exactly 1 "Hit" for Total Warfare purposes. This simplifies the injury system by removing the ambiguity of variable severity values, making it easier to predict how many hits a character has based on their injury count.

  • Added new FLAW injury subtype to exclude flaw-based injuries from hit counts
  • Updated logger naming from lowercase to uppercase to follow codebase conventions
  • Modified getHits() logic to return consistent hit values for Alt Advanced Medical injuries

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
InjurySubType.java Added FLAW enum value and isFlaw() method to support exclusion of flaw-based injuries from hit calculations
Person.java Changed DISCONTINUATION_SYNDROME severity from 0 to 1 and refactored to use getTotalInjurySeverity() for better code maintainability
Injury.java Updated logger naming to uppercase LOGGER convention and implemented Alt Advanced Medical hit normalization logic in getHits() to return 1 for all non-prosthetic/non-flaw injuries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant