-
Notifications
You must be signed in to change notification settings - Fork 178
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
Adjusted Sale Value for Infantry and Battle Armor Units #4572
Conversation
Adjusted the sale value calculation for infantry (and BA) units by using their alternate cost method. This ensures that the sale of infantry is computed correctly and appropriately matches their purchase value.
While I was in |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4572 +/- ##
=========================================
Coverage 10.32% 10.32%
Complexity 5816 5816
=========================================
Files 935 935
Lines 128792 128775 -17
Branches 18951 18948 -3
=========================================
- Hits 13296 13295 -1
+ Misses 114220 114204 -16
Partials 1276 1276 ☔ View full report in Codecov by Sentry. |
Moved the infantry-specific sell value logic to the beginning of the getSellValue() method. This refactoring aims to simplify code flow and ensure that infantry units use an alternative cost calculation without proceeding through the general parts value computation block.
Increased the copyright range from 2021 to 2024 in Unit.java.
return new TargetRoll(0, "unknown location"); | ||
} | ||
return switch (site) { | ||
case SITE_FIELD -> new TargetRoll(2, "in the field"); |
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.
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.
I'll address that in a separate PR, but gimme a couple of minutes and I'll see it done
Adjusted the sale value calculation for infantry (and BA) units by using their alternate cost method. This ensures that the sale of infantry is computed correctly and appropriately matches their purchase value.
Whether this final value is entirely correct is a matter for bigger brains than mine to debate. However, this at least matches the equipment value without factoring in personnel training. As you're selling the equipment, not the personnel.
This change will affect any instance where we use the sale value of an infantry or battle armor unit. Salvage immediately comes to mind, but likewise so does the campaign option to use unit sale value when calculating contract pay.
Closes #1795 & #2552 & #4473