Skip to content

Commit

Permalink
Set By Caller Magnitude
Browse files Browse the repository at this point in the history
  • Loading branch information
apchavan committed Nov 20, 2024
1 parent 53a78f7 commit 5072b95
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Binary file modified Content/Blueprints/AbilitySystem/GameplayEffects/GE_Damage.uasset
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "AbilitySystemBlueprintLibrary.h"
#include "AbilitySystemComponent.h"
#include "AuraGameplayTags.h"
#include "Actor/AuraProjectile.h"
#include "Interaction/CombatInterface.h"

Expand Down Expand Up @@ -42,6 +43,10 @@ void UAuraProjectileSpell::SpawnProjectile(const FVector& ProjectileTargetLocati
const UAbilitySystemComponent* SourceASC = UAbilitySystemBlueprintLibrary::GetAbilitySystemComponent(GetAvatarActorFromActorInfo());

const FGameplayEffectSpecHandle SpecHandle = SourceASC->MakeOutgoingSpec(DamageEffectClass, GetAbilityLevel(), SourceASC->MakeEffectContext());

FAuraGameplayTags GameplayTags = FAuraGameplayTags::Get();
UAbilitySystemBlueprintLibrary::AssignTagSetByCallerMagnitude(SpecHandle, GameplayTags.Damage, 50.0f);

Projectile->DamageEffectSpecHandle = SpecHandle;

Projectile->FinishSpawning(SpawnTransform);
Expand Down
5 changes: 5 additions & 0 deletions Source/Aura/Private/AuraGameplayTags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,9 @@ void FAuraGameplayTags::InitializeNativeGameplayTags()
FName("InputTag.4"),
FString("Input Tag for 4 key")
);

GameplayTags.Damage = UGameplayTagsManager::Get().AddNativeGameplayTag(
FName("Damage"),
FString("Damage")
);
}
2 changes: 2 additions & 0 deletions Source/Aura/Public/AuraGameplayTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ struct FAuraGameplayTags
FGameplayTag InputTag_3;
FGameplayTag InputTag_4;

FGameplayTag Damage;

private:

static FAuraGameplayTags GameplayTags;
Expand Down

0 comments on commit 5072b95

Please sign in to comment.