DRG-Femboy-Voice/Source/FSD/Public/PlayerStatsComponent.h
2025-04-15 12:39:31 -07:00

83 lines
3.1 KiB
C++
Executable file

#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "DelegateDelegate.h"
#include "EndMissionResult.h"
#include "Templates/SubclassOf.h"
#include "PlayerStatsComponent.generated.h"
class APlayerCharacter;
class UCappedResource;
UCLASS(Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent))
class UPlayerStatsComponent : public UActorComponent {
GENERATED_BODY()
public:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FEndMissionResultDelegate, const FEndMissionResult&, Result);
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FDelegate OnKillAdded;
protected:
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
int32 TotalKills;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
int32 TotalRevived;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
int32 TotalDeaths;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
int32 TotalSupplypodsRequested;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
float TotalGoldMined;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
float TotalMOMsMined;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
float TotalMineralsMined;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
float TotalXPGained;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
bool EscapedInPod;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Replicated, Transient, meta=(AllowPrivateAccess=true))
TSubclassOf<APlayerCharacter> LastPlayedClass;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient, ReplicatedUsing=OnRep_EndMissionResult, meta=(AllowPrivateAccess=true))
FEndMissionResult EndMissionResult;
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
FEndMissionResultDelegate OnEndMissionResultReady;
public:
UPlayerStatsComponent();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
UFUNCTION(BlueprintCallable)
void SendMissionAnalytics(bool trackMorkite);
UFUNCTION(BlueprintCallable, Reliable, Server)
void SendEndMissionResult(const FEndMissionResult& Result);
UFUNCTION(BlueprintCallable)
void OnResourceMined(UCappedResource* Resource, float Amount);
protected:
UFUNCTION(BlueprintCallable)
void OnRep_EndMissionResult();
public:
UFUNCTION(BlueprintCallable, BlueprintPure)
bool IsEndMissionResultReady() const;
UFUNCTION(BlueprintCallable, BlueprintPure)
bool GetSurvivedInPod() const;
};