redone pet update loop

This commit is contained in:
jadebenn
2023-12-10 19:55:36 -06:00
parent 1c01219ae9
commit 200d679dd8
2 changed files with 226 additions and 48 deletions

View File

@@ -6,6 +6,21 @@
#include "Preconditions.h"
#include "eReplicaComponentType.h"
/*
* The current state of the pet AI
*/
enum class PetAiState : uint {
idle = 0, // Doing nothing
spawn, // Spawning into the world
follow, // Following player
interact, // Beginning interaction
goToObj, // Go to object
despawn // Despawning from world
};
/*
* The status of the pet: Governs the icon above their head and the interactions available
*/
enum PetStatus : uint32_t {
NONE,
BEING_TAMED = 0x10,
@@ -41,6 +56,18 @@ public:
~PetComponent() override;
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override;
/**
* Sets the AI state of the pet
* @param newState New pet AI state
*/
void SetPetAiState(PetAiState newState);
/**
* Gets the AI state of the pet
*/
PetAiState GetPetAiState() { return m_State; };
void Update(float deltaTime) override;
/**
@@ -373,6 +400,11 @@ private:
*/
uint32_t m_Status;
/**
* The current state of the pet AI
*/
PetAiState m_State;
/**
* A currently active ability, mostly unused
*/
@@ -399,11 +431,6 @@ private:
*/
bool m_ReadyToDig;
/**
* Boolean that sets if a pet is in an interaction
*/
bool m_InInteract;
/**
* The position that this pet was spawned at
*/
@@ -423,4 +450,19 @@ private:
* The rate at which imagination is drained from the user for having the pet out.
*/
float imaginationDrainRate;
/**
* The walk speed of the pet
*/
float m_walkSpeed;
/**
* The run speed of the pet
*/
float m_RunSpeed;
/**
* The sprint speed of the pet
*/
float m_SprintSpeed;
};