2022-08-06 03:01:59 +00:00
|
|
|
#include "FvNinjaGuard.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "MissionComponent.h"
|
2023-03-20 13:10:52 +00:00
|
|
|
#include "RenderComponent.h"
|
|
|
|
#include "EntityManager.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void FvNinjaGuard::OnStartup(Entity* self) {
|
|
|
|
if (self->GetLOT() == 7412) {
|
2021-12-05 17:54:36 +00:00
|
|
|
m_LeftGuard = self->GetObjectID();
|
2022-07-28 13:39:57 +00:00
|
|
|
} else if (self->GetLOT() == 11128) {
|
2021-12-05 17:54:36 +00:00
|
|
|
m_RightGuard = self->GetObjectID();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void FvNinjaGuard::OnEmoteReceived(Entity* self, const int32_t emote, Entity* target) {
|
|
|
|
if (emote != 392) {
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(self, u"no");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(self, u"scared");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (self->GetLOT() == 7412) {
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* rightGuard = EntityManager::Instance()->GetEntity(m_RightGuard);
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (rightGuard != nullptr) {
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(rightGuard, u"laugh_rt");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
2022-07-28 13:39:57 +00:00
|
|
|
} else if (self->GetLOT() == 11128) {
|
2021-12-05 17:54:36 +00:00
|
|
|
auto* leftGuard = EntityManager::Instance()->GetEntity(m_LeftGuard);
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
if (leftGuard != nullptr) {
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(leftGuard, u"laugh_lt");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|