From c61a9f88bf669eb2011ecd987f6e7423111cf797 Mon Sep 17 00:00:00 2001 From: n8n-gitea Date: Mon, 8 Jun 2026 15:03:08 +0200 Subject: [PATCH] fix: three bug fixes - library XP scaling, prep time floor, dual design slot logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #297: Library room XP now uses 25× rate without undocumented floor multiplier Fixes #305: Prep time mana-per-tick now applies Math.floor(capacity/50) per spec Fixes #304: Dual design slot correctly returns false when first slot is empty --- docs/circular-deps.txt | 2 +- docs/dependency-graph.json | 2 +- src/lib/game/crafting-design.ts | 3 +-- src/lib/game/stores/non-combat-room-actions.ts | 2 +- src/lib/game/stores/pipelines/enchanting-tick.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/circular-deps.txt b/docs/circular-deps.txt index 722645a..21dd798 100644 --- a/docs/circular-deps.txt +++ b/docs/circular-deps.txt @@ -1,5 +1,5 @@ # Circular Dependencies -Generated: 2026-06-08T12:54:52.991Z +Generated: 2026-06-08T12:59:39.710Z Found: 1 circular chain(s) — these MUST be fixed before modifying involved files. 1. 1) stores/golem-combat-actions.ts > stores/golem-combat-helpers.ts diff --git a/docs/dependency-graph.json b/docs/dependency-graph.json index 7c305ee..551c03d 100644 --- a/docs/dependency-graph.json +++ b/docs/dependency-graph.json @@ -1,6 +1,6 @@ { "_meta": { - "generated": "2026-06-08T12:54:50.978Z", + "generated": "2026-06-08T12:59:37.733Z", "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/lib/game/crafting-design.ts b/src/lib/game/crafting-design.ts index e96d5cb..51267d5 100644 --- a/src/lib/game/crafting-design.ts +++ b/src/lib/game/crafting-design.ts @@ -143,8 +143,7 @@ export function isSecondDesignSlotAvailable( designProgress2: DesignProgress | null, hasEnchantMastery: boolean ): boolean { - if (!designProgress && !designProgress2) return true; - if (!designProgress && designProgress2) return false; + if (!designProgress) return false; return !!(designProgress && !designProgress2 && hasEnchantMastery); } diff --git a/src/lib/game/stores/non-combat-room-actions.ts b/src/lib/game/stores/non-combat-room-actions.ts index 1b72007..ceab270 100644 --- a/src/lib/game/stores/non-combat-room-actions.ts +++ b/src/lib/game/stores/non-combat-room-actions.ts @@ -127,7 +127,7 @@ function tickLibraryRoom(get: GetFn, set: SetFn, hours: number, advance: Advance const required = room.libraryRequired || 1; const BASE_LIBRARY_XP_PER_HOUR = 50; - const xpGrant = Math.floor(BASE_LIBRARY_XP_PER_HOUR * (1 + s.currentFloor / 10) * 25 * hours); + const xpGrant = Math.floor(BASE_LIBRARY_XP_PER_HOUR * 25 * hours); if (xpGrant > 0) { const disciplineStore = useDisciplineStore.getState(); diff --git a/src/lib/game/stores/pipelines/enchanting-tick.ts b/src/lib/game/stores/pipelines/enchanting-tick.ts index 14d72be..51348e6 100644 --- a/src/lib/game/stores/pipelines/enchanting-tick.ts +++ b/src/lib/game/stores/pipelines/enchanting-tick.ts @@ -84,7 +84,7 @@ export function processEnchantingTicks( writes.combat = { ...(writes.combat || {}), currentAction: 'meditate' }; addLog('Preparation failed: equipment not found.'); } else { - const manaPerTick = (instance.totalCapacity * 10) / (2 + instance.totalCapacity / 50) * HOURS_PER_TICK; + const manaPerTick = (instance.totalCapacity * 10) / (2 + Math.floor(instance.totalCapacity / 50)) * HOURS_PER_TICK; const prepResult = calculatePreparationTick( prepProgress.progress, prepProgress.required,