Skip to content

02_CritExecuteBuffs — Crit • Execute • Buffs

Goal

Teach how crits, execute thresholds, attacker-side multipliers, and capacity shields interact through the real HealthSystem damage pipeline.

What This Scene Demonstrates

Amount + tags + attacker multiplier → crit / execute rules → shield handling → ApplyDamage result.

This scene builds on the basic rules flow by adding more moving parts. The panel sends a real DamageContext through HealthSystem, then reports the preview values, shield behaviour, and final apply result returned by the system.

The panel does not simulate a separate combat model. HealthSystem.PreviewDamage explains likely outcomes, and HealthSystem.ApplyDamage is the runtime truth.

What To Look For

  • Setup: The panel binds an attacker and victim, then checks for HealthSystem, CritRule, ExecuteThresholdRule, and CapacityShield.
  • Rules: Crit chance, crit multiplier, execute threshold, and attacker-side multiplier are adjusted through visible controls.
  • Shield: A real CapacityShield is configured, enabled/disabled, recharged, and inspected.
  • Preview / Apply: The panel compares non-crit preview, forced-crit preview, expected average, and the actual ApplyDamage result.
  • Result state: Shield capacity, health, final applied damage, rejection reason, and bypass state come from the real runtime pipeline.

Mental model: caller scales the hit → victim rules evaluate it → shields may absorb it → HealthSystem applies or rejects the result.

Sample Scope

This scene covers:

  • Raw damage amount
  • Melee and Ranged tags
  • Attacker-side multiplier through DamageContext.Multiplier
  • CritRule chance and multiplier
  • Non-crit preview
  • Forced-crit preview
  • Expected average preview
  • ExecuteThresholdRule activation based on victim health threshold
  • CapacityShield capacity, flat reduction, percent reduction, and recharge
  • Real ApplyDamage results through HealthSystem

This scene does NOT cover:

  • Basic tag / armor / affinity flow in detail
  • Full shield comparison across different shield types
  • Death handling as the teaching focus
  • Regeneration
  • Networking implementation
  • Production combat input
  • Deterministic RNG setup

This panel expects the relevant components to exist on the victim. It does not create crit, execute, or shield components for you.

Authority Note

This scene may include a permissive sample authority setup where mutations are allowed locally for demonstration purposes.

Networking Reminder

No networking is included; integration is the developer’s responsibility.

How To Use

  1. Enter Play Mode.
  2. Open the Setup tab.
  3. Confirm the panel has:

  4. an Attacker binding

  5. a Victim binding
  6. HealthSystem on the victim
  7. optional CritRule
  8. optional ExecuteThresholdRule
  9. optional CapacityShield
  10. Set Amount to the raw damage value.
  11. Select one or both tags:

  12. Melee

  13. Ranged
  14. Open the Rules tab.
  15. If CritRule is present, adjust:

  16. Crit chance

  17. Crit multiplier
  18. If ExecuteThresholdRule is present, adjust:

  19. Execute threshold (%)

  20. Adjust Attacker buff (×) to scale outgoing damage through DamageContext.Multiplier.
  21. Open the Shield tab.
  22. Enable or disable the shield for this panel.
  23. If CapacityShield is present, adjust:

  24. Max capacity

  25. Flat reduce
  26. Percent reduce (0–1)

  27. Use Recharge Full to restore shield capacity.

  28. Open the Preview / Apply tab.
  29. Compare:

  30. Preview Non-Crit

  31. Preview Crit when crit is present
  32. Expected Avg when crit is configured

  33. Click Apply Hit to run the real HealthSystem.ApplyDamage mutation.

  34. Read the result and raw result line to inspect what actually happened.

