Table of Contents

Namespace ElectricDrill.AstraRpgFramework.Triggers

Classes

AttributeChangedGameEventTrigger

GameEventTrigger<TContext> that fires when an attribute value changes. Payload: AttributeChangeInfo — carries the attribute, previous value, and new value.

EntityCoreGameEventTrigger

GameEventTrigger<TContext> that fires when an EntityCore event is raised. Payload is the EntityCore passed to the event.

EntityLevelDownGameEventTrigger

GameEventTrigger<TContext> that fires when an entity levels down. Payload: EntityLevelChangedContext — carries the entity, previous level, and new level.

EntityLevelUpGameEventTrigger

GameEventTrigger<TContext> that fires when an entity levels up. Payload: EntityLevelChangedContext — carries the entity, previous level, and new level.

GameEventTrigger<TContext>

Abstract base for IReactiveTrigger implementations that wrap a typed GameEventGeneric1<T> SO.

Concrete subclasses must be non-generic and carry a [SerializeField] reference to the specific event SO, exposed via Event. This separation is required because Unity cannot serialize open-generic types with [SerializeReference].

When the event fires each registered Action<object> callback is invoked with the TContext payload boxed as object. Filtering on payload content (e.g. "only if the dying entity is my holder") is the responsibility of the callback or an associated Condition.

IntGameEventTrigger

GameEventTrigger<TContext> that fires when an IntGameEvent is raised. Payload is the int value boxed as object.

ParameterlessGameEventTrigger

IReactiveTrigger that wraps a parameterless GameEvent SO. When the event fires, every registered callback for every holder is invoked with null as the payload.

This class is [Serializable] so it can be embedded as a field in any ScriptableObject or MonoBehaviour. The subscription dictionary is runtime-only and is initialized lazily (safe after Unity deserialization).

StatChangedGameEventTrigger

GameEventTrigger<TContext> that fires when a stat value changes. Payload: StatChangeInfo — carries the stat, previous value, and new value.

Interfaces

IReactiveTrigger

Holder-aware reactive event delivery contract. Implementations wrap a game event source and invoke registered callbacks when the event fires. Subscriptions are registered on behalf of a EntityCore holder; the holder is passed to Subscribe(EntityCore, Action<object>) so that the caller can identify which modifier instance or system registered the callback, but it does NOT imply that only events concerning that holder are delivered. On a shared global event SO, all subscribed holders are notified — event filtering by entity identity is the responsibility of the callback or an associated Condition.