Buffs C++ API
Class: UBaseBuff — Source/LesDeuxPelos/Public/Buffs/BaseBuff.h
Inherits: UActorComponent
Overview
A buff is a component added to a character at runtime that modifies its stats.
Applied via ALesDeuxPelosCharacter::AddBuff(), removed via RemoveBuff().
Properties
Timing
| Property | Type | Default | Description |
|---|---|---|---|
Duration | float | 0.0 | Seconds the buff lasts. 0 = infinite (until owner destroyed). |
IsBuffTicking | bool | false | If true, BuffTriggered() is called repeatedly on TickCooldown intervals. |
TickCooldown | float | 0.0 | Interval between ticks (seconds). Used only when IsBuffTicking = true. |
Stat multipliers
All multipliers are multiplicative on the owner's existing modifier.1.0 = no change. 1.1 = +10%. 0.9 = −10%.
| Property | Type | Default | Affects |
|---|---|---|---|
PassiveCooldownMultiplier | float | 1.0 | Passive fire rate |
MovementSpeedMultiplier | float | 1.0 | Character movement speed |
DamageResistanceMultiplier | float | 1.0 | Damage received |
HealingReceivedMultiplier | float | 1.0 | Healing received |
HealingDoneMultiplier | float | 1.0 | Healing done |
PassiveDamageMultiplier | float | 1.0 | Damage dealt by passives |
UI & Combo
| Property | Type | Description |
|---|---|---|
Icon | UTexture2D* | Buff icon (128×128 recommended). |
RequiredBuffs | TArray<TSubclassOf<UBaseBuff>> | Buff classes that must already be present on the owner for this buff to apply. |
Methods
| Method | Access | Description |
|---|---|---|
BeginPlay() | protected | Applies stat modifiers to owner on start. Sets up tick timer if needed. |
BuffTriggered() | public virtual | Called every TickCooldown seconds when IsBuffTicking. Override in Blueprint or C++. |
ResetStats() | public BlueprintCallable | Reverses all stat changes applied by this buff. Called before removal. |
GetRequiredBuffs() | public const | Returns RequiredBuffs. |
Lifecycle
AddBuff(BP_Buff) called on character
→ Component created and attached
→ BeginPlay: stat modifiers applied to owner
→ if IsBuffTicking: timer starts calling BuffTriggered()
→ TickComponent: tracks Lifetime vs Duration
→ Duration reached → RemoveBuff called → ResetStats() → component destroyedBlueprint usage
Create a Blueprint child of UBaseBuff. See Create a Buff.