// Copyright (c) 2026 Reignance Studios. MIT License, see LICENSE. #pragma once #include "CoreMinimal.h" #include "AbilitySystemInterface.h" #include "GameFramework/PlayerState.h" #include "GKLPlayerState.generated.h" class UAbilitySystemComponent; class UGameplayAbility; class UGKLAttributeSet; /** * Owns the Ability System Component and the AttributeSet, so abilities, effects and * attributes survive the pawn dying and respawning. * * - ASC replicates in Mixed mode: the owning client gets its own effects (needed for * predicted cost and cooldown), other clients only get tags and cues. * - Net update frequency 100: ability confirmations ride on this actor. * - StartupAbilities are granted once, on the server, in BeginPlay. */ UCLASS() class GASKITLITE_API AGKLPlayerState : public APlayerState, public IAbilitySystemInterface { GENERATED_BODY() public: AGKLPlayerState(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; UFUNCTION(BlueprintPure, Category = "GASKit Lite") UGKLAttributeSet* GetAttributeSet() const { return AttributeSet; } /** Server only. Clears State.Dead, refills attributes and restarts passive abilities. Call before possessing a new pawn. */ UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "GASKit Lite") void ResetForRespawn(); protected: virtual void BeginPlay() override; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "GASKit Lite") TObjectPtr AbilitySystemComponent; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "GASKit Lite") TObjectPtr AttributeSet; /** Granted on the server in BeginPlay. Defaults to the five sample abilities. */ UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "GASKit Lite") TArray> StartupAbilities; private: bool bStartupAbilitiesGranted = false; };