BUG: Enchanting design/preparation/application progress not advanced by game tick #235

Closed
opened 2026-05-31 20:25:07 +02:00 by Anexim · 2 comments
Owner

Bug Description

The enchanting system's three-phase workflow (Design → Prepare → Application) is not completed because the game tick doesn't advance the progress of any of the three phases.

Root Cause

In src/lib/game/stores/gameStore.ts, the tick() function handles currentAction checks for meditate, climb, convert, and craft, but there are no handlers for:

  • design (enchantment design progress)
  • prepare (equipment preparation progress)
  • enchant (enchantment application progress)

The setDesignProgress, setPreparationProgress, and setApplicationProgress store actions exist but are never called with updated progress values during ticks.

Impact

  • Enchantment designs never complete
  • Equipment preparation never completes
  • Enchantment application never completes
  • The entire enchanting feature is non-functional for end-to-end gameplay

Files Involved

  • src/lib/game/stores/gameStore.ts — tick() function needs design/prepare/enchant handlers
  • src/lib/game/crafting-design.tscalculateDesignProgress() exists but is never called
  • src/lib/game/crafting-prep.ts — preparation tick logic exists but is never called
  • src/lib/game/crafting-apply.tscalculateApplicationTick() exists but is never called

Suggested Fix

Add tick handlers in gameStore.ts similar to the existing craft handler:

if (ctx.combat.currentAction === 'design') {
  // Advance design progress using CraftingDesign.calculateDesignProgress()
  // When complete, call saveDesign and set currentAction to 'meditate'
}
if (ctx.combat.currentAction === 'prepare') {
  // Advance preparation progress
  // When complete, tag equipment as 'Ready for Enchantment'
}
if (ctx.combat.currentAction === 'enchant') {
  // Advance application progress using ApplicationActions.calculateApplicationTick()
  // When complete, apply enchantments to equipment
}
## Bug Description The enchanting system's three-phase workflow (Design → Prepare → Application) is not completed because the game tick doesn't advance the progress of any of the three phases. ## Root Cause In `src/lib/game/stores/gameStore.ts`, the `tick()` function handles `currentAction` checks for `meditate`, `climb`, `convert`, and `craft`, but there are no handlers for: - `design` (enchantment design progress) - `prepare` (equipment preparation progress) - `enchant` (enchantment application progress) The `setDesignProgress`, `setPreparationProgress`, and `setApplicationProgress` store actions exist but are never called with updated progress values during ticks. ## Impact - Enchantment designs never complete - Equipment preparation never completes - Enchantment application never completes - The entire enchanting feature is non-functional for end-to-end gameplay ## Files Involved - `src/lib/game/stores/gameStore.ts` — tick() function needs design/prepare/enchant handlers - `src/lib/game/crafting-design.ts` — `calculateDesignProgress()` exists but is never called - `src/lib/game/crafting-prep.ts` — preparation tick logic exists but is never called - `src/lib/game/crafting-apply.ts` — `calculateApplicationTick()` exists but is never called ## Suggested Fix Add tick handlers in `gameStore.ts` similar to the existing `craft` handler: ```typescript if (ctx.combat.currentAction === 'design') { // Advance design progress using CraftingDesign.calculateDesignProgress() // When complete, call saveDesign and set currentAction to 'meditate' } if (ctx.combat.currentAction === 'prepare') { // Advance preparation progress // When complete, tag equipment as 'Ready for Enchantment' } if (ctx.combat.currentAction === 'enchant') { // Advance application progress using ApplicationActions.calculateApplicationTick() // When complete, apply enchantments to equipment } ```
Anexim added the ai:todo label 2026-05-31 20:25:07 +02:00
n8n-gitea was assigned by Anexim 2026-05-31 20:25:07 +02:00
Author
Owner

Playwright Testing Progress Summary

Confirmed Bug #1: Climb the Spire causes React #185 infinite loop

  • Clicking "Climb the Spire" button immediately crashes with "Minified React error #185" (Maximum update depth exceeded).
  • Also crashes when clicking "Enter Spire Mode" in the Debug panel.
  • Root cause: likely an infinite re-render loop in the combat/spire tick logic.

Confirmed Bug #2: Raw mana exceeds max cap

  • Debug panel shows Current: 111.85941260450063 / 100 — raw mana is 11.8% over its cap.
  • The mana pool is not being clamped to maxMana.

Confirmed Bug #3: Spire tab shows inconsistent state after reset

  • Shows "Max Floor Reached: 1" but "Floors Cleared: 0" simultaneously.
  • Guardian at floor 10 shows "Armor: 10%" followed by stray "000" text — a rendering/formatting bug.

Confirmed Bug #4 (from issue): Enchanting design/prepare/apply tick handlers missing

  • The 3-phase enchanting workflow cannot progress because tick() has no handlers for design/prepare/enchant actions.

Finding #5: Enchantment Designer EffectSelector not rendering

  • After selecting Basic Staff in Design mode, the EffectSelector component is not visible in the accessibility tree. The DesignForm shows but no effects list appears. This blocks the entire enchanting workflow.

Ongoing investigation of remaining tabs (Prepare, Apply, Golemancy, Achievements, Stats).

## Playwright Testing Progress Summary ### Confirmed Bug #1: Climb the Spire causes React #185 infinite loop - Clicking "Climb the Spire" button immediately crashes with "Minified React error #185" (Maximum update depth exceeded). - Also crashes when clicking "Enter Spire Mode" in the Debug panel. - Root cause: likely an infinite re-render loop in the combat/spire tick logic. ### Confirmed Bug #2: Raw mana exceeds max cap - Debug panel shows `Current: 111.85941260450063 / 100` — raw mana is 11.8% over its cap. - The mana pool is not being clamped to maxMana. ### Confirmed Bug #3: Spire tab shows inconsistent state after reset - Shows "Max Floor Reached: 1" but "Floors Cleared: 0" simultaneously. - Guardian at floor 10 shows `"Armor: 10%"` followed by stray `"000"` text — a rendering/formatting bug. ### Confirmed Bug #4 (from issue): Enchanting design/prepare/apply tick handlers missing - The 3-phase enchanting workflow cannot progress because tick() has no handlers for design/prepare/enchant actions. ### Finding #5: Enchantment Designer EffectSelector not rendering - After selecting Basic Staff in Design mode, the EffectSelector component is not visible in the accessibility tree. The DesignForm shows but no effects list appears. This blocks the entire enchanting workflow. Ongoing investigation of remaining tabs (Prepare, Apply, Golemancy, Achievements, Stats).
Anexim added this to the (deleted) project 2026-06-01 11:45:48 +02:00
Author
Owner

Fixed. Added enchanting design/prepare/apply tick handlers extracted to pipelines/enchanting-tick.ts. Also fixed startApplying to set currentAction: 'enchant' (was missing). All three calculation functions (calculateDesignProgress, calculatePreparationTick, calculateApplicationTick) and completion helpers (createCompletedDesignFromProgress, completePreparation, applyEnchantments) already existed but were never called from the tick loop.

Fixed. Added enchanting design/prepare/apply tick handlers extracted to `pipelines/enchanting-tick.ts`. Also fixed `startApplying` to set `currentAction: 'enchant'` (was missing). All three calculation functions (`calculateDesignProgress`, `calculatePreparationTick`, `calculateApplicationTick`) and completion helpers (`createCompletedDesignFromProgress`, `completePreparation`, `applyEnchantments`) already existed but were never called from the tick loop.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#235