295 lines
13 KiB
C++
295 lines
13 KiB
C++
// Generated by GasaEditor/GasaGen/GasaGen_AttributeSets.cpp
|
|
#include "GasaAttributeSet.h"
|
|
#include "GasaAttributeSet_Inlines.h"
|
|
#include "EffectProperties.h"
|
|
|
|
#include "AbilitySystemComponent.h"
|
|
#include "Net/UnrealNetwork.h"
|
|
#include "Networking/GasaNetLibrary.h"
|
|
#include "GameplayEffectExtension.h"
|
|
|
|
UGasaAttributeSet::UGasaAttributeSet() {}
|
|
|
|
#pragma region Rep Notifies
|
|
void UGasaAttributeSet::Client_OnRep_Health( FGameplayAttributeData& PrevHealth )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Health ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Health, PrevHealth );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Mana( FGameplayAttributeData& PrevMana )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Mana ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Mana, PrevMana );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Strength( FGameplayAttributeData& PrevStrength )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Strength ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Strength, PrevStrength );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Intelligence( FGameplayAttributeData& PrevIntelligence )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Intelligence ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), Intelligence, PrevIntelligence
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Resilience( FGameplayAttributeData& PrevResilience )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Resilience ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), Resilience, PrevResilience
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Vigor( FGameplayAttributeData& PrevVigor )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Vigor ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Vigor, PrevVigor );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_MaxHealth( FGameplayAttributeData& PrevMaxHealth )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxHealth ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), MaxHealth, PrevMaxHealth );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_MaxMana( FGameplayAttributeData& PrevMaxMana )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, MaxMana ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), MaxMana, PrevMaxMana );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_Armor( FGameplayAttributeData& PrevArmor )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, Armor ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication( FGameplayAttribute( UGasaAttributeSetProperty ), Armor, PrevArmor );
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_ArmorPenentration( FGameplayAttributeData& PrevArmorPenentration )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, ArmorPenentration ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), ArmorPenentration, PrevArmorPenentration
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_BlockChance( FGameplayAttributeData& PrevBlockChance )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, BlockChance ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), BlockChance, PrevBlockChance
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_CriticalHitChance( FGameplayAttributeData& PrevCriticalHitChance )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, CriticalHitChance ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), CriticalHitChance, PrevCriticalHitChance
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_CriticalHitDamage( FGameplayAttributeData& PrevCriticalHitDamage )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, CriticalHitDamage ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), CriticalHitDamage, PrevCriticalHitDamage
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_CriticalHitResistance( FGameplayAttributeData& PrevCriticalHitResistance )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty =
|
|
FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, CriticalHitResistance ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), CriticalHitResistance, PrevCriticalHitResistance
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_HealthRegeneration( FGameplayAttributeData& PrevHealthRegeneration )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty =
|
|
FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, HealthRegeneration ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), HealthRegeneration, PrevHealthRegeneration
|
|
);
|
|
}
|
|
void UGasaAttributeSet::Client_OnRep_ManaRegeneration( FGameplayAttributeData& PrevManaRegeneration )
|
|
{
|
|
// From GAMEPLAYATTRIBUTE_REPNOTIFY
|
|
static FProperty* UGasaAttributeSetProperty = FindFieldChecked<FProperty>( StaticClass(), GET_MEMBER_NAME_CHECKED( UGasaAttributeSet, ManaRegeneration ) );
|
|
GetOwningAbilitySystemComponentChecked()->SetBaseAttributeValueFromReplication(
|
|
FGameplayAttribute( UGasaAttributeSetProperty ), ManaRegeneration, PrevManaRegeneration
|
|
);
|
|
}
|
|
#pragma endregion Rep Notifies
|
|
|
|
void UGasaAttributeSet::PostGameplayEffectExecute( FGameplayEffectModCallbackData const& Data )
|
|
{
|
|
Super::PostGameplayEffectExecute( Data );
|
|
FEffectProperties Props;
|
|
Props.Populate( Data );
|
|
|
|
if ( Data.EvaluatedData.Attribute == GetHealthAttribute() )
|
|
{
|
|
SetHealth( FMath::Clamp( GetHealth(), 0, 300.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetManaAttribute() )
|
|
{
|
|
SetMana( FMath::Clamp( GetMana(), 0, GetMaxMana() ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetStrengthAttribute() )
|
|
{
|
|
SetStrength( FMath::Clamp( GetStrength(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetIntelligenceAttribute() )
|
|
{
|
|
SetIntelligence( FMath::Clamp( GetIntelligence(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetResilienceAttribute() )
|
|
{
|
|
SetResilience( FMath::Clamp( GetResilience(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetVigorAttribute() )
|
|
{
|
|
SetVigor( FMath::Clamp( GetVigor(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetMaxHealthAttribute() )
|
|
{
|
|
SetMaxHealth( FMath::Clamp( GetMaxHealth(), 0, 99999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetMaxManaAttribute() )
|
|
{
|
|
SetMaxMana( FMath::Clamp( GetMaxMana(), 0, 99999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetArmorAttribute() )
|
|
{
|
|
SetArmor( FMath::Clamp( GetArmor(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetArmorPenentrationAttribute() )
|
|
{
|
|
SetArmorPenentration( FMath::Clamp( GetArmorPenentration(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetBlockChanceAttribute() )
|
|
{
|
|
SetBlockChance( FMath::Clamp( GetBlockChance(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetCriticalHitChanceAttribute() )
|
|
{
|
|
SetCriticalHitChance( FMath::Clamp( GetCriticalHitChance(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetCriticalHitDamageAttribute() )
|
|
{
|
|
SetCriticalHitDamage( FMath::Clamp( GetCriticalHitDamage(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetCriticalHitResistanceAttribute() )
|
|
{
|
|
SetCriticalHitResistance( FMath::Clamp( GetCriticalHitResistance(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetHealthRegenerationAttribute() )
|
|
{
|
|
SetHealthRegeneration( FMath::Clamp( GetHealthRegeneration(), 0, 999.000000 ) );
|
|
}
|
|
if ( Data.EvaluatedData.Attribute == GetManaRegenerationAttribute() )
|
|
{
|
|
SetManaRegeneration( FMath::Clamp( GetManaRegeneration(), 0, 999.000000 ) );
|
|
}
|
|
}
|
|
|
|
void UGasaAttributeSet::PreAttributeChange( FGameplayAttribute const& Attribute, float& NewValue )
|
|
{
|
|
Super::PreAttributeChange( Attribute, NewValue );
|
|
|
|
if ( Attribute == GetHealthAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 300.000000 );
|
|
}
|
|
if ( Attribute == GetManaAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, GetMaxMana() );
|
|
}
|
|
if ( Attribute == GetStrengthAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetIntelligenceAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetResilienceAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetVigorAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetMaxHealthAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 99999.000000 );
|
|
}
|
|
if ( Attribute == GetMaxManaAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 99999.000000 );
|
|
}
|
|
if ( Attribute == GetArmorAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetArmorPenentrationAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetBlockChanceAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetCriticalHitChanceAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetCriticalHitDamageAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetCriticalHitResistanceAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetHealthRegenerationAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
if ( Attribute == GetManaRegenerationAttribute() )
|
|
{
|
|
NewValue = FMath::Clamp( NewValue, 0, 999.000000 );
|
|
}
|
|
}
|
|
|
|
void UGasaAttributeSet::GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const
|
|
{
|
|
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
|
|
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Health );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Mana );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Strength );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Intelligence );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Resilience );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Vigor );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxHealth );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, MaxMana );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, Armor );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, ArmorPenentration );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, BlockChance );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, CriticalHitChance );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, CriticalHitDamage );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, CriticalHitResistance );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, HealthRegeneration );
|
|
DOREPLIFETIME_DEFAULT_GAS( UGasaAttributeSet, ManaRegeneration );
|
|
}
|