71. Derived Attributes

This commit is contained in:
2024-10-22 16:52:42 -04:00
parent 2d625967a9
commit d34201e8a1
6 changed files with 324 additions and 7 deletions

View File

@ -65,9 +65,19 @@ AGasaCharacter::AGasaCharacter()
}
#pragma region Ability System
void AGasaCharacter::ApplyEffectToSelf(TSubclassOf<UGameplayEffect> GE, float Level)
{
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
ensure(ASC);
ensure(GE);
FGameplayEffectContextHandle Context = ASC->MakeEffectContext();
FGameplayEffectSpecHandle Spec = ASC->MakeOutgoingSpec(GE, Level, Context );
ASC->ApplyGameplayEffectSpecToTarget( * Spec.Data, ASC );
}
void AGasaCharacter::InitDefaultAttributes()
{
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
UAbilitySystemComponent* ASC = GetAbilitySystemComponent();
ensure(ASC);
ensure(DefaultVitalAttributes);
ensure(DefaultPrimaryAttributes);

View File

@ -44,6 +44,9 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Ability System")
TSubclassOf<UGameplayEffect> DefaultSecondaryAttributes;
UFUNCTION(BlueprintCallable)
void ApplyEffectToSelf(TSubclassOf<UGameplayEffect> GE, float Level);
void InitDefaultAttributes();
#pragma endregion Ability System