GASATHON/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp
Ed_ ad41867dc5 WIP: Boostrapping NetSlime
- Just a old name for a set of changes to make the game framework hardened for multiplayer as well as some ease of use functionality.
2024-04-23 01:10:02 -04:00

24 lines
656 B
C++

#include "GasaEffectActor.h"
#include "GasaAbilitySystemComponent_Inlines.h"
using namespace Gasa;
AGasaEffectActor::AGasaEffectActor()
{
PrimaryActorTick.bCanEverTick = false;
RootComponent = CreateDefaultSubobject<USceneComponent>("Root");
}
void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEffect> EffectClass)
{
UGasaAbilitySystemComp* AS = GetAbilitySystem(Actor, true);
FGameplayEffectContextHandle
Context = AS->MakeEffectContext();
Context.AddSourceObject(Actor);
FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context );
AS->ApplyGameplayEffectSpecToSelf( * Spec.Data );
}