fix: Enemy healthRegen field is set but never consumed by combat logic #35

Closed
opened 2026-05-18 15:59:26 +02:00 by Anexim · 1 comment
Owner

Severity: Major

File: src/lib/game/utils/room-utils.ts (lines 108, 139, 162, 195)

Problem: Enemies are created with healthRegen values (e.g., guardians get 0.01, swarm/speed/combat enemies get getEnemyHealthRegen(floor, element)). However, there is no code in the combat tick processor or anywhere else that actually applies this regen to enemy HP during combat.

Impact: The healthRegen field is dead data — it has no effect on gameplay. Enemies never regenerate health, making the stat misleading for future developers.

Fix: Either implement the regen logic in the combat tick processor (e.g., floorHP = Math.min(floorMaxHP, floorHP + enemy.healthRegen)), or remove the field entirely to avoid confusion.

**Severity:** Major **File:** `src/lib/game/utils/room-utils.ts` (lines 108, 139, 162, 195) **Problem:** Enemies are created with `healthRegen` values (e.g., guardians get `0.01`, swarm/speed/combat enemies get `getEnemyHealthRegen(floor, element)`). However, there is no code in the combat tick processor or anywhere else that actually applies this regen to enemy HP during combat. **Impact:** The `healthRegen` field is dead data — it has no effect on gameplay. Enemies never regenerate health, making the stat misleading for future developers. **Fix:** Either implement the regen logic in the combat tick processor (e.g., `floorHP = Math.min(floorMaxHP, floorHP + enemy.healthRegen)`), or remove the field entirely to avoid confusion.
Anexim added the ai:todo label 2026-05-18 15:59:26 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 15:59:26 +02:00
Author
Owner

Fixed: Removed dead healthRegen field from EnemyState type and all enemy generation in room-utils.ts. Also removed the unused getEnemyHealthRegen function.

Fixed: Removed dead healthRegen field from EnemyState type and all enemy generation in room-utils.ts. Also removed the unused getEnemyHealthRegen function.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#35