FDamageSystem
- Module
- Game
- Header
#include "Gameplay/DamageSystem.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
FName | HealthAttribute | The attribute damage subtracts from (GAS path). |
float | ResolveAttackerScale | Attacker-side scale every weapon/melee hit multiplies in before the damage type multiplier: the attacker ASC's DamageMultiplier attribute (stats feed it through the derived-attribute effect), plus a crit roll — CritChance in [0,1] multiplies by CritMultiplier (2 when unset). |
TMulticastDelegate<const FDamageInfo&>& | OnAnyDamage | Process-wide broadcasts. |
TMulticastDelegate<const FDamageInfo&>& | OnAnyDeath | |
float | ApplyPointDamage | Simple path — drive a HealthComponent. |
float | ApplyPointDamageGAS | GAS path — apply an instant damage effect to the target ASC's Health attribute, fire impact/death cues, broadcast. |
std::vector<FRadialDamageResult> | ApplyRadialDamage | Radial blast — resolve falloff per target and apply (GAS path when a target has an ASC, otherwise the HealthComponent path). |
Function details
HealthAttribute
static FName HealthAttribute()The attribute damage subtracts from (GAS path).
ResolveAttackerScale
static float ResolveAttackerScale(AActor* attacker, bool* outCrit = nullptr)Attacker-side scale every weapon/melee hit multiplies in before the damage type multiplier: the attacker ASC's DamageMultiplier attribute (stats feed it through the derived-attribute effect), plus a crit roll — CritChance in [0,1] multiplies by CritMultiplier (2 when unset). An attacker without an ASC scales by exactly 1.
OnAnyDamage
static TMulticastDelegate<const FDamageInfo&>& OnAnyDamage()Process-wide broadcasts. A game / the editor / tests bind here.
OnAnyDeath
static TMulticastDelegate<const FDamageInfo&>& OnAnyDeath()ApplyPointDamage
static float ApplyPointDamage(HealthComponent& health, MObject* target, float baseDamage, const FHitResult& hit, const FDamageContext& context, const FDamageTypeInfo& type)Simple path — drive a HealthComponent. Returns the amount actually dealt.
ApplyPointDamageGAS
static float ApplyPointDamageGAS(AbilitySystemComponent& asc, MObject* target, float baseDamage, const FHitResult& hit, const FDamageContext& context, const FDamageTypeInfo& type)GAS path — apply an instant damage effect to the target ASC's Health attribute, fire impact/death cues, broadcast. Returns the amount dealt.
ApplyRadialDamage
static std::vector<FRadialDamageResult> ApplyRadialDamage(const FRadialDamageParams& params, const Vec3& origin, const std::vector<FRadialDamageTarget>& targets, const FDamageContext& context, const FDamageTypeInfo& type)Radial blast — resolve falloff per target and apply (GAS path when a target has an ASC, otherwise the HealthComponent path). Results are in input order.