mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
comments from movementAI branch (#1483)
tests tested that red green and yellow bots waved when interacted with tested that construction robot races when interacted with wandering vendor does nothing before and after, but script is ready for use when npcs are implemented. add scripts for robot city
This commit is contained in:
3
dScripts/zone/LUPs/RobotCity_Intro/CMakeLists.txt
Normal file
3
dScripts/zone/LUPs/RobotCity_Intro/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_ZONE_LUPS_ROBOTCITYINTRO
|
||||
"WblRobotCitizen.cpp"
|
||||
PARENT_SCOPE)
|
24
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.cpp
Normal file
24
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "WblRobotCitizen.h"
|
||||
#include "MovementAIComponent.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
void WblRobotCitizen::OnStartup(Entity* self) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
// movementAIComponent->Resume();
|
||||
}
|
||||
|
||||
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");
|
||||
self->AddTimer("animation time", timer);
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto movementAIComponent = self->GetComponent<MovementAIComponent>();
|
||||
if (!movementAIComponent) return;
|
||||
// movementAIComponent->Resume();
|
||||
}
|
13
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.h
Normal file
13
dScripts/zone/LUPs/RobotCity_Intro/WblRobotCitizen.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef __WBLROBOTCITIZEN__H__
|
||||
#define __WBLROBOTCITIZEN__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WblRobotCitizen : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
||||
#endif //!__WBLROBOTCITIZEN__H__
|
Reference in New Issue
Block a user