combat Folder
Folders Index
| folder | commands |
| folder | components |
| folder | systems |
| folder | types |
Files Index
| file | helios/engine/mechanics/combat/_module.ixx |
|
Aggregate module for helios::engine::mechanics::combat namespace. More... | |
| file | mechanics/combat/registry.ixx |
|
Component registration for combat module. More... | |
Description
helios::engine::mechanics::combat
Combat-related gameplay systems, components, and commands.
Overview
This module provides all building blocks for implementing combat mechanics such as aiming, shooting, projectile spawning, and attack attribution.
Submodules
| Submodule | Purpose |
|---|---|
| commands/ | Commands for combat actions (ShootCommand, Aim2DCommand) |
| components/ | Data containers for combat state (aiming, cooldowns, attack tracking) |
| systems/ | ECS systems for processing combat logic (ProjectileSpawnSystem) |
| types/ | Combat data types (AttackContext) |
Key Classes
| Class | Purpose |
|---|---|
| Aim2DComponent | Stores aiming direction and fire frequency |
| ShootComponent | Weapon cooldown, spawn profile reference, emitter state |
| LastAttackerComponent | Tracks last entity that attacked this entity |
| AttackContext | Data struct with attacker info for kill attribution |
| Aim2DCommand | Updates aim direction from input |
| ShootCommand | Triggers projectile spawn when cooldown allows |
| ProjectileSpawnSystem | Reads shoot state and enqueues spawn commands |
Architecture
Combat follows the command pattern integrated with the spawn system:
1. Input systems generate ShootCommand and Aim2DCommand 2. Commands update ShootComponent and Aim2DComponent state 3. ProjectileSpawnSystem reads component state and generates SpawnCommand 4. Spawn system handles actual projectile creation via pool and profile
Attack Attribution Flow
1. DamageOnCollisionSystem applies damage and updates LastAttackerComponent 2. HealthUpdateSystem detects death and publishes DeathEvent with AttackContext 3. CombatScoringSystem reads DeathEvent and awards score to attacker
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.