mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-25 06:53:35 +00:00
added imagination cost to digs
This commit is contained in:
parent
fc1ff50fca
commit
bd6f9a7a3b
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user