fix: Enemy healthRegen field is set but never consumed by combat logic #35
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?
Severity: Major
File:
src/lib/game/utils/room-utils.ts(lines 108, 139, 162, 195)Problem: Enemies are created with
healthRegenvalues (e.g., guardians get0.01, swarm/speed/combat enemies getgetEnemyHealthRegen(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
healthRegenfield 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.Fixed: Removed dead healthRegen field from EnemyState type and all enemy generation in room-utils.ts. Also removed the unused getEnemyHealthRegen function.