From 599cd852d075c0fec031114c5f7a10507019c6c8 Mon Sep 17 00:00:00 2001 From: Nyx Date: Tue, 7 Oct 2025 13:41:34 -0600 Subject: [PATCH] fixing things --- .../Blueprints/BPC_PlayerStats.uasset | 4 ++-- .../Blueprints/BP_MagickPlayerState.uasset | 4 ++-- .../Blueprints/BP_PlayerController.uasset | 4 ++-- .../Content/MAIN_CONTENT/UI/WB_MainHUD.uasset | 4 ++-- .../Blueprints/BP_ThirdPersonCharacter.uasset | 4 ++-- .../Private/Attributes/HealthAttributeSet.cpp | 20 +++++++++++++++++++ .../Public/Attributes/HealthAttributeSet.h | 7 ++++++- .../Public/Attributes/LevelAttributeSet.h | 1 + .../Public/Attributes/StaminaAttributeSet.h | 2 +- .../Public/ElistriaAttributeSetBase.h | 1 - 10 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BPC_PlayerStats.uasset b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BPC_PlayerStats.uasset index 1a133bb..39386f2 100644 --- a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BPC_PlayerStats.uasset +++ b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BPC_PlayerStats.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87e7bcc1b80589f072e55d60e7547963d775b682da0848dac1cd8936ad5f2cb3 -size 661584 +oid sha256:c336f316b68227e1436bb2a9cdfee8b6a8bb38d1a919a0d298bfe31218c56133 +size 653503 diff --git a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_MagickPlayerState.uasset b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_MagickPlayerState.uasset index 95a633c..c5b6db7 100644 --- a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_MagickPlayerState.uasset +++ b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_MagickPlayerState.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:32c737068ad3102e827b56fc507ec6f09af31675de8b39bb5f5a9425bcbba782 -size 55159 +oid sha256:44e635069eba770b39cc2593a10e201b40f47e8d84e59d2963831ce381903fa7 +size 49867 diff --git a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_PlayerController.uasset b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_PlayerController.uasset index f84b3e1..9c57922 100644 --- a/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_PlayerController.uasset +++ b/Elistria_Calling/Content/MAIN_CONTENT/Blueprints/BP_PlayerController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b657eaa907256967eb6a9c092a2aaddfa2fc4a53e48e018fadf0e0c76d64ab6 -size 707950 +oid sha256:969ecde8698d0f7fb2796bf5c4cd52afb540f2788208f004af0d4b60c5052f68 +size 707992 diff --git a/Elistria_Calling/Content/MAIN_CONTENT/UI/WB_MainHUD.uasset b/Elistria_Calling/Content/MAIN_CONTENT/UI/WB_MainHUD.uasset index a39dea9..6189449 100644 --- a/Elistria_Calling/Content/MAIN_CONTENT/UI/WB_MainHUD.uasset +++ b/Elistria_Calling/Content/MAIN_CONTENT/UI/WB_MainHUD.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9193e9515e7be2abd80e87c1e5ae26b34acc4c3fa08a200e2183e4c74761a26 -size 134213 +oid sha256:5e102c291868bdd6dcf61acdccdd2849837e991c3e7a76eac25ac6aafb9b5fb0 +size 341438 diff --git a/Elistria_Calling/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset b/Elistria_Calling/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset index a921d14..92464ec 100644 --- a/Elistria_Calling/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset +++ b/Elistria_Calling/Content/ThirdPerson/Blueprints/BP_ThirdPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da40da021e32f6cc63b30a447fc40b587371ad7f5d8967eaf606b9621528bb7d -size 1511514 +oid sha256:6508bf757758e45ab9a6473c64e1875f8742b786534e42773f959d58a9f6fbfc +size 1449351 diff --git a/Elistria_Calling/Source/Elistria_Calling/Private/Attributes/HealthAttributeSet.cpp b/Elistria_Calling/Source/Elistria_Calling/Private/Attributes/HealthAttributeSet.cpp index 969b2f0..da14e18 100644 --- a/Elistria_Calling/Source/Elistria_Calling/Private/Attributes/HealthAttributeSet.cpp +++ b/Elistria_Calling/Source/Elistria_Calling/Private/Attributes/HealthAttributeSet.cpp @@ -66,3 +66,23 @@ void UHealthAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCall } } +void UHealthAttributeSet::PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) +{ + Super::PostAttributeChange(Attribute, OldValue, NewValue); + if (Attribute == GetHealthAttribute()) + { + const float ClampedHealth = FMath::Clamp(NewValue, 0.0f, GetMaxHealth()); + if (ClampedHealth != NewValue) + { + SetHealth(ClampedHealth); + } + } + if (Attribute == GetMaxHealthAttribute()) + { + const float ClampedMaxHealth = FMath::Max(1.0f, NewValue); + if (ClampedMaxHealth != NewValue) + { + SetMaxHealth(ClampedMaxHealth); + } + } +} \ No newline at end of file diff --git a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/HealthAttributeSet.h b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/HealthAttributeSet.h index 1340614..f0326e3 100644 --- a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/HealthAttributeSet.h +++ b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/HealthAttributeSet.h @@ -13,7 +13,8 @@ /** * */ - +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue, + float, NewValue); UCLASS() class ELISTRIA_CALLING_API UHealthAttributeSet : public UElistriaAttributeSetBase { @@ -24,6 +25,10 @@ public: virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override; + + + virtual void PostAttributeChange(const FGameplayAttribute& Attribute, float OldValue, float NewValue) override; + virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; UPROPERTY(VisibleAnywhere,BlueprintReadOnly,ReplicatedUsing=OnRep_Health) diff --git a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/LevelAttributeSet.h b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/LevelAttributeSet.h index af6f0b1..efe685d 100644 --- a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/LevelAttributeSet.h +++ b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/LevelAttributeSet.h @@ -13,6 +13,7 @@ /** * */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue, float, NewValue); UCLASS() class ELISTRIA_CALLING_API ULevelAttributeSet : public UElistriaAttributeSetBase { diff --git a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/StaminaAttributeSet.h b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/StaminaAttributeSet.h index 956a511..bee9076 100644 --- a/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/StaminaAttributeSet.h +++ b/Elistria_Calling/Source/Elistria_Calling/Public/Attributes/StaminaAttributeSet.h @@ -11,7 +11,7 @@ /** * */ - +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue, float, NewValue); UCLASS() class ELISTRIA_CALLING_API UStaminaAttributeSet : public UElistriaAttributeSetBase { diff --git a/Elistria_Calling/Source/Elistria_Calling/Public/ElistriaAttributeSetBase.h b/Elistria_Calling/Source/Elistria_Calling/Public/ElistriaAttributeSetBase.h index b351967..03ac048 100644 --- a/Elistria_Calling/Source/Elistria_Calling/Public/ElistriaAttributeSetBase.h +++ b/Elistria_Calling/Source/Elistria_Calling/Public/ElistriaAttributeSetBase.h @@ -15,7 +15,6 @@ GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \ GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName) -DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue, float, NewValue); UCLASS() class ELISTRIA_CALLING_API UElistriaAttributeSetBase : public UAttributeSet {