mirror of
https://github.com/Ed94/Cog.git
synced 2026-07-28 18:30:04 +00:00
add a new heroes push back abilities
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameplayEffectTypes.h"
|
||||
#include "Kismet/BlueprintFunctionLibrary.h"
|
||||
#include "CogSampleGameplayEffectContext.generated.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
USTRUCT(BlueprintType)
|
||||
struct FCogSampleGameplayEffectContextFloatValue
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual ~FCogSampleGameplayEffectContextFloatValue()
|
||||
{
|
||||
}
|
||||
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
FName Name;
|
||||
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
float Value = 0.0f;
|
||||
|
||||
virtual bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
template<>
|
||||
struct TStructOpsTypeTraits<FCogSampleGameplayEffectContextFloatValue> : public TStructOpsTypeTraitsBase2<FCogSampleGameplayEffectContextFloatValue>
|
||||
{
|
||||
enum
|
||||
{
|
||||
WithNetSerializer = true
|
||||
};
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
USTRUCT()
|
||||
struct FCogSampleGameplayEffectContext : public FGameplayEffectContext
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
FCogSampleGameplayEffectContext()
|
||||
: FGameplayEffectContext()
|
||||
{
|
||||
}
|
||||
|
||||
FCogSampleGameplayEffectContext(AActor* InInstigator, AActor* InEffectCauser)
|
||||
: FGameplayEffectContext(InInstigator, InEffectCauser)
|
||||
{
|
||||
}
|
||||
|
||||
/** Returns the wrapped FGPCoreGameplayEffectContext from the handle, or nullptr if it doesn't exist or is the wrong type */
|
||||
static FCogSampleGameplayEffectContext* ExtractEffectContext(struct FGameplayEffectContextHandle Handle);
|
||||
|
||||
virtual UScriptStruct* GetScriptStruct() const override;
|
||||
|
||||
virtual FCogSampleGameplayEffectContext* Duplicate() const override;
|
||||
|
||||
virtual bool NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess) override;
|
||||
|
||||
bool CanGameplayCueBePredicted();
|
||||
|
||||
/* REPLICATED */
|
||||
UPROPERTY()
|
||||
TArray<FCogSampleGameplayEffectContextFloatValue> FloatValues;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
template<>
|
||||
struct TStructOpsTypeTraits<FCogSampleGameplayEffectContext> : public TStructOpsTypeTraitsBase2<FCogSampleGameplayEffectContext>
|
||||
{
|
||||
enum
|
||||
{
|
||||
WithNetSerializer = true,
|
||||
WithCopy = true
|
||||
};
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
UCLASS(meta = (ScriptName = "CogSampleEffectContextLibrary"))
|
||||
class UCogSampleEffectContextLibrary : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
static void EffectContextSetFloatValue(FGameplayEffectContextHandle EffectContext, FName Name, float Value);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
static void EffectContextGetFloatValue(FGameplayEffectContextHandle EffectContext, FName Name, float& Value, bool& Found);
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
static void EffectContextGetAllFloatValues(FGameplayEffectContextHandle EffectContext, TArray<FCogSampleGameplayEffectContextFloatValue>& Entries);
|
||||
};
|
||||
Reference in New Issue
Block a user