mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
bd9b790e1d
* remove goto * Update MovementAIComponent.cpp * convert to PathWaypoint Easier for usage with paths * add path parsing * ref removal, simplification of work * it works * Update MovementAIComponent.cpp * disable pathing for combat we just need it for npcs for now, combat ai can be done later * fixed stuttery enemies wow * start at ramped up speed * add pausing and resuming * Update MovementAIComponent.cpp * Update MovementAIComponent.h * Update CMakeLists.txt
24 lines
861 B
C++
24 lines
861 B
C++
#include "WblRobotCitizen.h"
|
|
#include "MovementAIComponent.h"
|
|
#include "RenderComponent.h"
|
|
|
|
void WblRobotCitizen::OnStartup(Entity* self) {
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
if (!movementAIComponent) return;
|
|
}
|
|
|
|
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
if (movementAIComponent) movementAIComponent->Pause();
|
|
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
|
|
self->SetRotation(face);
|
|
auto timer = RenderComponent::PlayAnimation(self, "wave", 0.4f);
|
|
self->AddTimer("animation time", timer);
|
|
}
|
|
|
|
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
|
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
|
if (!movementAIComponent) return;
|
|
movementAIComponent->Resume();
|
|
}
|