Skip to content

03_Shields — Shields Overview

Goal

Teach how different shield providers modify incoming damage and how they interact through the real HealthSystem pipeline.

What This Scene Demonstrates

Amount + tags → DamageContext → shield provider(s) → HealthSystem result.

This scene focuses entirely on shields as part of the damage pipeline. The panel switches between real shield providers, configures them through public APIs, and sends hits through HealthSystem to observe actual behaviour.

PreviewDamage shows the authoritative preview. ApplyDamage shows the real runtime result.

What To Look For

  • Setup: The panel binds a victim with HealthSystem and optional attacker context.
  • Shield Type: Switching between None, Capacity, Rechargeable, Reduction, Overheal, and Chain changes the active provider.
  • Config: Each shield exposes its real runtime configuration (capacity, regen, reduction, decay, etc.).
  • Preview: Shows the engine’s expected result after shields.
  • Breakdown: A teaching aid showing approximate absorption per shield (when available).
  • Apply: Sends real hits through HealthSystem.ApplyDamage and reports actual results.
  • Bypass: True/bypass hits skip the shield layer entirely via DamageContext.BypassShields.

Mental model: incoming hit → shield provider decides outcome → remaining damage reaches HealthSystem.

Sample Scope

This scene covers:

  • Shield providers:

  • CapacityShield

  • RechargeableShield
  • ReductionShield
  • OverhealShield
  • ShieldChain
  • Switching active shield providers at runtime
  • Configuring shields through public APIs
  • Shield absorption, reduction, recharge, and decay
  • Chaining multiple shields and processing order
  • Comparing normal hits vs bypass (true) hits
  • Real preview and apply behaviour through HealthSystem

This scene does NOT cover:

  • Full combat rule flow (armor, affinity, crit, etc.)
  • Death handling as the primary focus
  • Networking implementation
  • Production gameplay setup patterns
  • Custom shield implementations beyond the built-ins

This panel rebuilds shield components for deterministic teaching. That behaviour is demo-only.

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:

  4. Victim is assigned and has HealthSystem

  5. Attacker is optional

  6. Set:

  7. Amount

  8. Tags (Melee / Ranged)

  9. Open Shield Type tab.

  10. Select a shield:

  11. None (baseline)

  12. Capacity
  13. Rechargeable
  14. Reduction
  15. Overheal
  16. Chain

  17. Open Config tab.

  18. Adjust values based on shield type:

  19. Capacity: max, flat, percent

  20. Recharge: max, delay, regen/sec
  21. Reduction: flat, percent
  22. Overheal: max temp, decay, pause
  23. Chain: enable/disable shield layers, rebuild

  24. Use shield-specific actions:

  25. Recharge Full

  26. Add Overheal
  27. Clear / Top Up
  28. Rebuild chain
  29. Refresh order

  30. Open Preview / Apply tab.

  31. Observe:

  32. Preview After Shields (authoritative)

  33. Breakdown (approximate, when available)

  34. Click:

  35. Apply Hit (normal shield path)

  36. Apply True (Bypass) (skips shields)

  37. Compare results:

  38. Shield absorption

  39. Remaining damage
  40. Final applied value

Failure Behaviour

  • Missing Victim

  • Meaning: No target for shield or damage flow

  • Fix: Assign a GameObject with HealthSystem

  • Missing HealthSystem

  • Meaning: Shield pipeline cannot run

  • Fix: Add HealthSystem to the victim

  • Zero Damage

  • Meaning: Hit is rejected or does nothing

  • Fix: Set Amount above 0

  • No Tags Selected

  • Meaning: Untagged hits still work, but tag-based rules may not contribute

  • Fix: Enable Melee or Ranged if needed

  • No Shield Active

  • Meaning: Damage goes directly to health

  • Fix: Select a shield type

  • Missing CapacityShield / Rechargeable / etc.

  • Meaning: Selected shield type is not present

  • Fix: Switch type in Play Mode to attach demo shield

  • Capacity Depleted

  • Meaning: Shield can no longer absorb damage

  • Fix: Recharge or increase capacity

  • Apply Requires Play Mode

  • Meaning: Cannot mutate runtime state

  • Fix: Enter Play Mode

  • Target Is Dead

  • Meaning: ApplyDamage rejects the hit

  • Fix: Revive or reset victim

  • AbsorbedByShield

  • Meaning: Shield fully absorbed damage

  • Fix: Increase Amount, reduce shield, or use bypass

  • Bypass Still Absorbed

  • Meaning: Custom behaviour overrides bypass

  • Fix: Inspect shield or rule implementation

  • ZeroOrNegativeAmount

  • Meaning: Shield/reduction removed all damage

  • Fix: Increase Amount or reduce shield strength

Behind The Scenes

  • HealthSystem — applies and previews damage
  • DamageContext — carries attacker, victim, amount, tags, and bypass flag
  • DamageContext.BypassShields — skips shield providers
  • IShield — abstraction for shield providers
  • IShieldPreview — optional preview interface for breakdown
  • CapacityShield — finite absorb pool with reduction
  • RechargeableShield — regenerating capacity shield
  • ReductionShield — always-on flat + percent reduction
  • OverhealShield — temporary HP with decay
  • ShieldChain — ordered processing of multiple shields
  • HealthSystem.SetShield(IShield) — assigns active provider
  • HealthSystem.PreviewDamage(in ctx, includeShields:true) — authoritative preview
  • HealthSystem.ApplyDamage(in ctx) — authoritative runtime result

The panel rebuilds shield components using public APIs. No internals or reflection are used.

Key Takeaway

Shields are not a single mechanic — they are interchangeable providers in the damage pipeline.

Each shield decides how damage is absorbed, reduced, or passed through, while HealthSystem remains the single source of truth for the final result.