Skip to content

Passives C++ API

UBasePassive

Class: UBasePassiveSource/LesDeuxPelos/Public/Passives/BasePassive.h
Inherits: UActorComponent

Overview

A passive is a component attached to a character that fires automatically on a cooldown timer.
It spawns projectiles via Shoot() and supports 5 upgrade levels.

Enum: EPassiveTargetOverride

ValueDescription
OwnerTargetChainUses the character's targeting logic (default).
ClosestEnemyTargets the nearest enemy regardless of character logic.
ClosestAllyTargets the nearest ally.
StraightAheadFires in the owner's forward direction.

Properties

PropertyTypeDefaultDescription
Levelint0Current upgrade level. Starts at 1 after first UpgradePassive() call. Read-only.
CooldownTArray<float>Fire rate in seconds, one entry per level (5 total).
ProjectileBPTArray<TSubclassOf<ABaseProjectile>>Projectile Blueprint class per level.
IsTankPassivebooltrue = equipped on the tank character.
bIsParentedToOwnerboolfalseAttach spawned projectiles to the owner actor.
TargetOverrideEPassiveTargetOverrideOwnerTargetChainTargeting logic override.
CooldownWithStatsfloat0.1Effective cooldown after stat modifiers. Updated at runtime.

Methods

MethodAccessDescription
UpgradePassive()protected BlueprintCallableIncreases level by 1 (max 5). Restarts the timer with the new cooldown. Returns true on success.
Shoot()protected virtualCalled by the timer. Override in C++ or let Blueprint subclasses use ProjectileBP.
StartTimer()protectedInitialises the ShootTimerHandle. Called at BeginPlay.

UBaseAoE

Class: UBaseAoESource/LesDeuxPelos/Public/Passives/BaseAoE.h
Inherits: UBasePassive

Overview

An AoE passive that places an indicator mesh at the target location, waits, then damages all actors in the radius.

Properties

PropertyTypeDefaultDescription
AoEIndicatorMeshUStaticMesh*Mesh shown during the pre-damage delay.
AoEIndicatorMaterialUMaterialInterface*Material for the indicator.
DamageAmountint30Flat damage applied to all actors in range.
AttackRangefloat500AoE radius in Unreal units.
TimeToPopfloat1.0Delay (seconds) between indicator spawn and damage.
MakesCasterStopbooltrueStops caster movement while the AoE is active.

Methods

MethodAccessDescription
Shoot()public virtual overridePlaces the indicator and starts the TimeToPop timer.
ActivateAoE()publicCalled after TimeToPop — triggers ApplyDamageToActorsInAoE() and cleanup.
ApplyDamageToActorsInAoE()protectedSphere overlap at CurrentAoELocation with AttackRange, applies DamageAmount.

Blueprint usage