// © 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 "AbilitySystemComponent.h" #include "AbilitySystemInterface.h" #include "GameFramework/PlayerState.h" #include "OLSModularPlayerState.generated.h" DECLARE_LOG_CATEGORY_EXTERN(LogOLSModularPlayerState, Verbose, All); /** Minimal class that supports extension by game feature plugins */ UCLASS(Blueprintable) class OLS_API AOLSModularPlayerState : public APlayerState, public IAbilitySystemInterface { GENERATED_BODY() public: AOLSModularPlayerState(const FObjectInitializer& objectInitializer); // -- Begin Actor implementation virtual void PreInitializeComponents() override; virtual void BeginPlay() override; virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; virtual void PostInitProperties() override; virtual void Reset() override; // -- End Actor implementation // -- Begin IAbilitySystemInterface implementation virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; // -- End IAbilitySystemInterface implementation protected: // -- Begin APlayerState interface virtual void CopyProperties(APlayerState* playerState) override; // -- End APlayerState interface protected: /** * Ability System Replication Mode: How gameplay effects will be replicated to clients * * - Full: Replicate full gameplay info to all. Every GameplayEffect is replicated to every client. * (Recommended for Single Player games) * - Mixed: Only replicate minimal gameplay effect info to simulated proxies but full info to owners and autonomous proxies. * GameplayEffects are only replicated to the owning client. Only GameplayTags and GameplayCues are replicated to everyone. * (Recommended for Multiplayer on Player controlled Actors) * - Minimal: Only replicate minimal gameplay effect info. Note: this does not work for Owned AbilitySystemComponents (Use Mixed instead). * GameplayEffects are never replicated to anyone. Only GameplayTags and GameplayCues are replicated to everyone. * (Recommended for Multiplayer on AI controlled Actors) * * @See https://github.com/tranek/GASDocumentation#concepts-asc-rm for more information */ UPROPERTY(EditDefaultsOnly, Category = "OLS Ability System") EGameplayEffectReplicationMode ReplicationMode; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "OLS Ability System") TObjectPtr AbilitySystemComponent = nullptr; };