50 lines
1.5 KiB
C++
50 lines
1.5 KiB
C++
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameplayEffect.h"
|
|
#include "OLSGameplayEffect.generated.h"
|
|
|
|
USTRUCT()
|
|
struct OLS_API FOLSDynamicGameplayEffectData
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
// The magnitude or efficacy of the gameplay effect.
|
|
FGameplayEffectModifierMagnitude EffectMagnitude = FScalableFloat(1.f);
|
|
|
|
// The attribute to which the gameplay effect will be applied.
|
|
FGameplayAttribute AffectedAttribute = {};
|
|
|
|
// The gameplay effect's name.
|
|
FName EffectName = FName(TEXT("EffectName"));
|
|
|
|
// A pointer to the ability system component to which the gameplay effect will be applied.
|
|
TWeakObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
|
|
|
|
// The manner in which the gameplay effect will be applied (additive, multiplicative, etc.).
|
|
TEnumAsByte<EGameplayModOp::Type> EffectModifierOpType = EGameplayModOp::Additive;
|
|
|
|
// The level of the gameplay effect, which may in part determine its efficacy.
|
|
float EffectLevel = 1.f;
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class OLS_API UOLSGameplayEffect : public UGameplayEffect
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
/**
|
|
* Applies a dynamic gameplay effect at runtime, and in accordance with the passed FTowersDynamicGameplayEffectData.
|
|
* @param data - struct containing all of the relevant data by which the dynamic gameplay effect may be applied.
|
|
*/
|
|
static void ApplyDynamicGameplayEffect(const FOLSDynamicGameplayEffectData& data);
|
|
};
|