Repository navigation
fix: name infused gems after their rolled stat - #45
Conversation
The drawn rarity still sets the stat's range and the d20 still picks the stat, but the name now comes from how that stat ranks among every result the gem could roll. Each rarity's name goes to the same share of results as its draw chance, so a Flawless epic can no longer beat a weaker "Legendary". The cutoffs are worked out at d20.infusion.name-reference-modifier (default 0) and logged per gem on every config load. The broadcast, the stored gem_rarity tag and the goldsmithing boost chance all follow the name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Results that tie on one stat can't be split between two names. When a tie would push a rarer name past its chance, the whole tie now gets the lower name, so Legendary (and Legendary plus Epic, and so on) never go over their chances. A rarity whose best tie alone is too big is never named, and the load log says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Problem
An infused gem is named after its drawn rarity, but the Intelligence d20 then rolls its stat across a spread that reaches 20% past that rarity's band. The bands overlap, so a Flawless Epic Agate (0.60 max health) beat a fumbled Legendary one (0.40).
Change
The rolls stay the same: the rarity draw (65/25/7/3), the d20 + Intelligence and the spread all work as before, so every gem gets the same stat it would today. Only the name is picked afterwards:
GemNameCutoffslists every result a gem can roll (each drawable rarity × each die face) and gives each rarity's name to the same share of results as its draw chance, best results first. A better name therefore never means a weaker gem.d20.infusion.name-reference-modifier(default 0, i.e. Intelligence 10–11). Players above it get better names more often, because their gems really are better.buildInfusedGemnames the gem, writesgem_rarityand builds the lore from that rarity. The broadcast reads the rarity from the built gem, so it announces the name the gem actually has.Gem 'agate' names: legendary from 0.5558, epic from 0.4526, rare from 0.3347, common below.config.yml).Effects to know about
jewelry-gem-stat-boostchances key offgem_rarity, so they now follow the name too. A fumbled Legendary named Rare gets Rare's 15%.d20:section, so it uses the default reference modifier 0. No config change is needed there.Testing
mvn clean verify: all tests pass locally. The only coverage gaps areInfusionStationStoreandGoldsmithStationStore, whose POSIX-permission tests can't run on Windows; they're excluded locally and run on Linux CI.GemNameCutoffsTest:GemOutputTestchecks a built gem is named by its stat, andInfusionEventsTestthat the broadcast follows that name.~/gem-name-test/test.js): real infusions of 10 Agates at an enchanting table in three rounds, forced natural 20, forced natural 1 and real rolls, 55/55 checks passed:gem_raritymatched its stat's cutoff;🤖 Generated with Claude Code