[Medium] [Bug] Spire Climbing: Library room XP scaling includes undocumented floor multiplier #297

Closed
opened 2026-06-07 17:41:00 +02:00 by Anexim · 2 comments
Owner

Spec: docs/specs/spire-climbing-spec.md §4.10
Severity: Medium

Problem: src/lib/game/stores/non-combat-room-actions.ts:130 computes XP as:

const xpGrant = Math.floor(BASE_LIBRARY_XP_PER_HOUR * (1 + s.currentFloor / 10) * 25 * hours);

The spec says "25× the normal rate" but the code adds a (1 + floor/10) scaling factor not in the spec. Also, BASE_LIBRARY_XP_PER_HOUR = 50 is a magic number not mentioned in the spec.

File: src/lib/game/stores/non-combat-room-actions.ts:130

**Spec:** docs/specs/spire-climbing-spec.md §4.10 **Severity:** Medium **Problem:** `src/lib/game/stores/non-combat-room-actions.ts:130` computes XP as: ``` const xpGrant = Math.floor(BASE_LIBRARY_XP_PER_HOUR * (1 + s.currentFloor / 10) * 25 * hours); ``` The spec says "25× the normal rate" but the code adds a `(1 + floor/10)` scaling factor not in the spec. Also, `BASE_LIBRARY_XP_PER_HOUR = 50` is a magic number not mentioned in the spec. **File:** `src/lib/game/stores/non-combat-room-actions.ts:130`
Anexim added the ai:todo label 2026-06-07 17:41:00 +02:00
n8n-gitea was assigned by Anexim 2026-06-07 17:41:00 +02:00
Anexim added ai:in-progress and removed ai:todo labels 2026-06-08 15:01:55 +02:00
Author
Owner

Starting work on library room XP scaling fix. Removing undocumented floor multiplier.

Starting work on library room XP scaling fix. Removing undocumented floor multiplier.
Anexim added ai:done and removed ai:in-progress labels 2026-06-08 15:04:17 +02:00
Author
Owner

Fix applied and pushed. Removed undocumented floor multiplier from library room XP calculation.

Root cause: Code used BASE_LIBRARY_XP_PER_HOUR * (1 + floor/10) * 25 but spec says "25× the normal rate" with no floor multiplier.

Fix: Changed to BASE_LIBRARY_XP_PER_HOUR * 25 * hours to match spec §4.10.

Tests: 1069 passed (58 files).

**Fix applied and pushed.** Removed undocumented floor multiplier from library room XP calculation. **Root cause:** Code used `BASE_LIBRARY_XP_PER_HOUR * (1 + floor/10) * 25` but spec says "25× the normal rate" with no floor multiplier. **Fix:** Changed to `BASE_LIBRARY_XP_PER_HOUR * 25 * hours` to match spec §4.10. **Tests:** 1069 passed (58 files).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#297