initial dig functionality; need to clean up kruft

This commit is contained in:
jadebenn
2023-11-18 18:43:47 -06:00
parent 74047bcc9c
commit 119968a90c
6 changed files with 162 additions and 29 deletions

View File

@@ -101,6 +101,17 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) {
}
}
void PetDigServer::OnUse(Entity* self, Entity* user) {
LOG("Treasure used!");
auto* petComponent = PetComponent::GetActivePet(user->GetObjectID());
if (!petComponent) return;
if(petComponent->GetIsReadyToDig()) {
petComponent->SetTreasureTime(2.0f);
}
}
void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pet) {
auto playerID = self->GetVar<LWOOBJID>(u"builder");
if (playerID == LWOOBJID_EMPTY || playerID != owner->GetObjectID())