Skip to content

Add group share, level penalty, rarity point, specialist point and dignity price formulas - #153

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

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

Conversation

@erwan-joly

Copy link
Copy Markdown
Contributor

Requested by Erwan · project thread

Closes #18
Closes #23
Closes #24
Closes #27
Closes #43

What changed

Each new formula is a service with an interface, and each has an approval table in documentation/.

Service Issue What it gives
ExperienceShareService #18 Each member's share of a group kill: 100% / 57.5% / 43.33% of the XP and 100% / 62.5% / 50% of the job XP for 1, 2 or 3 members. Every extra member adds 15% XP and 25% job XP, and the total is split evenly. Groups are capped at Constants.MaxGroupSize (3).
LevelPenaltyService #27 Multipliers on XP and on the chance of a gold drop when the player is above the monster. XP: 0.9 / 0.7 / 0.5 / 0.3 at 6–9 levels above, then 0.1. Gold: 0.9 / 0.7 / 0.5 / 0.3 / 0.2 at 5–9 levels above, 0.1 up to 18, 0.05 up to 29, then 0.
RarityPointService #24 The points an item's rarity adds: a base per rarity (0–5 as is, 7, 10, 15 for r6–r8, otherwise twice the rarity) times level / 5 + 1.
SpecialistPointService #23 A card's skill points: 3 per level above 20, plus the upgrade bonus up to 173 at +15, so 410 at level 99 +15. Also the attack, defence, element and HP/MP levels those points buy.
DignityService.GetShopPriceMultiplier #43 NPC shop price by dignity: ×1.1 Dreadful, ×1.2 Unqualified, ×1.5 Useless and Failed.

Decisions worth checking

  • Specialist stat bands are stored as (up to, cost per level), and each band's starting level is derived from the band before it. One defence band (361–400) is sometimes listed as starting at level 97 rather than 94. With 97, 400 points would buy defence 102 while 410 buys 100. I used 94 and wrote the doubt in a code comment. A test now checks that every stat level only ever goes up.
  • The gold penalty is 0 at exactly 30 levels above. A 30-level gap was otherwise left at ×1.
  • Points beyond 410 stay at the last level, which is 100 for every stat, instead of falling back to 0.

Wiring

NosCore currently hard-codes the dignity price table in two places (ShoppingPacketHandler and CharacterEntityExtension). Once this is tagged I'll switch those to GetShopPriceMultiplier in a NosCore PR, along with the other services where NosCore already has the behaviour.

Tests

dotnet test test/NosCore.Algorithm.Tests: 27 passed.


Generated by Claude Code

…t point services

- ExperienceShareService: each member's share of a group kill.
- LevelPenaltyService: experience and gold multipliers for monsters below the
  player's level.
- RarityPointService: stat points an equipment's rarity adds.
- SpecialistPointService: a card's skill points and the stat level they buy.
- DignityService.GetShopPriceMultiplier: NPC shop prices by dignity.

Each has an approval table under documentation/.

Closes #18
Closes #23
Closes #24
Closes #27
Closes #43

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkW4H42dDTduM5qrKt2
@erwan-joly erwan-joly self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 19fc08a and 4474ad3.

Files selected for processing: 17
  • documentation/DocumentationTest.DignityShopPriceDocumentation.approved.md
  • documentation/DocumentationTest.ExperienceShareDocumentation.approved.md
  • documentation/DocumentationTest.LevelPenaltyDocumentation.approved.md
  • documentation/DocumentationTest.RarityPointDocumentation.approved.md
  • documentation/DocumentationTest.SpecialistPointDocumentation.approved.md
  • src/NosCore.Algorithm/Constants.cs
  • src/NosCore.Algorithm/DignityService/DignityService.cs
  • src/NosCore.Algorithm/DignityService/IDignityService.cs
  • src/NosCore.Algorithm/ExperienceShareService/ExperienceShareService.cs
  • src/NosCore.Algorithm/ExperienceShareService/IExperienceShareService.cs
  • src/NosCore.Algorithm/LevelPenaltyService/ILevelPenaltyService.cs
  • src/NosCore.Algorithm/LevelPenaltyService/LevelPenaltyService.cs
  • src/NosCore.Algorithm/RarityPointService/IRarityPointService.cs
  • src/NosCore.Algorithm/RarityPointService/RarityPointService.cs
  • src/NosCore.Algorithm/SpecialistPointService/ISpecialistPointService.cs
  • src/NosCore.Algorithm/SpecialistPointService/SpecialistPointService.cs
  • test/NosCore.Algorithm.Tests/DocumentationTest.cs
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@erwan-joly
erwan-joly merged commit 6386b7c into master Nov 3, 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.

add dignity malus Add gold and experience penalty Add rarity points Add SpPoints Add SharedExperience

2 participants