Skip to content

Commit

Permalink
Custom Gameplay Effect Context
Browse files Browse the repository at this point in the history
  • Loading branch information
apchavan committed Dec 25, 2024
1 parent efb61bc commit cdce6c3
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Aura/Private/AuraAbilityTypes.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#include "AuraAbilityTypes.h"


bool FAuraGameplayEffectContext::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
{
return true;
}
37 changes: 37 additions & 0 deletions Source/Aura/Public/AuraAbilityTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

#pragma once

#include "GameplayEffectTypes.h"
#include "AuraAbilityTypes.generated.h"


USTRUCT(BlueprintType)
struct FAuraGameplayEffectContext : public FGameplayEffectContext
{
GENERATED_BODY()

public:

bool IsBlockedHit() const { return bIsBlockedHit; }
bool IsCriticalHit() const { return bIsCriticalHit; }

void SetIsBlockedHit(bool bInIsBlockedHit) { bIsBlockedHit = bInIsBlockedHit; }
void SetIsCriticalHit(bool bInIsCriticalHit) { bIsCriticalHit = bInIsCriticalHit; }

/** Returns the actual struct used for serialization, subclasses must override this! */
virtual UScriptStruct* GetScriptStruct() const override
{
return FGameplayEffectContext::StaticStruct();
}

/** Custom serialization, subclasses must override this */
virtual bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) override;

protected:

UPROPERTY()
bool bIsBlockedHit = false;

UPROPERTY()
bool bIsCriticalHit = false;
};

0 comments on commit cdce6c3

Please sign in to comment.