GASATHON/Project/Source/Gasa/AbilitySystem/GasaAttributeSet.h

169 lines
6.3 KiB
C
Raw Normal View History

2024-04-21 15:56:57 -07:00
// Generated by GasaGen/GasaGen_UGasaAttributeSet.cpp
#pragma once
2024-04-13 07:19:45 -07:00
#include "AttributeSet.h"
2024-04-13 07:19:45 -07:00
#include "GasaAttributeSet.generated.h"
UCLASS()
class GASA_API UGasaAttributeSet : public UAttributeSet
2024-04-13 07:19:45 -07:00
{
GENERATED_BODY()
public:
2024-04-24 15:18:26 -07:00
UGasaAttributeSet();
// Primary Attribute Fields
UPROPERTY( ReplicatedUsing = Client_OnRep_Strength, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Strength;
UPROPERTY( ReplicatedUsing = Client_OnRep_Intelligence, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Intelligence;
UPROPERTY( ReplicatedUsing = Client_OnRep_Resilience, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Resilience;
UPROPERTY( ReplicatedUsing = Client_OnRep_Vigor, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Vigor;
// Vital Attribute Fields
2024-04-24 21:30:54 -07:00
UPROPERTY( ReplicatedUsing = Client_OnRep_Health, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Health;
2024-04-24 21:30:54 -07:00
UPROPERTY( ReplicatedUsing = Client_OnRep_MaxHealth, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData MaxHealth;
2024-04-24 21:30:54 -07:00
UPROPERTY( ReplicatedUsing = Client_OnRep_Mana, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData Mana;
2024-04-24 21:30:54 -07:00
UPROPERTY( ReplicatedUsing = Client_OnRep_MaxMana, EditAnywhere, BlueprintReadWrite, Category = "Attributes" )
FGameplayAttributeData MaxMana;
UFUNCTION()
void Client_OnRep_Strength( FGameplayAttributeData& PrevStrength );
UFUNCTION()
void Client_OnRep_Intelligence( FGameplayAttributeData& PrevIntelligence );
UFUNCTION()
void Client_OnRep_Resilience( FGameplayAttributeData& PrevResilience );
UFUNCTION()
void Client_OnRep_Vigor( FGameplayAttributeData& PrevVigor );
UFUNCTION()
2024-04-24 21:30:54 -07:00
void Client_OnRep_Health( FGameplayAttributeData& PrevHealth );
UFUNCTION()
2024-04-24 21:30:54 -07:00
void Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth );
UFUNCTION()
2024-04-24 21:30:54 -07:00
void Client_OnRep_Mana( FGameplayAttributeData& PrevMana );
UFUNCTION()
2024-04-24 21:30:54 -07:00
void Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana );
#pragma region Getters
static FGameplayAttribute GetStrengthAttribute()
{
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Strength ) );
return Prop;
}
static FGameplayAttribute GetIntelligenceAttribute()
{
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Intelligence ) );
return Prop;
}
static FGameplayAttribute GetResilienceAttribute()
{
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Resilience ) );
return Prop;
}
static FGameplayAttribute GetVigorAttribute()
{
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Vigor ) );
return Prop;
}
static FGameplayAttribute GetHealthAttribute()
{
2024-04-24 21:30:54 -07:00
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Health ) );
return Prop;
}
static FGameplayAttribute GetMaxHealthAttribute()
{
2024-04-24 21:30:54 -07:00
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxHealth ) );
return Prop;
}
static FGameplayAttribute GetManaAttribute()
{
2024-04-24 21:30:54 -07:00
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Mana ) );
return Prop;
}
static FGameplayAttribute GetMaxManaAttribute()
{
2024-04-24 21:30:54 -07:00
static FProperty* Prop = FindFieldChecked<FProperty>( UGasaAttributeSet::StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxMana ) );
return Prop;
}
2024-04-21 15:56:57 -07:00
FORCEINLINE float GetStrength() const { return Strength.GetCurrentValue(); }
FORCEINLINE float GetIntelligence() const { return Intelligence.GetCurrentValue(); }
FORCEINLINE float GetResilience() const { return Resilience.GetCurrentValue(); }
FORCEINLINE float GetVigor() const { return Vigor.GetCurrentValue(); }
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 21:30:54 -07:00
#pragma endregion Getters
#pragma region Setters
2024-04-24 21:30:54 -07:00
FORCEINLINE void
SetStrength( float NewVal );
FORCEINLINE void SetIntelligence( float NewVal );
FORCEINLINE void SetResilience( float NewVal );
FORCEINLINE void SetVigor( float NewVal );
FORCEINLINE void SetHealth( float NewVal );
2024-04-24 21:30:54 -07:00
FORCEINLINE void SetMaxHealth( float NewVal );
FORCEINLINE void SetMana( float NewVal );
FORCEINLINE void SetMaxMana( float NewVal );
2024-04-21 15:56:57 -07:00
FORCEINLINE void InitStrength( float NewVal )
{
Strength.SetBaseValue( NewVal );
Strength.SetCurrentValue( NewVal );
}
FORCEINLINE void InitIntelligence( float NewVal )
{
Intelligence.SetBaseValue( NewVal );
Intelligence.SetCurrentValue( NewVal );
}
FORCEINLINE void InitResilience( float NewVal )
{
Resilience.SetBaseValue( NewVal );
Resilience.SetCurrentValue( NewVal );
}
FORCEINLINE void InitVigor( float NewVal )
{
Vigor.SetBaseValue( NewVal );
Vigor.SetCurrentValue( NewVal );
}
2024-04-24 21:30:54 -07:00
FORCEINLINE void InitHealth( float NewVal )
{
2024-04-24 21:30:54 -07:00
Health.SetBaseValue( NewVal );
Health.SetCurrentValue( NewVal );
}
2024-04-24 21:30:54 -07:00
FORCEINLINE void InitMaxHealth( float NewVal )
{
2024-04-24 21:30:54 -07:00
MaxHealth.SetBaseValue( NewVal );
MaxHealth.SetCurrentValue( NewVal );
}
2024-04-24 21:30:54 -07:00
FORCEINLINE void InitMana( float NewVal )
{
2024-04-24 21:30:54 -07:00
Mana.SetBaseValue( NewVal );
Mana.SetCurrentValue( NewVal );
}
2024-04-24 21:30:54 -07:00
FORCEINLINE void InitMaxMana( float NewVal )
{
2024-04-24 21:30:54 -07:00
MaxMana.SetBaseValue( NewVal );
MaxMana.SetCurrentValue( NewVal );
}
2024-04-24 21:30:54 -07:00
#pragma endregion Setters
2024-04-24 15:18:26 -07:00
#pragma region AttributeSet
2024-04-24 21:30:54 -07:00
void
PreAttributeChange( const FGameplayAttribute& Attribute, float& NewValue ) override;
void PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data ) override;
#pragma endregion AttributeSet
2024-04-24 15:18:26 -07:00
#pragma region UObject
2024-04-24 21:30:54 -07:00
void
GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const override;
#pragma endregion UObject
};