Buff & Status Effect Manager

v1.2.2

Component Reference

Complete reference for all BSM components and ScriptableObjects.

Overview

BSM consists of runtime components (added to GameObjects) and ScriptableObject assets (created in the Project window). This page documents all components and their properties.

Component

Runtime components

ScriptableObject

Data assets

Optional

GC2 integration

Persistence

Save/load support

StatusEffectManagerComponent

Core component placed on any character/NPC that can receive status effects. Manages the full lifecycle: apply → tick → expire/dispel.

Inspector Properties

Immunity ProfilePermanent immunity configuration (optional)
Max Active EffectsLimit total active effects (0 = unlimited)
Interaction SetReaction rules for this target (optional, falls back to EffectInteractionSet.Global)

Key API Methods

// Apply an effect (optionally remembering who applied it)
StatusEffectInstance ApplyEffect(StatusEffectDefinition definition)
StatusEffectInstance ApplyEffect(StatusEffectDefinition definition, GameObject source)

// Remove effects
bool RemoveEffect(StatusEffectDefinition definition)
void RemoveAllEffects()
int DispelCategory(StatusEffectCategory category)
int DispelByTag(string tag)
int DispelByCleanseType(CleanseType cleanseType, int maxCount = 0)

// Stack management
int AddStacks(StatusEffectDefinition definition, int count)
int RemoveStacks(StatusEffectDefinition definition, int count)

// Queries
bool HasEffect(StatusEffectDefinition definition)
bool IsImmuneToEffect(StatusEffectDefinition definition)
bool IsOnCooldown(StatusEffectDefinition definition)
float GetRemainingDuration(StatusEffectDefinition definition)
float GetRemainingCooldown(StatusEffectDefinition definition)

// Immunity
void AddTemporaryImmunity(StatusEffectDefinition definition, float duration)
void AddTemporaryImmunityByCategory(StatusEffectCategory category, float duration)
void AddTemporaryImmunityByTag(string tag, float duration)

// Cooldown
void ClearCooldown(StatusEffectDefinition definition)
void ClearAllCooldowns()

// Source tracking (v1.2)
bool HasEffectFromSource(StatusEffectDefinition definition, GameObject source)
int CountEffectsFromSource(GameObject source)
int RemoveEffectsFromSource(GameObject source)

// Interactions (v1.2)
EffectInteractionSet InteractionSet { get; set; }
bool WouldReact(StatusEffectDefinition definition)
bool FindInteraction(StatusEffectDefinition definition, out EffectInteractionRule rule, out StatusEffectInstance present)
EffectReactionContext LastReaction { get; }

// Priority & resistance (v1.2)
StatusEffectInstance GetHighestPriorityEffect(StatusEffectCategory category)
int GetHighestPriorityInCategory(StatusEffectCategory category)   // int.MinValue if none
float GetResistChance(StatusEffectDefinition definition)          // 0-100
float GetEffectiveApplyChance(StatusEffectDefinition definition)  // 0-1

Events

event Action<StatusEffectInstance> OnEffectApplied
event Action<StatusEffectInstance> OnEffectTicked
event Action<StatusEffectInstance> OnEffectExpired
event Action<StatusEffectInstance> OnEffectDispelled
event Action<StatusEffectDefinition> OnEffectBlocked
event Action<StatusEffectInstance, int> OnEffectStacksChanged
event Action<EffectReactionContext> OnEffectReaction       // v1.2
event Action<StatusEffectDefinition> OnEffectResisted      // v1.2

StatusEffectDefinitionScriptableObject

Defines an effect's properties, behavior, and visuals. Create via:Create → Game Creator → BSM → Effect Definition

Identity

Display NameName shown to players
DescriptionTooltip description text
CategoryParent category (optional)
TagsTags for filtering (e.g., "fire", "poison")
IconSprite for UI display

Duration & Ticking

Duration ModeTimed or Permanent
DurationSeconds (for Timed mode)
Has TickEnable periodic tick events
Tick IntervalSeconds between ticks
Tick On ApplyFire first tick immediately
Max TicksLimit total ticks (0 = unlimited)

Stacking

Stacking ModeNone, Stack, Refresh, RefreshAndStack, Extend
Max StacksMaximum stack count
Scale With StacksMultiply effects by stack count
PriorityUsed by Exclusive categories: higher wins (default 0)

Cooldown & Cleanse

Has CooldownPrevent rapid re-application
Cooldown DurationSeconds before can reapply
Cooldown Starts On ApplyStart cooldown on apply vs on end
Cleanse TypeWhich dispels can remove this effect

VFX & Audio

