OLS/Source/ols/Public/ModularGameplayActors/OLSModularCharacter.h

68 lines
3.0 KiB
C
Raw Normal View History

2025-01-04 16:41:49 +00:00
// © 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 "GameplayTagAssetInterface.h"
#include "GameFramework/Character.h"
#include "OLSModularCharacter.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(LogOLSModularCharacter, Verbose, All);
2025-01-04 16:41:49 +00:00
/**
* Minimal class that supports extension by game feature plugins
*
* Intended to be used for ACharacters using AbilitySystemComponent living on Pawns
*/
UCLASS(Blueprintable)
class OLS_API AOLSModularCharacter : public ACharacter, public IAbilitySystemInterface, public IGameplayTagAssetInterface
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AOLSModularCharacter(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;
// -- End Actor Implementation
// -- Begin IAbilitySystemInterface implementation
virtual class UAbilitySystemComponent* GetAbilitySystemComponent() const override;
// -- End IAbilitySystemInterface implementation
// -- Begin IGameplayTagAssetInterface
virtual void GetOwnedGameplayTags(FGameplayTagContainer& outTagContainer) const override;
virtual bool HasMatchingGameplayTag(FGameplayTag tagToCheck) const override;
virtual bool HasAllMatchingGameplayTags(const FGameplayTagContainer& tagContainer) const override;
virtual bool HasAnyMatchingGameplayTags(const FGameplayTagContainer& tagContainer) const override;
// -- End IGameplayTagAssetInterface
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<class UOLSAbilitySystemComponent> AbilitySystemComponent = nullptr;
};