feat: implement per-enemy damage application (spec §3.2)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m6s

- Add applyDamageToRoom() function targeting individual enemies
- Add lowestHPEnemy() helper for focus-fire targeting
- AoE spells distribute damage across all enemies
- Single-target attacks hit lowest HP enemy first
- Refactor processCombatTick spell/equipment/melee/DoT damage to use per-enemy system
- Update golemApplyDamageToRoom in golem-combat pipeline for per-enemy targeting
- Add currentRoom to CombatTickResult and sync through gameStore
- Update combat-actions tests with proper enemy setup for per-enemy tests
- Extract combat-damage.ts module to stay under 400-line limit
This commit is contained in:
2026-06-04 11:37:21 +02:00
parent 8dde423526
commit 23e629f37e
10 changed files with 182 additions and 85 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# Circular Dependencies
Generated: 2026-06-03T13:40:52.900Z
Generated: 2026-06-04T09:16:19.999Z
No circular dependencies found. ✅
+15 -1
View File
@@ -1,6 +1,6 @@
{
"_meta": {
"generated": "2026-06-03T13:40:50.953Z",
"generated": "2026-06-04T09:16:18.073Z",
"description": "Import dependency graph for src/lib/game. Keys are files, values are arrays of files they import.",
"usage": "To find what a file affects, search for its path in the VALUES. To find what a file depends on, look at its KEY entry."
},
@@ -18,6 +18,7 @@
"constants/prestige.ts",
"constants/rooms.ts",
"constants/spells.ts",
"data/equipment/equipment-types-data.ts",
"types/game.ts"
],
"constants/prestige.ts": [
@@ -532,11 +533,17 @@
"constants.ts",
"data/guardian-encounters.ts",
"effects/discipline-effects.ts",
"stores/combat-damage.ts",
"stores/combat-state.types.ts",
"stores/dot-runtime.ts",
"stores/golem-combat-actions.ts",
"types.ts",
"utils/index.ts"
],
"stores/combat-damage.ts": [
"stores/combat-state.types.ts",
"types.ts"
],
"stores/combat-descent-actions.ts": [
"data/guardian-encounters.ts",
"stores/combat-state.types.ts",
@@ -623,6 +630,12 @@
"utils/discipline-math.ts",
"utils/safe-persist.ts"
],
"stores/dot-runtime.ts": [
"constants.ts",
"stores/combat-state.types.ts",
"types.ts",
"types/spells.ts"
],
"stores/gameActions.ts": [
"effects/discipline-effects.ts",
"stores/attunementStore.ts",
@@ -737,6 +750,7 @@
"stores/uiStore.ts"
],
"stores/pipelines/golem-combat.ts": [
"stores/combat-damage.ts",
"stores/combatStore.ts",
"stores/golem-combat-actions.ts",
"stores/manaStore.ts",
+1
View File
@@ -354,6 +354,7 @@ Mana-Loop/
│ │ │ │ │ └── pact-ritual.ts
│ │ │ │ ├── attunementStore.ts
│ │ │ │ ├── combat-actions.ts
│ │ │ │ ├── combat-damage.ts
│ │ │ │ ├── combat-descent-actions.ts
│ │ │ │ ├── combat-state.types.ts
│ │ │ │ ├── combatStore.ts