Add more abilities in the sample

This commit is contained in:
Arnaud Jamin
2023-10-05 16:57:43 -04:00
parent e952256b98
commit 25f2e06400
83 changed files with 966 additions and 356 deletions
@@ -11,9 +11,6 @@ UCogSampleAttributeSet_Health::UCogSampleAttributeSet_Health()
InitMaxHealth(1000.0f);
InitHealth(1000.0f);
InitHealthRegen(10.0f);
InitMaxArmor(500.f);
InitArmorRegen(0.f);
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -34,24 +31,6 @@ void UCogSampleAttributeSet_Health::OnRep_HealthRegen(const FGameplayAttributeDa
GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, HealthRegen, PrevHealthRegen);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAttributeSet_Health::OnRep_Armor(const FGameplayAttributeData& PrevArmor)
{
GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, Armor, PrevArmor);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAttributeSet_Health::OnRep_MaxArmor(const FGameplayAttributeData& PrevMaxArmor)
{
GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, MaxArmor, PrevMaxArmor);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAttributeSet_Health::OnRep_ArmorRegen(const FGameplayAttributeData& PrevArmorRegen)
{
GAMEPLAYATTRIBUTE_REPNOTIFY(UCogSampleAttributeSet_Health, ArmorRegen, PrevArmorRegen);
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleAttributeSet_Health::OnRep_DamageResistance(const FGameplayAttributeData& PrevDamageResistance)
{
@@ -70,9 +49,6 @@ void UCogSampleAttributeSet_Health::GetLifetimeReplicatedProps(TArray<class FLif
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, Health, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, MaxHealth, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, HealthRegen, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, Armor, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, MaxArmor, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, ArmorRegen, Params);
DOREPLIFETIME_WITH_PARAMS_FAST(UCogSampleAttributeSet_Health, DamageResistance, Params);
}
@@ -99,10 +75,6 @@ void UCogSampleAttributeSet_Health::PostAttributeChange(const FGameplayAttribute
{
UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(GetOwningAbilitySystemComponent(), Health, OldValue, NewValue, GetHealthAttribute());
}
else if (Attribute == GetMaxArmorAttribute())
{
UCogSampleFunctionLibrary_Gameplay::AdjustAttributeForMaxChange(GetOwningAbilitySystemComponent(), Armor, OldValue, NewValue, GetArmorAttribute());
}
else
{
ClampAttributes(Attribute, NewValue);
@@ -138,8 +110,4 @@ void UCogSampleAttributeSet_Health::ClampAttributes(const FGameplayAttribute& At
{
NewValue = FMath::Clamp(NewValue, 0.0f, GetMaxHealth());
}
else if (Attribute == GetArmorAttribute())
{
NewValue = FMath::Clamp(NewValue, 0.0f, GetMaxArmor());
}
}