Skip to content

fix: remove unfounded MAX_BONUS clamp from calcBaseStats - #44

Merged
gander merged 1 commit into
masterfrom
fix/remove-max-bonus-clamp
Nov 2, 2026
Merged

gander merged 1 commit into
masterfrom
fix/remove-max-bonus-clamp

Conversation

@gander

@gander gander commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

calcBaseStats clamped trait bonuses to MAX_BONUS = 60. No source supports that cap:

  • The "over 60 potential points" on the NMS Wiki – Frigate page refers to total rank-up growth (10 rank-ups × 6 points), not to trait bonuses.
  • Trait bonuses to the four main stats top out at about 39 (specialist +15 and four traits of at most +6 each), so the clamp could never apply to real data.

Changes

  • Remove the clamp: calcBaseStats now returns mainStats - (bonusStats + 6 * rank_ups), which is exactly the wiki formula.
  • Remove the exported MAX_BONUS constant. This is technically a breaking change to the public API, but no known consumer uses it.
  • Add a test that bonuses are not clamped.

Testing

  • vitest --run: 8 files, 274 tests passing
  • biome check: clean

The 60-point cap on trait bonuses has no basis in the game mechanics.
The 60 points on the wiki refer to total rank-up growth (10 x 6), while
trait bonuses to the four main stats top out around 39. Drop the clamp
and the exported MAX_BONUS constant, and cover the unclamped behaviour
with a test.
@gander gander self-assigned this Nov 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@gander
gander marked this pull request as ready for review November 2, 2026 00:11
@gander
gander merged commit fef4d54 into master Nov 2, 2026
10 checks passed
@gander
gander deleted the fix/remove-max-bonus-clamp branch November 2, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants