2021-12-05 17:54:36 +00:00
|
|
|
#include "GfApeSmashingQB.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void GfApeSmashingQB::OnStartup(Entity* self) {
|
|
|
|
self->SetNetworkVar<LWOOBJID>(u"lootTagOwner", self->GetVar<LWOOBJID>(u"lootTagOwner"));
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void GfApeSmashingQB::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
if (timerName == "anchorBreakTime") {
|
|
|
|
self->Smash();
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
|
|
|
|
auto* ape = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
|
|
|
if (ape != nullptr) {
|
|
|
|
ape->OnFireEventServerSide(target, "rebuildDone");
|
|
|
|
GameMessages::SendPlayAnimation(self, u"smash", 1.7f);
|
|
|
|
self->AddTimer("anchorBreakTime", 1.0f);
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|