2024-04-21 15:56:57 -07:00
|
|
|
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
|
|
|
|
#pragma once
|
2024-04-13 07:19:45 -07:00
|
|
|
|
2024-04-13 13:18:57 -07:00
|
|
|
#include "AttributeSet.h"
|
2024-04-13 07:19:45 -07:00
|
|
|
#include "GasaAttributeSet.generated.h"
|
|
|
|
|
2024-04-21 06:51:51 -07:00
|
|
|
UCLASS()
|
|
|
|
class GASA_API UGasaAttributeSet : public UAttributeSet
|
2024-04-13 07:19:45 -07:00
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
2024-04-24 17:18:38 -07:00
|
|
|
|
2024-04-13 07:19:45 -07:00
|
|
|
public:
|
2024-04-24 15:18:26 -07:00
|
|
|
UGasaAttributeSet();
|
|
|
|
|
2024-04-24 17:18:38 -07:00
|
|
|
UPROPERTY(ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes")
|
2024-04-13 13:18:57 -07:00
|
|
|
FGameplayAttributeData Health;
|
2024-04-24 17:18:38 -07:00
|
|
|
UPROPERTY(ReplicatedUsing = Client_OnRep_MaxHealth, EditAnywhere, BlueprintReadWrite, Category = "Attributes")
|
2024-04-13 13:18:57 -07:00
|
|
|
FGameplayAttributeData MaxHealth;
|
2024-04-24 17:18:38 -07:00
|
|
|
UPROPERTY(ReplicatedUsing = Client_OnRep_Mana, EditAnywhere, BlueprintReadWrite, Category = "Attributes")
|
2024-04-13 13:18:57 -07:00
|
|
|
FGameplayAttributeData Mana;
|
2024-04-24 17:18:38 -07:00
|
|
|
UPROPERTY(ReplicatedUsing = Client_OnRep_MaxMana, EditAnywhere, BlueprintReadWrite, Category = "Attributes")
|
2024-04-13 13:18:57 -07:00
|
|
|
FGameplayAttributeData MaxMana;
|
|
|
|
|
|
|
|
UFUNCTION()
|
2024-04-24 17:18:38 -07:00
|
|
|
void Client_OnRep_Health(FGameplayAttributeData& PrevHealth);
|
2024-04-13 13:18:57 -07:00
|
|
|
UFUNCTION()
|
2024-04-24 17:18:38 -07:00
|
|
|
void Client_OnRep_MaxHealth(FGameplayAttributeData& PrevMaxHealth);
|
2024-04-13 13:18:57 -07:00
|
|
|
UFUNCTION()
|
2024-04-24 17:18:38 -07:00
|
|
|
void Client_OnRep_Mana(FGameplayAttributeData& PrevMana);
|
2024-04-13 13:18:57 -07:00
|
|
|
UFUNCTION()
|
2024-04-24 17:18:38 -07:00
|
|
|
void Client_OnRep_MaxMana(FGameplayAttributeData& PrevMaxMana);
|
2024-04-13 13:18:57 -07:00
|
|
|
|
2024-04-13 15:35:19 -07:00
|
|
|
#pragma region Getters
|
|
|
|
static FGameplayAttribute GetHealthAttribute()
|
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
static FProperty* Prop = FindFieldChecked<FProperty>(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Health));
|
2024-04-13 15:35:19 -07:00
|
|
|
return Prop;
|
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
2024-04-13 15:35:19 -07:00
|
|
|
static FGameplayAttribute GetMaxHealthAttribute()
|
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
static FProperty* Prop = FindFieldChecked<FProperty>(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxHealth));
|
2024-04-13 15:35:19 -07:00
|
|
|
return Prop;
|
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
2024-04-13 15:35:19 -07:00
|
|
|
static FGameplayAttribute GetManaAttribute()
|
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
static FProperty* Prop = FindFieldChecked<FProperty>(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, Mana));
|
2024-04-13 15:35:19 -07:00
|
|
|
return Prop;
|
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
2024-04-13 15:35:19 -07:00
|
|
|
static FGameplayAttribute GetMaxManaAttribute()
|
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
static FProperty* Prop = FindFieldChecked<FProperty>(UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED(UGasaAttributeSet, MaxMana));
|
2024-04-13 15:35:19 -07:00
|
|
|
return Prop;
|
|
|
|
}
|
2024-04-21 15:56:57 -07:00
|
|
|
|
2024-04-21 06:51:51 -07:00
|
|
|
FORCEINLINE float GetHealth() const { return Health.GetCurrentValue(); }
|
|
|
|
FORCEINLINE float GetMaxHealth() const { return MaxHealth.GetCurrentValue(); }
|
|
|
|
FORCEINLINE float GetMana() const { return Mana.GetCurrentValue(); }
|
|
|
|
FORCEINLINE float GetMaxMana() const { return MaxMana.GetCurrentValue(); }
|
2024-04-24 17:18:38 -07:00
|
|
|
#pragma endregion Getters
|
2024-04-13 15:35:19 -07:00
|
|
|
|
|
|
|
#pragma region Setters
|
2024-04-24 17:18:38 -07:00
|
|
|
FORCEINLINE void SetHealth(float NewVal);
|
|
|
|
FORCEINLINE void SetMaxHealth(float NewVal);
|
|
|
|
FORCEINLINE void SetMana(float NewVal);
|
|
|
|
FORCEINLINE void SetMaxMana(float NewVal);
|
2024-04-21 15:56:57 -07:00
|
|
|
|
2024-04-24 17:18:38 -07:00
|
|
|
FORCEINLINE void InitHealth(float NewVal)
|
2024-04-13 15:35:19 -07:00
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
Health.SetBaseValue(NewVal);
|
|
|
|
Health.SetCurrentValue(NewVal);
|
2024-04-13 15:35:19 -07:00
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
|
|
|
FORCEINLINE void InitMaxHealth(float NewVal)
|
2024-04-13 15:35:19 -07:00
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
MaxHealth.SetBaseValue(NewVal);
|
|
|
|
MaxHealth.SetCurrentValue(NewVal);
|
2024-04-13 15:35:19 -07:00
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
|
|
|
FORCEINLINE void InitMana(float NewVal)
|
2024-04-13 15:35:19 -07:00
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
Mana.SetBaseValue(NewVal);
|
|
|
|
Mana.SetCurrentValue(NewVal);
|
2024-04-13 15:35:19 -07:00
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
|
|
|
|
FORCEINLINE void InitMaxMana(float NewVal)
|
2024-04-13 15:35:19 -07:00
|
|
|
{
|
2024-04-24 17:18:38 -07:00
|
|
|
MaxMana.SetBaseValue(NewVal);
|
|
|
|
MaxMana.SetCurrentValue(NewVal);
|
2024-04-13 15:35:19 -07:00
|
|
|
}
|
2024-04-24 17:18:38 -07:00
|
|
|
#pragma endregion Setters
|
2024-04-13 15:35:19 -07:00
|
|
|
|
2024-04-24 15:18:26 -07:00
|
|
|
#pragma region AttributeSet
|
2024-04-24 17:18:38 -07:00
|
|
|
void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override;
|
|
|
|
void PostGameplayEffectExecute(FGameplayEffectModCallbackData const& Data) override;
|
2024-04-24 15:18:26 -07:00
|
|
|
#pragma endregion AttributeSet
|
|
|
|
|
2024-04-13 13:18:57 -07:00
|
|
|
#pragma region UObject
|
2024-04-24 17:18:38 -07:00
|
|
|
void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
2024-04-13 13:18:57 -07:00
|
|
|
#pragma endregion UObject
|
|
|
|
};
|