Skip to content

Add the HP and MP recovery rates - #174

Merged
erwan-joly merged 1 commit into
masterfrom
claude/project-thread-vgcp5g
Nov 12, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
claude/project-thread-vgcp5g

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Adds IRecoveryRateService, which owns how many HP and MP points a character recovers on each regeneration tick:

  • Resting: a rate per class for sitting.
  • Standing: derived from the resting rate. It is one half up to level 20, then 40%, 30% and 20% in level bands. The multiply comes before the divide, so the band survives integer truncation.

NosCore currently keeps both tables inside its regeneration service. This moves them to where level-scaled numbers belong.

The approved RecoveryRateDocumentation table lists every class at levels 1 to 99. It reproduces the measured standing values NosCore's tests already pin, for example:

  • Martial Artist HP: 35 at level 20, 28 at 21, 21 at 50, 14 at 70.
  • Swordsman HP: 32 at level 40, 24 at 60, 16 at 61.
  • Mage HP: 9 at level 50.

This is a new service only, so it's a minor release.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added class-specific resting HP and MP recovery rates for Adventurer, Swordsman, Archer, Mage, and Martial Artist.
    • Standing recovery rates now vary by character level, with distinct rates across four level ranges.
  • Documentation
    • Added a reference table covering resting and standing HP and MP recovery rates for levels 1–99.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkTnTjQfc83H72tpiYm
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a recovery-rate service with resting HP and MP rates for five character classes. It calculates standing rates using level-based percentages and adds an approval test with tables covering levels 1–99.

Changes

Recovery Rate Service

Layer / File(s) Summary
Recovery rate contract and calculation
src/NosCore.Algorithm/RecoveryRateService/IRecoveryRateService.cs, src/NosCore.Algorithm/RecoveryRateService/RecoveryRateService.cs
The interface defines resting HP and MP rate lookups and standing-rate calculation. The implementation sets rates for five classes and applies 50%, 40%, 30%, or 20% based on character level.
Recovery rate documentation and approval test
test/NosCore.Algorithm.Tests/DocumentationTest.cs, documentation/DocumentationTest.RecoveryRateDocumentation.approved.md
The test generates tables for each class, including resting and standing HP and MP rates for levels 1–99. The approved document records the generated tables.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: claude

Merge Risk: Minimal · up to 3ecca

This adds a new recovery-rate service without changing existing behavior. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add the HP and MP recovery rates" matches the main change. The PR adds IRecoveryRateService and RecoveryRateService, which provide resting and standing HP/MP recovery rates by class and lev…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Add the HP and MP recovery rates" matches the main change. The PR adds IRecoveryRateService and RecoveryRateService, which provide resting and standing HP/MP recovery rates by class and level. The title is specific and concise. It does not describe the approved documentation table, but that is secondary to the main change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cab3ff5 and 3ecca9a.

Files selected for processing: 4

  • documentation/DocumentationTest.RecoveryRateDocumentation.approved.md
  • src/NosCore.Algorithm/RecoveryRateService/IRecoveryRateService.cs
  • src/NosCore.Algorithm/RecoveryRateService/RecoveryRateService.cs
  • test/NosCore.Algorithm.Tests/DocumentationTest.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@erwan-joly
erwan-joly merged commit 8667ab9 into master Nov 12, 2026
3 checks passed
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