Add MVP resource respawn rules
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "TimerManager.h"
|
||||
#include "AgrarianInteractable.h"
|
||||
#include "AgrarianTypes.h"
|
||||
#include "AgrarianResourceNode.generated.h"
|
||||
@@ -19,6 +20,7 @@ class AAgrarianResourceNode : public AActor, public IAgrarianInteractable
|
||||
public:
|
||||
AAgrarianResourceNode();
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Agrarian|Resource")
|
||||
@@ -36,6 +38,15 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Resource", meta = (ClampMin = "1"))
|
||||
int32 QuantityPerHarvest = 1;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Resource|Respawn")
|
||||
bool bRespawnsForMvp = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Resource|Respawn", meta = (ClampMin = "1"))
|
||||
float RespawnDelaySeconds = 900.0f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|Resource|Respawn", meta = (ClampMin = "1"))
|
||||
int32 MaxHarvests = 5;
|
||||
|
||||
virtual FText GetInteractionText_Implementation(const AAgrarianGameCharacter* Interactor) const override;
|
||||
virtual bool CanInteract_Implementation(const AAgrarianGameCharacter* Interactor) const override;
|
||||
virtual void Interact_Implementation(AAgrarianGameCharacter* Interactor) override;
|
||||
@@ -46,4 +57,8 @@ protected:
|
||||
|
||||
FAgrarianItemStack MakeYieldStack() const;
|
||||
void UpdateDepletedState();
|
||||
void ScheduleRespawnIfNeeded();
|
||||
void RespawnNode();
|
||||
|
||||
FTimerHandle RespawnTimerHandle;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user