Failure Behaviour

  • Missing Attacker

  • Meaning: The panel cannot demonstrate attacker-side multiplier flow.

  • Fix: Assign the attacker GameObject in Setup.

  • Missing Victim

  • Meaning: Preview and Apply have no health target.

  • Fix: Assign a victim GameObject with HealthSystem.

  • Missing HealthSystem

  • Meaning: The selected victim cannot run the health pipeline.

  • Fix: Add HealthSystem to the victim or choose a valid health target.

  • No Focus Components Found

  • Meaning: The victim has no CritRule, ExecuteThresholdRule, or CapacityShield.

  • Fix: Add one or more of those components to demonstrate this scene’s focus behaviours.

  • Zero Damage

  • Meaning: Amount is zero, so ApplyDamage will reject or do nothing.

  • Fix: Set Amount above 0.

  • No Tags Selected

  • Meaning: Untagged hits are valid, but tag-sensitive rules may not contribute.

  • Fix: Enable Melee or Ranged to test tagged behaviour.

  • Rules Blocked

  • Meaning: Rules inspection needs a victim with HealthSystem.

  • Fix: Return to Setup and assign a valid victim.

  • Shield Blocked

  • Meaning: Shield inspection needs a victim with HealthSystem.

  • Fix: Return to Setup and assign a valid victim.

  • Missing CapacityShield

  • Meaning: Shield is enabled in the panel, but the victim has no CapacityShield.

  • Fix: Add CapacityShield to the victim, then return to the Shield tab.

  • Shield Depleted

  • Meaning: Capacity is zero, so damage will flow through to health.

  • Fix: Use Recharge Full to test shield absorption again.

  • Preview / Apply Blocked

  • Meaning: Preview and Apply need a victim with HealthSystem.

  • Fix: Return to Setup and assign a valid victim.

  • Apply Requires Play Mode

  • Meaning: Apply mutates runtime health state and is disabled outside Play Mode.

  • Fix: Enter Play Mode.

  • Target Is Dead

  • Meaning: ApplyDamage will reject the hit because the victim is already dead.

  • Fix: Revive or reset the victim before applying damage.

  • AuthorityBlocked

  • Meaning: The hit was blocked by authority policy.

  • Fix: Check the health authority policy or run the hit from an allowed authority path.

  • Invincible

  • Meaning: The hit was blocked by invincibility.

  • Fix: Wait for i-frames to expire or disable the invincibility source.

  • DamageLocked

  • Meaning: Damage is currently locked.

  • Fix: Unlock damage or inspect the component/rule that enabled the lock.

  • AbsorbedByShield

  • Meaning: The shield fully absorbed the hit.

  • Fix: Recharge/reduce shield, increase Amount, or test execute if you expect shield bypass.

  • ZeroOrNegativeAmount

  • Meaning: Rules or shield math reduced the hit to zero.

  • Fix: Increase Amount, raise attacker buff, or inspect active rules/shield reductions.

Behind The Scenes

  • HealthSystem — previews and applies damage
  • DamageContext — carries attacker, victim, amount, tags, and multiplier
  • DamageContext.Multiplier — applies caller-side damage scaling before victim pipeline resolution
  • DamageTag — describes the hit type
  • CritRule — applies chance-based damage multiplication
  • ExecuteThresholdRule — changes damage behaviour when victim health is at or below the configured threshold
  • CapacityShield — owns finite shield capacity and shield reduction settings
  • IShield — shield abstraction used by the health pipeline
  • HealthSystem.PreviewDamage(in ctx, includeShields:true) — preview including shields
  • HealthSystem.ApplyDamage(in ctx) — authoritative runtime mutation result
  • DamageResult — reports applied state, final amount, rejection reason, and shield bypass state

The panel uses public seams only. It does not access internals, use reflection, or fake rule, shield, or service behaviour.

Key Takeaway

This scene shows damage as a sequence of decisions, not one flat calculation.

The attacker can scale the hit, crits can spike it, execute can change the route at low health, and shields can absorb or reduce it before health changes.

Each piece stays separate, but HealthSystem brings them together through one consistent damage flow.