Scripting / Components
ActiveEffectsController
Manages all timed stat effects currently active on the player. Tracks each effect's remaining turns and automatically reverts it when it expires. Attached to the player GameObject alongside Health and PlayerStamina.
How it works
When the player uses an Item whose Effect has a duration greater than zero, ActiveEffectsController.Track() is called automatically. Each turn the controller decrements the remaining turns of every tracked effect, and calls RevertEffect on any that expire — undoing the stat modification.
Inspector Fields
| Field | Type | Description |
|---|---|---|
_activeEffects | List<ActiveEffect> (ReadOnly) | Read-only view of the effects currently being tracked. Visible in the Inspector for debugging — do not modify directly. |
Methods
| Method | Description |
|---|---|
Track(Effect effect, IStatEffectReceiver receiver) | Registers a timed effect for automatic expiry. Called by the item-use flow when an effect with duration > 0 is applied. |
Clear() | Removes all tracked effects without reverting them. Called when a run ends to reset controller state. |
Instant effects (
duration == 0) are never registered here — they are applied and forgotten immediately. Only timed effects with a positive duration go through ActiveEffectsController. See Effect for the full duration model.