74. Modifier Magnitude Calculations

This commit is contained in:
2024-10-22 18:12:31 -04:00
parent 7e27f708cf
commit 001a542521
8 changed files with 122 additions and 11 deletions

View File

@ -79,13 +79,17 @@ void AGasaCharacter::InitDefaultAttributes()
{
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
ensure(ASC);
ensure(DefaultVitalAttributes);
ensure(DefaultPrimaryAttributes);
ensure(DefaultSecondaryAttributes);
FGameplayEffectContextHandle Context = ASC->MakeEffectContext();
FGameplayEffectSpecHandle SpecPrimary = ASC->MakeOutgoingSpec(DefaultPrimaryAttributes, 1.0f, Context );
FGameplayEffectSpecHandle SpecSecondary = ASC->MakeOutgoingSpec(DefaultSecondaryAttributes, 1.0f, Context );
FGameplayEffectSpecHandle SpecVital = ASC->MakeOutgoingSpec(DefaultVitalAttributes, 1.0f, Context );
FGameplayEffectContextHandle Context = ASC->MakeEffectContext();
Context.AddSourceObject(this);
FGameplayEffectSpecHandle SpecPrimary = ASC->MakeOutgoingSpec(DefaultPrimaryAttributes, 1.0f, Context );
FGameplayEffectSpecHandle SpecSecondary = ASC->MakeOutgoingSpec(DefaultSecondaryAttributes, 1.0f, Context );
FGameplayEffectSpecHandle SpecVital = ASC->MakeOutgoingSpec(DefaultVitalAttributes, 1.0f, Context );
ASC->ApplyGameplayEffectSpecToTarget( * SpecPrimary.Data, ASC );
ASC->ApplyGameplayEffectSpecToTarget( * SpecSecondary.Data, ASC );
ASC->ApplyGameplayEffectSpecToTarget( * SpecVital.Data, ASC );

View File

@ -14,9 +14,9 @@ APlayerCharacter::APlayerCharacter()
}
#pragma region ICombat
int32 APlayerCharacter::GetLevel()
int32 APlayerCharacter::GetPlayerLevel()
{
return GetPlayerState<AGasaPlayerState>()->Level;
return GetPlayerState<AGasaPlayerState>()->PlayerLevel;
}
#pragma endregion ICombat

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "GasaCharacter.h"
@ -13,7 +13,7 @@ public:
APlayerCharacter();
#pragma region ICombat
int32 GetLevel() override;
int32 GetPlayerLevel() override;
#pragma endregion ICombat
#pragma region Pawn