Skip to main content

combat Folder

Folders Index

foldercommands
foldercomponents
foldersystems
foldertypes

Files Index

filehelios/engine/mechanics/combat/_module.ixx

Aggregate module for helios::engine::mechanics::combat namespace. More...

filemechanics/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

SubmodulePurpose
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

ClassPurpose
Aim2DComponentStores aiming direction and fire frequency
ShootComponentWeapon cooldown, spawn profile reference, emitter state
LastAttackerComponentTracks last entity that attacked this entity
AttackContextData struct with attacker info for kill attribution
Aim2DCommandUpdates aim direction from input
ShootCommandTriggers projectile spawn when cooldown allows
ProjectileSpawnSystemReads 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.