Buff & Status Effect Manager

v1.0.0

Workflows

Step-by-step guides for implementing common status effect patterns.

Overview

This section provides complete, copy-paste ready workflows for common game mechanics. Each workflow includes the required assets, components, and visual scripting setup.

Poison DoT (Damage Over Time)

A classic poison effect that deals periodic damage, stacks up to 5 times, and scales damage with stack count.

1. Create Category: "Debuffs"

  • • Type: Debuff
  • • Color: #FF4444 (red)

2. Create Effect: "Poison"

  • • Category: Debuffs
  • • Tags: dot, poison
  • • Duration: 5 seconds
  • • Has Tick:
  • • Tick Interval: 1 second
  • • Tick On Apply:
  • • Stacking Mode: RefreshAndStack
  • • Max Stacks: 5
  • • Scale With Stacks:
  • • Cleanse Type: Poison

3. Visual Scripting: Deal Damage on Tick

  1. Add Trigger to Player with Event: On Any Effect Ticked
  2. Add Condition: Has Effect → Poison
  3. Add Action: Change Attribute → Health, Subtract 10

With Scale With Stacks enabled, 5 stacks = 50 damage per tick

Shield Buff

A protective shield that absorbs damage and has a cooldown to prevent spam.

1. Create Effect: "Shield"

  • • Category: Buffs (Type: Buff)
  • • Duration: 10 seconds
  • • Stacking Mode: Refresh
  • • Has Cooldown:
  • • Cooldown Duration: 30 seconds
  • • Cooldown Starts On Apply:
  • • Apply VFX: Shield bubble prefab
  • • Apply Sound: Shield activation sound

2. Shield Logic (Code Example)

// On damage received, check for shield
var manager = GetComponent<StatusEffectManager>();
if (manager.HasEffect(shieldDefinition))
{
    // Absorb damage, maybe remove shield
    manager.RemoveEffect(shieldDefinition);
    return; // No damage taken
}
// Apply normal damage...
Cooldown Behavior: With "Cooldown Starts On Apply" enabled, the 30s cooldown begins immediately. The player must wait 20 seconds after the shield expires before reapplying.

Stun Effect

A crowd control effect that prevents actions, with brief immunity after to prevent chain-stunning.

1. Create Category: "Crowd Control"

  • • Type: CrowdControl
  • • Color: #FFAA00 (orange)
  • • Max Concurrent: 1 (only one CC at a time)

2. Create Effect: "Stun"

  • • Category: Crowd Control
  • • Duration: 2 seconds
  • • Stacking Mode: None
  • • Cleanse Type: Magic

3. Grant Immunity After Stun

  1. Add Trigger with Event: On Specific Effect Expired → Stun
  2. Add Action: Add Immunity (Effect) → Stun, 3 seconds

4. Disable Actions While Stunned

// In your action handler
if (manager.HasEffectCategoryType(EffectCategoryType.CrowdControl))
{
    Debug.Log("Cannot act while stunned!");
    return;
}

Boss Immunity Profile

Make boss enemies immune to crowd control while still allowing damage-over-time effects.

1. Create ImmunityProfile: "Boss"

  • • Immune Categories: Crowd Control
  • • Immune Tags: stun, root, silence

2. Assign to Boss

  1. Select Boss GameObject
  2. Find StatusEffectManager component
  3. Assign "Boss" profile to Immunity Profile field

3. Show "IMMUNE!" Feedback

  1. Add ImmunityFeedback component to Boss
  2. Configure floating text style
  3. Triggers automatically when effects are blocked

Stat Modifiers (GC2 Stats)

Create buffs that modify GC2 Stats while active. Requires GC2 Stats module.

1. Create Effect: "Strength Potion"

  • • Category: Buffs
  • • Duration: 60 seconds
  • • Stat Modifiers:
  • — Stat: Strength, Type: Constant, Value: +10

2. Setup StatsBridge

  1. Add StatsBridge component to character (alongside StatusEffectManager)
  2. Ensure character has GC2 Traits component
  3. Define GC2_STATS in Player Settings
Automatic! StatsBridge automatically applies modifiers when effects activate and removes them when effects end. No additional scripting needed.

Healing Aura Zone

Create a zone that continuously heals allies who stand in it.

1. Create Effect: "Regeneration"

  • • Category: Buffs
  • • Duration Mode: Permanent
  • • Has Tick:
  • • Tick Interval: 1 second

2. Create Healing Zone

  1. Create empty GameObject at zone location
  2. Add StatusEffectAura component
  3. Effect: Regeneration
  4. Radius: 5
  5. Target Mode: AlliesOnly
  6. Remove On Exit:

3. Heal on Tick

  1. Add Trigger with Event: On Any Effect Ticked
  2. Add Condition: Has Effect → Regeneration
  3. Add Action: Change Attribute → Health, Add 5

Cleanse System

Create different cleanse abilities that remove specific types of effects.

Effect Setup

Assign appropriate Cleanse Types to your effects:

  • • Poison, Bleed → Poison
  • • Curse, Hex → Curse
  • • Arcane Debuffs → Magic
  • • Wounds, Exhaustion → Physical
  • • Boss Debuffs → Undispellable

Cleanse Abilities

Antidote — Dispel by Cleanse Type: Poison
Dispel Magic — Dispel by Cleanse Type: Magic
Purify — Dispel by Cleanse Type: Any (removes everything except Undispellable)