Skip to content

Buffs C++ API

Class: UBaseBuffSource/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

PropertyTypeDefaultDescription
Durationfloat0.0Seconds the buff lasts. 0 = infinite (until owner destroyed).
IsBuffTickingboolfalseIf true, BuffTriggered() is called repeatedly on TickCooldown intervals.
TickCooldownfloat0.0Interval 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%.

PropertyTypeDefaultAffects
PassiveCooldownMultiplierfloat1.0Passive fire rate
MovementSpeedMultiplierfloat1.0Character movement speed
DamageResistanceMultiplierfloat1.0Damage received
HealingReceivedMultiplierfloat1.0Healing received
HealingDoneMultiplierfloat1.0Healing done
PassiveDamageMultiplierfloat1.0Damage dealt by passives

UI & Combo

PropertyTypeDescription
IconUTexture2D*Buff icon (128×128 recommended).
RequiredBuffsTArray<TSubclassOf<UBaseBuff>>Buff classes that must already be present on the owner for this buff to apply.

Methods

MethodAccessDescription
BeginPlay()protectedApplies stat modifiers to owner on start. Sets up tick timer if needed.
BuffTriggered()public virtualCalled every TickCooldown seconds when IsBuffTicking. Override in Blueprint or C++.
ResetStats()public BlueprintCallableReverses all stat changes applied by this buff. Called before removal.
GetRequiredBuffs()public constReturns 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 destroyed

Blueprint usage

Create a Blueprint child of UBaseBuff. See Create a Buff.