# RPG Engine — Remaining Work ## Missing Foundational Components ### `Faction` / `Relationship` (`components/faction.ts`) Reputation score per faction ID. Drives dialog availability, shop access, hostile aggro thresholds, and quest unlock conditions. A separate world-level faction definition registry (neutral/friendly/hostile thresholds) pairs with this. --- ## Missing Systems ### `CombatSystem` (`systems/combatSystem.ts`) Resolves attack attempts between entities. Needs a lightweight `Attack` marker component (attacker entity ID, target entity ID, damage, damage type) that is added to an entity to queue an attack for the next tick. Each tick the system: 1. Processes queued `Attack` components. 2. Applies damage to the target's `Health` stat (accounting for any defense modifier Effects on the target). 3. Removes the `Attack` component after resolution. 4. Emits `'hit'` / `'kill'` events on the target entity as appropriate. Keeping the attack as a component (rather than a direct method call) lets other systems react before resolution (parry window, shield-block effects, etc.).