64 lines
2.9 KiB
C++
64 lines
2.9 KiB
C++
// © 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/Pawn.h"
|
|
#include "OLSModularPawn.generated.h"
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(LogOLSModularPawn, Verbose, All);
|
|
|
|
/** Minimal class that supports extension by game feature plugins, direct child of APawn */
|
|
UCLASS(Blueprintable)
|
|
class OLS_API AOLSModularPawn : public APawn, public IAbilitySystemInterface, public IGameplayTagAssetInterface
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
|
|
// Sets default values for this actor's properties
|
|
AOLSModularPawn(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;
|
|
};
|