💥 Health — Effects (Runtime)¶
📦 Folder Overview¶
This folder contains optional gameplay effect components built on top of the Health system’s public seams.
They implement over-time mechanics (DOT / HOT) without modifying HealthSystem internals.
Health works without anything in this folder.
🎯 Purpose¶
Runtime effects provide:
- Tick-driven gameplay using public Health APIs
- Composable behaviours layered on top of Health
- Optional systems that respect rules, shields, and authority
🧩 What Lives Here¶
DotEffect (Damage Over Time)¶
Applies periodic damage via:
IHealthMutator.ApplyDamage(in DamageContext)
Behaviour:
- Uses the damage pipeline (rules → shields → apply → post observers)
-
Supports stacking modes:
-
Refresh
- Additive
- Independent
Determinism:
seed = 0→ non-deterministic schedulingseed != 0→ deterministic scheduling
Notes:
- Determinism affects timing only
- Outcomes depend on rules, shields, authority, and state
Jitter:
tickJitterPercentinitialOffsetJitterPercent
Lifecycle:
Apply(attacker, teamId)ClearAll()
Events:
- Started / Stopped
- StacksChanged
- TickApplied(int appliedDamage) when damage > 0
HotEffect (Heal Over Time)¶
Applies periodic healing via:
IHealthWriter.Heal(int amount)
Behaviour:
- Uses the healing pipeline (rules → modifiers → apply → post observers)
-
Supports stacking modes:
-
Refresh
- Additive
- Independent
Determinism:
- Same scheduling model as DOT
Notes:
- Determinism affects timing only
- Results depend on rules, modifiers, and current state
Lifecycle:
Apply()ClearAll()
Events:
- Started / Stopped
- StacksChanged
- TickApplied(int requestedHeal) when heal > 0
⚠️ Important Notes¶
Behaviour¶
- Effects use public APIs and respect rules, shields, and authority
- Rejected ticks (authority, invincibility, target state) do not apply results
- Effects do not own health state
Boundaries¶
Runtime effects are not:
- Required dependencies
- A full status or buff system
- Networking or replication systems
- Visual-only scripts
🧠 Usage Guidance¶
- Use effects for simple over-time gameplay mechanics
- Prefer public APIs over internal access
- For complex systems, integrate with a dedicated status/effects layer
🔗 Related Documentation¶
- Health System
- Abstractions
- Authority
- Rules