GASATHON/Project/Source/Gasa/AbilitySystem/GasaEffectActor.h

79 lines
2.4 KiB
C
Raw Permalink Normal View History

2024-04-13 16:29:25 -07:00
#pragma once
#include "GasaCommon.h"
#include "Actors/GasaActor.h"
#include "ActiveGameplayEffectHandle.h"
#include "GameFramework/Actor.h"
2024-04-13 16:29:25 -07:00
#include "GasaEffectActor.generated.h"
2024-04-22 09:01:30 -07:00
struct FActiveGameplayEffectHandle;
2024-04-24 08:48:07 -07:00
UENUM(BlueprintType)
enum class EInstantEffectUsagePolicy : uint8
{
DoNotApply,
ApplyOnOverlap,
ApplyOnEndOverlap,
};
UENUM(BlueprintType, meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
2024-04-24 08:48:07 -07:00
enum class EEffectUsagePolicy : uint8
{
None = 0 UMETA(Hidden),
ApplyOnOverlap = bit(0),
ApplyOnEndOverlap = bit(1),
RemoveOnOverlap = bit(2),
RemoveOnEndOverlap = bit(3),
2024-04-24 08:48:07 -07:00
};
constexpr int32 DefaultEffectUsagePolicy = (int32(EEffectUsagePolicy::RemoveOnEndOverlap));
2024-04-24 08:48:07 -07:00
2024-04-13 16:29:25 -07:00
UCLASS()
class GASA_API AGasaEffectActor : public AGasaActor
2024-04-13 16:29:25 -07:00
{
GENERATED_BODY()
public:
2024-04-24 21:30:54 -07:00
AGasaEffectActor();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
float Level;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
2024-04-24 07:59:48 -07:00
TSubclassOf<UGameplayEffect> InstantEffectClass;
2024-04-24 08:48:07 -07:00
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
EInstantEffectUsagePolicy InstantEffectUsage;
2024-04-24 07:59:48 -07:00
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> DurationEffectClass;
2024-04-13 16:29:25 -07:00
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects", meta=(Bitmask, BitmaskEnum = "/Script/Gasa.EEffectUsagePolicy"))
2024-04-24 08:48:07 -07:00
int32 DurationEffectUsage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> InfiniteEffectClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects", meta=(Bitmask, BitmaskEnum = "/Script/Gasa.EEffectUsagePolicy"))
2024-04-24 08:48:07 -07:00
int32 InfiniteEffectUsage;
2024-04-24 08:48:07 -07:00
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
bool bDestroyOnEffectRemoval;
TMap<FActiveGameplayEffectHandle, UAbilitySystemComponent*> ActiveEffectsToRemove;
using ActiveEffectEntry = TTuple<FActiveGameplayEffectHandle, UAbilitySystemComponent*>;
2024-04-24 08:48:07 -07:00
FActiveGameplayEffectHandle ActiveDuration;
FActiveGameplayEffectHandle ActiveInfinite;
2024-04-24 21:30:54 -07:00
UFUNCTION(BlueprintCallable, Category = "Gameplay Effects")
void ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass, bool bRemoveOnEndOverlap = false);
2024-04-24 08:48:07 -07:00
UFUNCTION(BlueprintCallable)
void OnOverlap(AActor* Actor);
UFUNCTION(BlueprintCallable)
void OnEndOverlap(AActor* Actor);
2024-04-16 14:18:06 -07:00
};