added imagination cost to digs

This commit is contained in:
jadebenn 2023-11-18 20:11:28 -06:00
parent 86abbc121c
commit b3762dac05
2 changed files with 11 additions and 2 deletions

View File

@ -372,7 +372,7 @@ private:
/** /**
* Boolean that sets if a pet is in an interaction * Boolean that sets if a pet is in an interaction
*/ */
float m_InInteract; bool m_InInteract;
/** /**
* The position that this pet was spawned at * The position that this pet was spawned at

View File

@ -1,5 +1,6 @@
#include "dZoneManager.h" #include "dZoneManager.h"
#include "PetDigServer.h" #include "PetDigServer.h"
#include "DestroyableComponent.h"
#include "MissionComponent.h" #include "MissionComponent.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "Character.h" #include "Character.h"
@ -107,8 +108,16 @@ void PetDigServer::OnUse(Entity* self, Entity* user) {
auto* petComponent = PetComponent::GetActivePet(user->GetObjectID()); auto* petComponent = PetComponent::GetActivePet(user->GetObjectID());
if (!petComponent) return; if (!petComponent) return;
if(petComponent->GetIsReadyToDig()) { if(petComponent->GetIsReadyToDig()) { // TODO: Add handling of the "first time" dig message
petComponent->SetTreasureTime(2.0f); petComponent->SetTreasureTime(2.0f);
auto* destroyableComponent = user->GetComponent<DestroyableComponent>();
if (!destroyableComponent) return;
auto imagination = destroyableComponent->GetImagination();
imagination -= 1; // TODO: Get rid of this magic number
destroyableComponent->SetImagination(imagination);
Game::entityManager->SerializeEntity(user);
} }
} }