✨ Health — Post Effects¶
This folder contains post-damage visual and feedback rules.
Post Effects are rule components that:
- implement IPostDamageRule
- run after damage has been fully resolved
- react only to finalized results (DamageContext.FinalApplied)
They are purely reactive and never influence gameplay outcomes.
📦 What Post Effects Are (and Aren’t)¶
Post Effects are - Visual or feedback reactions to successful damage - Safe to layer with other POST rules (reflect, lifesteal, analytics) - Triggered only when damage actually applies
Post Effects are not - Gameplay modifiers - Damage mutators - Death handlers - Core Effects (see Effects folder)
If damage didn’t land, Post Effects do nothing.
🔄 Execution Context¶
Post Effects are invoked by DamageRuleHub:
PRE Damage Rules
→ Shields
→ HealthSystem.ApplyDamage
→ POST Damage Rules (including Post Effects)
Guarantees:
- ctx.FinalApplied is known and stable
- Health, shields, and death state are already resolved
- Authority checks have already passed
💥 Components¶
DamageVFXPostRule¶
Spawns a visual effect when damage is successfully applied.
Fields¶
vfxPrefab— prefab to instantiateworldOffset— world-space offset from the victimvfxLifetime— optional auto-destroy timescaleWithDamage— enable scaling by damage amountscalePerPoint— scale added per damage pointmaxScale— upper clamp for scalingminInterval— spam guard between spawns
Behaviour¶
- Runs only when:
- component is active & enabled
ctx.FinalApplied > 0vfxPrefabis assigned- spam guard allows execution
- Instantiates the VFX at:
transform.position + worldOffset - Optionally scales the instance based on
FinalApplied - Optionally destroys the instance after
vfxLifetime
Typical Uses¶
- Hit sparks
- Blood puffs
- Elemental impact effects
- Stylised damage pulses
🧠 Design Notes¶
- Post Effects must never mutate
DamageContext - They should be treated as fire-and-forget
- Ordering between Post Effects is rarely critical (Unity component order applies if needed)
- For death-centric behaviour (camera shake, time slow, destroy),
prefer
HealthDeathEffectHandler
❌ What Post Effects Should Not Do¶
- Do not modify damage or health
- Do not assume authority or networking
- Do not trigger gameplay logic
- Do not replace Handlers or Effects
Post Effects exist purely to react visually.