Skip to content

🧱 Health — Modifiers

📦 Folder Overview

This folder contains supporting modifier components and utilities that contribute values into existing Health rules or helper systems.

Modifiers are not core health logic. They allow multiple independent systems to influence behaviour without coupling directly to rules or HealthSystem.


🎯 Purpose

Modifiers provide:

  • Value contribution into rule systems
  • Decoupled inputs for gameplay features
  • Composable behaviour across systems

They are:

  • Optional
  • Runtime-safe
  • Composable
  • Enable/disable friendly

🧩 What Lives Here

ReflectBuff

Victim-side contributor used with ReflectStacksRule.

Behaviour:

  • On enable → _rule.Push(percent)
  • On disable → _rule.Pop(percent)
  • Contributions are summed
  • Final value is clamped by the rule

Notes:

  • Removes only its own contribution
  • Safe for pooling and toggling
  • Does not mutate health directly

HealingUtility

Static helper for aggregating healing modifiers.

Behaviour:

  • Reads all IHealingModifier on target
  • Multiplies contributions together
  • Applies result to base heal value

API:

float GetHealingMultiplier(GameObject target);
int ApplyHealingModifiers(GameObject target, int baseAmount);

Notes:

  • Non-mutating
  • Rule-agnostic
  • Array-based overload allocates; use list-based overloads for hot paths

⚠️ Important Notes

Boundaries

Modifiers should not:

  • Apply damage or healing directly
  • Implement rule logic
  • Depend on HealthSystem internals
  • Encode networking or authority

If behaviour becomes complex, it belongs in a rule.


🧠 Usage Guidance

  • Use modifiers to provide inputs into rules
  • Combine multiple modifiers safely
  • Keep modifier logic simple and focused

  • Rules
  • Damage Rules
  • Heal Rules
  • Shields