42. Infinite Gameplay Effects

This commit is contained in:
Edward R. Gonzalez 2024-04-24 11:48:07 -04:00
parent bd0c8a0878
commit f17c53a1a9
12 changed files with 71 additions and 7 deletions

Binary file not shown.

BIN
Project/Content/Core/AbilitySystem/GE_AreaFire.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Project/Content/Core/BP_AreaFire.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Project/Content/Core/BP_AreaFire_RawEffect.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Project/Content/Core/Pickups/BP_ManaCrystal_RawEffect.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Project/Content/Levels/StartupMap.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -8,6 +8,10 @@ AGasaEffectActor::AGasaEffectActor()
PrimaryActorTick.bCanEverTick = false;
RootComponent = CreateDefaultSubobject<USceneComponent>("Root");
InstantEffectUsage = DefaultEffectUsagePolicy;
DurationEffectUsage = DefaultEffectUsagePolicy;
InfiniteEffectUsage = DefaultEffectUsagePolicy;
}
void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass)
@ -21,3 +25,11 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEf
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context );
AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
}
void AGasaEffectActor::OnOverlap(AActor* Actor)
{
}
void AGasaEffectActor::OnEndOverlap(AActor* Actor)
{
}

View File

@ -6,6 +6,20 @@
#include "GasaEffectActor.generated.h"
UENUM(BlueprintType)
enum class EEffectUsagePolicy : uint8
{
None = 0 UMETA(Hidden),
ApplyOnOverlap = bit(0),
ApplyOnEndOverlap = bit(1),
DoNotApply = bit(2),
RemoveOnOverlap = bit(3),
RemoveOnEndOverlap = bit(4),
DoNotRemove = bit(5),
};
constexpr int32 DefaultEffectUsagePolicy = (int32(EEffectUsagePolicy::DoNotApply) | int32(EEffectUsagePolicy::RemoveOnEndOverlap));
UCLASS()
class GASA_API AGasaEffectActor : public AGasaActor
{
@ -15,12 +29,33 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> InstantEffectClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects", meta=(Bitmask, BitmaskEnum = EEffectUsagePolicy))
int32 InstantEffectUsage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> DurationEffectClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects", meta=(Bitmask, BitmaskEnum = EEffectUsagePolicy))
int32 DurationEffectUsage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
TSubclassOf<UGameplayEffect> InfiniteEffectClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects", meta=(Bitmask, BitmaskEnum = EEffectUsagePolicy))
int32 InfiniteEffectUsage;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Gameplay Effects")
bool bDestroyOnEffectRemoval = false;
AGasaEffectActor();
UFUNCTION(BlueprintCallable, Category = "Gameplay Effects")
void ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass );
UFUNCTION(BlueprintCallable)
void OnOverlap(AActor* Actor);
UFUNCTION(BlueprintCallable)
void OnEndOverlap(AActor* Actor);
};

View File

@ -13,6 +13,8 @@
#define rcast( Type, Value ) reinterpret_cast<Type>( Value )
#define scast( Type, Value ) static_cast<Type>( Value )
#define bit(position) (1 << position)
#pragma region Math
#define m_pow2( value ) (value * value)
#pragma endregion Math