Dev notes ·

Phase 1, Step 14a: enemies that fight back

Step 14 (Zone A + data-driven enemies + spawner) split into three parts: 14a enemies + spawner + player death (this), 14b the Zone A layout blockout from act-1-zones.md, 14c shrines / waypoint + rest / guaranteed first Blessed / elites / the First Furrow miniboss.

Done (compiled cleanly 15:28 except the last test file; waiting on the user to play)
  • Enemies/EnemyDefinition.cs (SO, Create → Embers → Enemies): id, name key, category (Unprocessed / Unattended / Beast), StatProfile, loot table, XP, move speed, aggro and leash radius, attack (range, interval, wind-up tell, coefficient, damage type), drift after attack, frontal shield block + arc, model prefab (art) or grey-box shape/colour/ scale/hover.
  • Enemies/EnemyBrain.cs: the reusable AI (act-1-enemies "Melee Chaser" + Swarm drift): Idle → Chase on the NavMesh → Wind-up (body tints gold: the tell) → Strike through Health.ApplyDamage (stepping out of reach during the tell = miss) → Recover, or Drift away and come back (Keres). Past its leash it walks home and heals to full. A stun freezes it and cancels the wind-up. Getting hit while idle makes it chase.
  • Enemies/EnemyFactory.cs: builds an enemy from a definition (inactive while configuring, so every Awake sees finished data): body (model, else grey-box primitive with its own tinted material; a brown shield board for shield-bearers), stats, health, targetable, status, hit flash, shield, NavMeshAgent, loot, XP, brain.
  • Enemies/EnemySpawner.cs: weighted definitions around a point; count × party size (SpawnDensity, pure; Core/GameSession.PartySize = 1 now: "co-op is a number later"); open ground repopulates (30 s, never within 20 m of the player), landmark spawners don't (act-1-enemies "Respawn"). Gizmo: orange = repopulates, red = stays cleared.
  • Enemies/NavMeshBootstrap.cs: bakes the NavMesh from physics colliders in Awake (grey-box scenes change too often to keep a baked asset in step).
  • Shield block (Combat/ShieldBlock.cs + new IIncomingDamageModifier hook inside Health.ApplyDamage, still the one pipeline): Skeletal Hoplites block 50% of frontal hits (100° arc); side/back hits land in full and a stunned Hoplite can't block, so flanking and Shield Bash pay off (the design's "rewards positioning").
  • Player can die now: Combat/PlayerAnchor.cs (enemies find the player without a scene search), Player/PlayerDeath.cs (controls off, "You fell. Rising again in N s" banner, respawn at the start point with full health after 4 s), Combat/HurtFeedback.cs (shake + thud scaled by the share of health lost). Valor already gains when struck (Step 11). Health.Revived event; CharacterAnimator rebinds on revive.
  • The first two Act 1 enemies as data (Editor/EnemyDataBuilder.cs, menu Embers → Enemies → Create Act 1 Enemies): Keres (30 HP, 6 Umbral, fast 5.5 m/s, 0.3 s tell, drifts 3.5 m after each strike, small violet floating sphere, 12 XP) and Skeletal Hoplite (70 HP, 9 Physical, 30 armour, 3.2 m/s, 0.5 s tell, 50% frontal block, bone-white capsule + shield, 25 XP). Both +25% Umbral / −25% Divine (Unprocessed). New trash loot table LT_Act1_Trash (40% drop, 70/25/5 Mortal/Blessed/Heroic, act-1-items §6 intent).
  • Scene builder: runtime NavMesh, three spawners north of the start (3 Keres east, 2 Hoplites west, a 4-enemy mixed pack that stays cleared), PlayerAnchor + PlayerDeath + HurtFeedback, a NavMeshModifier so the player's capsule isn't baked as a hole.
  • LootDropper now finds the ground under enemies whose root is at their feet.
  • Localization: 2 enemy names (narrative), the death banner (systems).
  • Tests: EnemyRulesTests.cs (SpawnDensity 3, FrontalArc 5, shield via Health 3).
Decisions (flag to the user)
  • No death penalty yet; respawn at the start point (waypoints come in 14c).
  • Enemy numbers are first-pass tuning of the doc's Low/Med/High intent.
  • Elites, Shades (ranged), Field Rats and Formation (shield-line) behaviour come later.
  • (Update) User played 14a: Hoplite blocks ("blocked 50%"), enemies hit, death and respawn all work in the log.

All dev notes