RevFramework — Status Effects • Definitions¶
ScriptableObject assets used to author status effects in the Unity Editor.
Definitions are data-only.
They describe what to build, not how effects behave at runtime.
Table of Contents¶
Overview¶
Definitions are authoring-time ScriptableObjects.
Each definition:
- Exposes tunable fields (duration, magnitude, flags)
- Implements
BuildEffect() - Returns a fresh runtime
IStatusEffectinstance
Once built, the runtime instance is handed to StatusEffectController, which then owns:
- Stacking rules
- Potency and resistance scaling
- Authority checks
- Ticking, refresh, expiry
- Events and FX hooks
Definitions themselves contain no runtime logic.
Mental Model¶
Think of definitions as blueprints, not behaviours.
- Definitions never tick
- Definitions never store runtime state
- Definitions never apply stacking or scaling
- Definitions never talk to UI or authority
Their only responsibility is:
“Given my data, construct a new effect instance.”
Quick Start¶
- Create a definition via the Asset menu:
Assets ▸ Create ▸ RevFramework ▸ StatusEffects ▸ Poison Status
-
Configure fields in the Inspector (duration, DPS, etc.)
-
Build and apply at runtime:
var effect = poisonDef.BuildEffect();
ctrl.ApplyStatus(effect, StatusContext.FromAbility("firebolt"));
You may also use ApplyOrRefresh if preferred:
ctrl.ApplyOrRefresh(
() => poisonDef.BuildEffect(),
StatusContext.FromAbility("firebolt")
);
Available Definitions¶
| Definition | Purpose |
|---|---|
PoisonStatusDefinition |
Damage-over-time (Poison) |
BurnStatusDefinition |
Fire DoT with optional propagation |
RegenStatusDefinition |
Heal-over-time buff |
SlowStatusDefinition |
Movement speed debuff |
HasteStatusDefinition |
Cooldown multiplier buff |
VulnerabilityStatusDefinition |
Increases damage taken |
ShieldStatusDefinition |
Temporary shield buffer |
StunStatusDefinition |
Behaviour-disabling CC |
ThornsStatusDefinition |
Reflective damage buff |
Base StatusEffectDefinitionBase |
Abstract builder (BuildEffect) |
Each definition follows the same pattern:
public override IStatusEffect BuildEffect()
{
return new PoisonStatus(duration, dps);
}
Gotchas¶
- Always return a new instance from
BuildEffect()— never reuse or cache - Potency and resistance scaling are applied after construction by the controller
- Definitions must never reference active GameObjects or scene state
StunStatusDefinitionrequires fully-qualified type names for behaviours to disable
If you need logic, it belongs in the runtime implementation, not the definition.
Extending¶
To add your own definition:
- Subclass
StatusEffectDefinitionBase - Expose public fields for designer tuning
- Implement
BuildEffect()to construct your runtime effect - (Optional) Register the effect in
StatusRegistryfor factory-based creation
Keep definitions data-only and deterministic.
See Also¶
Effects— runtime implementationsCore— controller, stacking, registryAbstractions— shared contracts