2021-12-05 17:54:36 +00:00
|
|
|
#include "GfOrgan.h"
|
|
|
|
#include "GameMessages.h"
|
2023-03-20 13:10:52 +00:00
|
|
|
#include "Entity.h"
|
|
|
|
#include "RenderComponent.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void GfOrgan::OnUse(Entity* self, Entity* user) {
|
|
|
|
if (self->GetBoolean(u"bIsInUse")) {
|
|
|
|
m_canUse = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, "{15d5f8bd-139a-4c31-8904-970c480cd70f}");
|
|
|
|
self->SetBoolean(u"bIsInUse", true);
|
|
|
|
self->AddTimer("reset", 5.0f);
|
|
|
|
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(user, u"jig");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void GfOrgan::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
if (timerName == "reset") {
|
|
|
|
self->SetBoolean(u"bIsInUse", false);
|
|
|
|
}
|
|
|
|
}
|