Skip to content

Add pet attack, defence and dodge curves - #170

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

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

Conversation

@erwan-joly

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

Copy link
Copy Markdown
Contributor

Adds IMateStatService/MateStatService: a pet's close, ranged and magic defence, dodge, minimum and maximum damage and hit rate at its own level, before the flat modifiers of its monster entry.

A pet follows the monster curves of its race with its weapon and armour at the pet's level. Each curve's level share grows by one of the entry's three growth factors (MateGrowth):

  • melee: close defence and melee damage
  • ranged: ranged defence, dodge, hit rate and ranged damage
  • magic: magic defence and magic damage

The growth is in tenths per level above the first for dodge, damage and hit rate, and in twentieths for the defences, inside the same floor as the level share. With all three at 0 the stats are those of a monster of that level.

The race curves move to an internal MonsterCurves class shared by both services. MonsterStatService's output is unchanged, and its approval table still passes.

Checked against the published per-level stats of 11 pets (races 0 and 2, all three attack classes, levels 1 to 99): every value matches. MateStatDocumentation asserts a sample and adds an approval table.

New service only, so a minor version: 6.3.0.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added pet combat stat calculations for defence, dodge, damage, and hit rate, with support for melee, ranged, and magic growth.
    • Added a reference table of pet stats across selected levels and growth configurations.
  • Documentation
    • Published example pet stat values to help compare results across growth configurations.

MateStatService gives a pet's defences, dodge, damage and hit rate at its
own level: the monster curves of its race with weapon and armour at the
pet's level, each level share grown by the entry's melee, ranged or magic
growth factor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkUgtue8mHJ8prh9NdK
@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 extracts monster stat curves into MonsterCurves, adds a growth-aware pet stat API, and adds tests and approved tables for selected race 0 levels and growth profiles.

Changes

Monster and pet stat calculations

Layer / File(s) Summary
Extract and reuse monster curves
src/NosCore.Algorithm/MonsterStatService/MonsterCurves.cs, src/NosCore.Algorithm/MonsterStatService/MonsterStatService.cs
MonsterCurves contains race-specific curves and calculations for defence, dodge, damage, and hit rate. MonsterStatService delegates these calculations to MonsterCurves; its critical-stat getters remain unchanged.
Add growth-aware pet stat calculations
src/NosCore.Algorithm/MateStatService/*, test/NosCore.Algorithm.Tests/DocumentationTest.cs, documentation/DocumentationTest.MateStatDocumentation.approved.md
MateGrowth defines melee, ranged, and magic growth factors. MateStatService uses these factors for pet stat calculations. The test checks representative outputs and generates a race 0 table for five growth profiles and eight levels.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

Suggested reviewers: claude

Merge Risk: Minimal · up to da1df

This change adds pet stat calculations and moves the monster curves into a shared class. Existing monster stat results should be unchanged, and no concrete defects were found. It looks ready to merge, subject to the normal test run.

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 pet attack, defence and dodge curves' matches the main change. The PR adds IMateStatService and MateStatService, which calculate a pet's defences, dodge, minimum and maximum damage, and…
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 pet attack, defence and dodge curves' matches the main change. The PR adds IMateStatService and MateStatService, which calculate a pet's defences, dodge, minimum and maximum damage, and hit rate. MonsterCurves holds the shared curve logic, and MonsterStatService delegates to it. The title names the primary change and stays specific.

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 9133d1d and da1df96.

Files selected for processing: 7

  • documentation/DocumentationTest.MateStatDocumentation.approved.md
  • src/NosCore.Algorithm/MateStatService/IMateStatService.cs
  • src/NosCore.Algorithm/MateStatService/MateGrowth.cs
  • src/NosCore.Algorithm/MateStatService/MateStatService.cs
  • src/NosCore.Algorithm/MonsterStatService/MonsterCurves.cs
  • src/NosCore.Algorithm/MonsterStatService/MonsterStatService.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 b4e2bc2 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