mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-15 04:38:21 +00:00
Merge branch 'wbl-generic-and-rc-citizen' into moreMovementAi
This commit is contained in:
commit
e35b95f3c8
@ -293,6 +293,8 @@
|
||||
|
||||
// WBL scripts
|
||||
#include "WblGenericZone.h"
|
||||
#include "LupGenericInteract.h"
|
||||
#include "WblRobotCitizen.h"
|
||||
|
||||
// Alpha Scripts
|
||||
#include "TriggerGas.h"
|
||||
@ -874,6 +876,10 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
|
||||
// WBL
|
||||
else if (scriptName == "scripts\\zone\\LUPs\\WBL_generic_zone.lua")
|
||||
script = new WblGenericZone();
|
||||
else if (scriptName == "scripts\\ai\\WILD\\L_LUP_generic_interact.lua")
|
||||
script = new LupGenericInteract();
|
||||
else if (scriptName.rfind("scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizen", 0) == 0)
|
||||
script = new WblRobotCitizen();
|
||||
|
||||
// Alpha
|
||||
if (scriptName == "scripts\\ai\\FV\\L_TRIGGER_GAS.lua")
|
||||
|
7
dScripts/LupGenericInteract.cpp
Normal file
7
dScripts/LupGenericInteract.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "LupGenericInteract.h"
|
||||
#include "GameMessages.h"
|
||||
#include "dLogger.h"
|
||||
|
||||
void LupGenericInteract::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayAnimation(self, u"interact");
|
||||
}
|
7
dScripts/LupGenericInteract.h
Normal file
7
dScripts/LupGenericInteract.h
Normal file
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class LupGenericInteract : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
};
|
19
dScripts/WblRobotCitizen.cpp
Normal file
19
dScripts/WblRobotCitizen.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "WblRobotCitizen.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void WblRobotCitizen::OnStartup(Entity* self) {
|
||||
// TODO: make it move via controllable physics
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnUse(Entity* self, Entity* user) {
|
||||
auto movingPlatformComponent = self->GetComponent<MovingPlatformComponent>();
|
||||
if (movingPlatformComponent) movingPlatformComponent->StopPathing();
|
||||
auto face = NiQuaternion::LookAt(self->GetPosition(), user->GetPosition());
|
||||
self->SetRotation(face);
|
||||
GameMessages::SendPlayAnimation(self, u"wave");
|
||||
self->AddTimer("animation time", m_AnimationTime);
|
||||
}
|
||||
|
||||
void WblRobotCitizen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
// TODO: make it move via controllable physics
|
||||
}
|
12
dScripts/WblRobotCitizen.h
Normal file
12
dScripts/WblRobotCitizen.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#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;
|
||||
private:
|
||||
const float m_AnimationTime = 2.5;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user