|
|
|
|
| #pragma once
|
|
|
| #include "GameplayEffectTypes.h"
|
|
|
| #include "LyraGameplayEffectContext.generated.h"
|
|
|
| class AActor;
|
| class FArchive;
|
| class ILyraAbilitySourceInterface;
|
| class UObject;
|
| class UPhysicalMaterial;
|
|
|
| USTRUCT()
|
| struct FLyraGameplayEffectContext : public FGameplayEffectContext
|
| {
|
| GENERATED_BODY()
|
|
|
| FLyraGameplayEffectContext()
|
| : FGameplayEffectContext()
|
| {
|
| }
|
|
|
| FLyraGameplayEffectContext(AActor* InInstigator, AActor* InEffectCauser)
|
| : FGameplayEffectContext(InInstigator, InEffectCauser)
|
| {
|
| }
|
|
|
|
|
| static LYRAGAME_API FLyraGameplayEffectContext* ExtractEffectContext(struct FGameplayEffectContextHandle Handle);
|
|
|
|
|
| void SetAbilitySource(const ILyraAbilitySourceInterface* InObject, float InSourceLevel);
|
|
|
|
|
| const ILyraAbilitySourceInterface* GetAbilitySource() const;
|
|
|
| virtual FGameplayEffectContext* Duplicate() const override
|
| {
|
| FLyraGameplayEffectContext* NewContext = new FLyraGameplayEffectContext();
|
| *NewContext = *this;
|
| if (GetHitResult())
|
| {
|
|
|
| NewContext->AddHitResult(*GetHitResult(), true);
|
| }
|
| return NewContext;
|
| }
|
|
|
| virtual UScriptStruct* GetScriptStruct() const override
|
| {
|
| return FLyraGameplayEffectContext::StaticStruct();
|
| }
|
|
|
|
|
| virtual bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) override;
|
|
|
|
|
| const UPhysicalMaterial* GetPhysicalMaterial() const;
|
|
|
| public:
|
|
|
| UPROPERTY()
|
| int32 CartridgeID = -1;
|
|
|
| protected:
|
|
|
| UPROPERTY()
|
| TWeakObjectPtr<const UObject> AbilitySourceObject;
|
| };
|
|
|
| template<>
|
| struct TStructOpsTypeTraits<FLyraGameplayEffectContext> : public TStructOpsTypeTraitsBase2<FLyraGameplayEffectContext>
|
| {
|
| enum
|
| {
|
| WithNetSerializer = true,
|
| WithCopy = true
|
| };
|
| };
|
|
|
|
|