From a11ea065eb20da3bb3ed87c0fed67a40afcb11fb Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Sun, 7 Jun 2026 23:06:03 +0200 Subject: [PATCH] fix: mana conversion attunement rate now uses flat base + linear multiplier per spec --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/components/game/tabs/StatsTab/ElementStatsSection.tsx | 4 ++-- src/lib/game/__tests__/bug-fixes.test.ts | 7 ++++--- src/lib/game/data/attunements.ts | 5 +++-- src/lib/game/stores/gameStore.ts | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index caca774..0fa1f05 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,4 +1,4 @@ # Circular Dependencies -Generated: 2026-06-07T14:14:38.464Z +Generated: 2026-06-07T16:09:18.340Z No circular dependencies found. ✅ diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 289fbae..b56b0a7 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-07T14:14:36.561Z", + "generated": "2026-06-07T16:09:16.437Z", "description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.", "usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry." }, diff --git a/src/components/game/tabs/StatsTab/ElementStatsSection.tsx b/src/components/game/tabs/StatsTab/ElementStatsSection.tsx index 3596fc6..e715b52 100644 --- a/src/components/game/tabs/StatsTab/ElementStatsSection.tsx +++ b/src/components/game/tabs/StatsTab/ElementStatsSection.tsx @@ -9,7 +9,7 @@ import { usePrestigeStore, useManaStore, useAttunementStore, useDisciplineStore, import { computeDisciplineEffects } from '@/lib/game/effects/discipline-effects'; import { computeConversionRates } from '@/lib/game/utils/conversion-rates'; import { getGuardianForFloor } from '@/lib/game/data/guardian-encounters'; -import { ATTUNEMENTS_DEF, getAttunementConversionRate } from '@/lib/game/data/attunements'; +import { ATTUNEMENTS_DEF } from '@/lib/game/data/attunements'; import { useMemo } from 'react'; import type { ElementState } from '@/lib/game/types'; @@ -38,7 +38,7 @@ export function ElementStatsSection({ elemMax }: ElementStatsSectionProps) { const def = ATTUNEMENTS_DEF[id]; if (def?.primaryManaType) { grossRegen[def.primaryManaType] = (grossRegen[def.primaryManaType] || 0) - + getAttunementConversionRate(id, state.level || 1); + + (def.conversionRate || 0); } } const invokerLevel = attunements.invoker?.active ? (attunements.invoker.level || 1) : 0; diff --git a/src/lib/game/__tests__/bug-fixes.test.ts b/src/lib/game/__tests__/bug-fixes.test.ts index 8a180fc..b2988a5 100644 --- a/src/lib/game/__tests__/bug-fixes.test.ts +++ b/src/lib/game/__tests__/bug-fixes.test.ts @@ -66,13 +66,14 @@ describe('Attunement Mana Type Unlocking', () => { const enchanter = ATTUNEMENTS_DEF['enchanter']; expect(enchanter.conversionRate).toBeGreaterThan(0); - // Get scaled conversion rate at level 1 + // Base conversion rate is flat (not scaled by level) + // Level scaling is applied as a multiplier in computeConversionRates(), not here const level1Rate = getAttunementConversionRate('enchanter', 1); expect(level1Rate).toBe(enchanter.conversionRate); - // Higher level should have higher rate + // Flat rate: same at all levels (level multiplier applied separately) const level5Rate = getAttunementConversionRate('enchanter', 5); - expect(level5Rate).toBeGreaterThan(level1Rate); + expect(level5Rate).toBe(level1Rate); }); it('should have raw mana regen for all attunements', () => { diff --git a/src/lib/game/data/attunements.ts b/src/lib/game/data/attunements.ts index e05d086..171b3c7 100755 --- a/src/lib/game/data/attunements.ts +++ b/src/lib/game/data/attunements.ts @@ -99,12 +99,13 @@ export function getTotalAttunementRegen(attunements: Record