// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action. #pragma once #include "CoreMinimal.h" #include "Subsystems/WorldSubsystem.h" #include "GameplayAbilitySpecHandle.h" #include "ActiveGameplayEffectHandle.h" #include "OLSGlobaAbilitySubsystem.generated.h" USTRUCT() struct FOLSGlobalAppliedAbilityList { GENERATED_BODY() UPROPERTY() TMap, FGameplayAbilitySpecHandle> Handles; void AddToASC(TSubclassOf ability, class UOLSAbilitySystemComponent* asc); void RemoveFromASC(class UOLSAbilitySystemComponent* asc); void RemoveFromAll(); }; USTRUCT() struct FOLSGlobalAppliedEffectList { GENERATED_BODY() UPROPERTY() TMap, FActiveGameplayEffectHandle> Handles; void AddToASC(const TSubclassOf& effect, class UOLSAbilitySystemComponent* asc); void RemoveFromASC(class UOLSAbilitySystemComponent* asc); void RemoveFromAll(); }; /** * */ UCLASS() class OLS_API UOLSGlobaAbilitySubsystem : public UWorldSubsystem { GENERATED_BODY() public: /** Register an ASC with global system and apply any active global effects/abilities. */ void RegisterASC(class UOLSAbilitySystemComponent* asc); /** Removes an ASC from the global system, along with any active global effects/abilities. */ void UnregisterASC(class UOLSAbilitySystemComponent* asc); private: UPROPERTY() TMap, FOLSGlobalAppliedAbilityList> AppliedAbilities; UPROPERTY() TMap, FOLSGlobalAppliedEffectList> AppliedEffects; UPROPERTY() TArray> RegisteredASCs; };