[Medium] [Bug] Spire Climbing: Seed calculation missing runId component #299
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec: docs/specs/spire-climbing-spec.md §4.2, §7
Severity: Medium
Problem: The spec says
seed = floor × 12345 + runIdbut the code only usesfloor × 12345everywhere:src/lib/game/stores/combat-descent-actions.ts:228—enterSpireModeseedsrc/lib/game/stores/combat-descent-actions.ts:68,80—advanceRoomOrFloordescending seedsrc/lib/game/utils/spire-utils.ts:90,96,99,131— room type and puzzle seedsThis means room layouts and types are identical every run for the same floor, reducing variety.
Files: Multiple files listed above
Fix applied and pushed. Seed calculation now includes runId component per spec (
seed = floor × 12345 + runId).Root cause: The spec defines the seed as
floor × 12345 + runIdbut the code only usedfloor × 12345everywhere, meaning room layouts were identical every run for the same floor.Changes:
runId: numberfield toCombatStaterunIdon spire entry increateEnterSpireMode()getRoomsForFloor,generateSpireRoomType,generateSpireFloorStateto accept and userunIdcombat-descent-actions.tsandcombatStore.tsrunIdtopartializefor persistenceTests: 1069 passed (58 files), all pre-commit checks pass.