Apply VFX/SoundPrefab/clip when applied
Remove VFX/SoundPrefab/clip when removed
Tick VFX/SoundPrefab/clip on each tick
VFX LifetimeAuto-destroy delay (0 = never)

Resistance (v1.2)

Apply ChanceBase success probability 0–1 (1 = always)
Resist Chance StatTarget GC2 Stat read as 0–100 % chance to resist
Duration Resist StatTarget GC2 Stat read as 0–100 % duration reduction

Instructions (v1.2)

GC2 instruction lists that run directly from the definition. Self is the affected object, Target is the source/caster (or Self if unknown).

On ApplyRuns when the effect is applied
On TickRuns on every tick (Has Tick required)
On ExpireRuns when the duration ends
On DispelRuns when dispelled or removed early

StatusEffectCategoryScriptableObject

Groups effects and provides shared configuration. Create via:Create → Game Creator → BSM → Category

Display NameCategory name for UI
Category TypeBuff, Debuff, or CrowdControl
ColorUI tint color
Max ConcurrentLimit active effects (0 = unlimited)
Replace OldestWhen at limit, replace oldest?
ExclusiveOnly one effect of this category; higher Priority replaces, lower is blocked (v1.2)
Equal Priority ReplacesEqual Priority replaces (true) or is blocked (false)

ImmunityProfileScriptableObject

Defines permanent immunities for a character. Create via:Create → Game Creator → BSM → Immunity Profile

Immune EffectsSpecific effects this entity is immune to
Immune CategoriesEntire categories to block
Immune TagsBlock effects with these tags
Use Case: Create a "Boss" immunity profile that blocks all crowd control effects, then assign it to boss enemies.

EffectInteractionRuleScriptableObject

One reaction between an incoming and a present effect. Create via:Create → Buff Status Effect Manager → Effect Interaction Rule

Trigger

IncomingMatcher for the effect being applied (Definition, Category, Category Type, Tag, Any)
PresentMatcher for an effect that must already be active
Min Present StacksStack count the present effect needs (default 1)

Outcome

Incoming ActionApply normally, or Block (consume) the incoming effect
Present ActionKeep, Remove, Remove Stacks (× Present Stacks To Remove) or Refresh
Present Duration BonusSeconds added to a kept, timed present effect
Result EffectOptional effect applied to the target
Transfer StacksResult receives the present effect's stack count (capped by Max Stacks)

Evaluation & Feedback

EnabledDisabled rules are skipped
PriorityHigher rules are checked first; only the first match fires
ChanceProbability 0–1 that a matching rule fires
Reaction VFX / SoundSpawned/played on the target when the rule fires

EffectInteractionSetScriptableObject

An ordered list of rules. Assign it to a StatusEffectManager's Interaction Set field, or make it the project-wide fallback with the Set Interaction Set instruction (scope: Global). Create via:Create → Buff Status Effect Manager → Effect Interaction Set

// Per target
manager.InteractionSet = mySet;

// Project-wide fallback for managers without a set
EffectInteractionSet.Global = mySet;

// Deterministic lookup (ignores Chance, no side effects)
EffectInteractionRule rule = mySet.FindMatch(incomingDefinition, manager.ActiveEffects, out var present);
The BSM Settings window (Window → Buff Status Effect Manager) has an Interactions page listing all sets and rules, and warns about rules that are in no set, have an unconfigured matcher, or do nothing.

StatusEffectAuraComponent

Automatically applies effects to entities within a radius. Perfect for healing zones, poison clouds, or buff auras.

EffectThe effect to apply to targets
RadiusRange in world units
Target ModeAll, AlliesOnly, EnemiesOnly, SelfOnly
Target LayersPhysics layer mask
Remove On ExitRemove effect when leaving aura
Update IntervalScan frequency in seconds
Active On StartStart enabled?

API

void Activate()
void Deactivate()
void Toggle()
void ForceUpdate()
IReadOnlyCollection<StatusEffectManager> GetAffectedTargets()

StatsBridgeOptional Component

Bridges BSM effects to GC2 Stats modifiers. Add alongside StatusEffectManager on entities that use stat-modifying effects.

Requires: Game Creator 2 Stats module must be installed. Define GC2_STATS in Player Settings.

When configured, the StatsBridge automatically applies stat modifiers defined in StatusEffectDefinition when effects activate, and removes them when effects end.

StatusEffectRememberPersistence

Integrates with GC2's Save/Load system to persist active effects across game sessions. Add to any entity that should save its effect state.

Saves: Effect IDs, remaining durations, stack counts, tick progress and temporary immunities. On load, effects are restored with their correct remaining time. Effect sources (casters) are scene objects and are not persisted.