added treasure dig menu prompts and help messages

This commit is contained in:
jadebenn
2023-12-14 01:33:49 -06:00
parent 2a4cfe3447
commit 1b8f10fcfb
10 changed files with 145 additions and 82 deletions

View File

@@ -103,23 +103,13 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) {
}
void PetDigServer::OnUse(Entity* self, Entity* user) {
LOG("Treasure used!");
LOG_DEBUG("Treasure used! LWOOBJID: %d", self->GetObjectID());
auto* petComponent = PetComponent::GetActivePet(user->GetObjectID());
if (!petComponent) return;
if(petComponent->IsReadyToInteract()) { // TODO: Add handling of the "first time" dig message
auto* destroyableComponent = user->GetComponent<DestroyableComponent>();
if (!destroyableComponent) return;
auto imagination = destroyableComponent->GetImagination();
if (imagination == 0) return; // TODO: Check if there was special behavior for this in the live game (PR_NEED_IMAGINATION)
if(petComponent->IsReadyToInteract()) {
petComponent->StartInteractTreasureDig();
imagination -= 1; // TODO: Get rid of this magic number
destroyableComponent->SetImagination(imagination);
Game::entityManager->SerializeEntity(user);
}
}