Skip to main content

Module combat

Module combat 

Source
Expand description

Combat system — damage, status effects, hit detection, and DPS calculation.

The combat system is purely mathematical: no sprites, no hitboxes. Damage is a function of attacker stats, defender stats, and environmental entropy. Status effects are time-varying functions applied each tick.

§Architecture

  • DamageEvent — a single damage application with element and source
  • StatusEffect — a timed, stackable debuff/buff with per-tick function
  • CombatStats — attacker/defender stat block
  • HitResult — full damage resolution output
  • DpsTracker — rolling DPS measurement
  • CombatFormulas — all damage formulas in one place

Re-exports§

pub use inventory::Item;
pub use inventory::ItemCategory;
pub use inventory::Inventory;
pub use inventory::Equipment;
pub use inventory::Rarity;
pub use inventory::LootTable;
pub use inventory::LootDrop;
pub use abilities::Ability;
pub use abilities::AbilityBar;
pub use abilities::ResourcePool;
pub use abilities::ResourceType;
pub use abilities::AbilityEffect;
pub use combo::ComboState;
pub use combo::ComboDatabase;
pub use combo::ComboTracker;
pub use combo::ComboInput;
pub use combo::InputBuffer;

Modules§

abilities
Skill and ability system — cooldowns, mana, resource tracking, ability trees.
combo
Combo system — input buffering, combo chains, and hit-confirm windows.
inventory
Inventory, equipment, and item system.

Structs§

CombatFormulas
Stateless damage resolution functions.
CombatLog
Rolling combat event log.
CombatLogEntry
An entry in the combat event log.
CombatStats
Stat block for an attacker or defender.
DamageEvent
A single damage application.
DpsTracker
Tracks damage-per-second in a rolling window.
HitDetection
Geometric hit detection utilities.
HitResult
Full result of damage resolution.
ResistanceProfile
Per-element resistance multipliers for a combatant.
StatusEffect
A timed status effect applied to a combatant.
StatusTracker
Manages all status effects on a single entity.
ThreatTable
Tracks threat levels for AI targeting.

Enums§

Element
Elemental type. Determines resistances, weakness multipliers, and visual effects.
StatusKind
Type of status effect.