Auto stash before rebase of "main" onto "main/main"

This commit is contained in:
Bryce Douglas Olcott
2025-10-14 10:45:32 -06:00
parent 2b794e6836
commit 5138042732
8 changed files with 21 additions and 8 deletions

View File

@@ -48,8 +48,12 @@ void ULevelAttributeSet::ConsumeXPGain()
const float Gain = GetXPGain();
if (Gain > 0.0f)
{
SetXP(GetXP() + Gain);
float OldXP = GetXP();
float NewXP =OldXP + Gain;
SetXP(NewXP);
SetXPGain(0.0f);
OnXPChanged.Broadcast(this, GetXP(), Gain);
OnLevelChanged.Broadcast(this, GetXP()-Gain, Level.GetCurrentValue());
}
}
@@ -108,5 +112,6 @@ void ULevelAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallb
SetLevel(static_cast<float>(Lvl));
SetXP(FMath::Clamp(GetXP(),0.0f,ComputeXPForLevel(Lvl)));
SetXPToNextLevel(ComputeXPForLevel(Lvl));
OnXPToNextLevelChanged.Broadcast(this, OldValue.GetCurrentValue(), XPToNextLevel.GetCurrentValue());
}
}

View File

@@ -38,6 +38,7 @@ void UManaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallba
if (Data.EvaluatedData.Attribute == GetManaAttribute())
{
SetMana(FMath::Clamp(GetMana(), 0.0f, GetMaxMana()));
;
}
if (Data.EvaluatedData.Attribute == GetCostAttribute())
{
@@ -48,7 +49,9 @@ void UManaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallba
if (OldMana!=NewMana)
{
SetMana(NewMana);
OnManaChanged.Broadcast(this, OldMana, NewMana);
}
OnManaChanged.Broadcast(this, OldMana, NewMana);
SetCost(0.0f);
}
if (Data.EvaluatedData.Attribute==GetRestoreAttribute())
@@ -60,7 +63,9 @@ void UManaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCallba
if (OldMana!=NewMana)
{
SetMana(NewMana);
OnManaChanged.Broadcast(this, OldMana, NewMana);
}
OnManaChanged.Broadcast(this, OldMana, NewMana);
SetRestore(0.0f);
}
}

View File

@@ -45,6 +45,7 @@ void UStaminaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCal
if (OldStamina!=NewStamina)
{
SetStamina(NewStamina);
OnMaxStaminaChanged.Broadcast(this, OldMaxStamina, NewMaxStamina);
}
SetDrain(0.0f);
}
@@ -57,6 +58,7 @@ void UStaminaAttributeSet::PostGameplayEffectExecute(const FGameplayEffectModCal
if (OldStamina!=NewStamina)
{
SetStamina(NewStamina);
OnMaxStaminaChanged.Broadcast(this, OldMaxStamina, NewMaxStamina);
}
}
}

View File

@@ -11,7 +11,6 @@
/**
*
*/
UCLASS()
class ELISTRIA_CALLING_API UStaminaAttributeSet : public UElistriaAttributeSetBase
{

View File

@@ -9,6 +9,8 @@
/**
*
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FAttributeChangedEvent, UAttributeSet*, AttributeSet, float, OldValue,
float, NewValue);
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \