Skip to content

🧬 Health — Internal / Mutation

📦 Folder Overview

This folder contains internal mutation processors and host seams used by HealthSystem.

These types implement the concrete damage and healing execution flow, but they are not public extension points.


🎯 Purpose

Internal mutation helpers exist to:

  • Keep HealthSystem orchestration readable
  • Isolate damage and heal pipeline execution into focused units
  • Reuse shared host-facing logic without exposing internals publicly

🧩 What Lives Here

This folder contains:

  • Internal execution logic for damage and healing
  • Host interfaces used by the processors
  • Core implementation plumbing

It does not contain:

  • A public mutation API
  • Supported extension seams
  • A second abstraction layer

🧩 Components

HealthDamageProcessor

Internal executor for damage evaluation.

Responsibilities:

  • Applies damage through the host’s pipeline
  • Performs guard checks
  • Runs PRE damage rules
  • Applies shield absorption
  • Mutates current HP
  • Triggers post-damage notifications and death handling
  • Emits attempted and applied outcomes through the host

High-level flow:

  1. Check mutation permission
  2. Check dead / invincible / damage-locked guards
  3. Normalize incoming DamageContext
  4. Run PRE damage rules
  5. Fold final incoming damage
  6. Apply shield absorption unless bypassed
  7. Apply remaining damage to HP
  8. Notify post-damage observers
  9. Trigger death handling if HP reaches 0
  10. Emit DamageResult

This processor backs HealthSystem.ApplyDamage(...).


HealthHealProcessor

Internal executor for heal evaluation.

Responsibilities:

  • Applies healing through the host’s pipeline
  • Performs guard checks
  • Runs PRE heal rules
  • Applies healing modifiers
  • Mutates current HP
  • Handles overheal spill when supported
  • Triggers post-heal notifications and events

High-level flow:

  1. Check mutation permission
  2. Check dead / invalid amount guards
  3. Run PRE heal rules
  4. Apply healing modifiers
  5. Clamp and apply to HP
  6. Forward overflow to overheal shield when enabled
  7. Notify post-heal observers
  8. Emit heal events

This processor backs HealthSystem.TryHeal(...).


IHealthDamageProcessorHost

Internal host seam consumed by HealthDamageProcessor.

Purpose:

  • Provides required state and callbacks without coupling to all of HealthSystem

Exposes:

  • owner object
  • current HP
  • dead / lock state
  • invincibility
  • shield
  • damage rules
  • mutation permission
  • rejected-context construction
  • last-damage recording
  • post-damage notifications
  • applied event emission
  • death handling
  • attempted-result emission

This is an internal processor seam, not a user contract.


IHealthHealProcessorHost

Internal host seam consumed by HealthHealProcessor.

Purpose:

  • Provides heal-specific state and callbacks without coupling to all of HealthSystem

Exposes:

  • owner object
  • current / max HP
  • dead state
  • overheal spill behaviour
  • heal rules
  • overheal shield
  • mutation permission
  • post-heal notifications
  • applied event emission

This exists only to support internal implementation structure.


⚠️ Important Notes

Boundaries

Do not:

  • Depend on these types from gameplay code
  • Implement these interfaces outside the Health implementation layer
  • Treat the processors as reusable public services
  • Build custom systems against these host seams

For supported mutation surfaces, use:

  • IHealthMutator
  • IHealthWriter
  • IDamageable
  • HealthSystem

🧠 Usage Guidance

  • Treat this folder as implementation detail
  • Prefer public contracts and APIs for integrations
  • Expect internal execution details to change over time

🚫 Not for Production Use

This folder is not intended as a gameplay integration surface.


  • Health System
  • Health Abstractions
  • Rules
  • Shields