Buff Manager
Last updated
Was this helpful?
Last updated
Was this helpful?
The Buff Manager (AC_BuffManager) component is responsible for managing buffs that can be applied to the player, typically gained from items or triggered gameplay events. Unlike the AC_StatusEffectManager, which tracks status effects like poison or burning, buffs are generally positive or neutral enhancements such as temporary stat boosts, increased movement speed, or resistance effects.
This component ensures that buffs are correctly applied & removed, preventing issues such as duplication or persistence after loading from save data.
It is added to the Base Character class by default (B_Base_Character).
Adding Buffs
When an item grants a buff, the TryAddBuff() method is called. This method loads and creates an instance for the Buff Object. It ensures that effect duplication does not happen while loading from a save.
Removing Buffs
Buffs can be removed through various functions:
RemoveBuffOfType() → Removes a single buff of a specified type.
RemoveAllBuffsOfType() → Removes all active buffs of a given type.
RemoveBuffWithTag() → Removes a buff using a gameplay tag reference.
RemoveAllBuffsWithTag() → Removes all instances of the buffs associated with a gameplay tag.
Buffs are removed either immediately or through a delayed removal system. The delayed method ensures that no race conditions occur.
UI & Widget Integration
Whenever a buff is added or removed, the OnBuffDetected dispatcher fires, allowing connected UI elements (e.g., buff icons) to update accordingly.