mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 09:15:28 +00:00
feat(scripts): L_SIMPLE_ONCE_ONLY_MOVER_SPINNER_EVENT
The script of the platforms a spinner moves once: a simple mover (or a mover on a two point path) in the spinner's group_deactivated_event group goes to its waypoint 1 when the spinner fires the event named in the platform's name_deactivated_event. The NJ spinner script already fires those events at its groups. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL
|
||||
"PropertyPlatform.cpp"
|
||||
"QbEnemyStunner.cpp"
|
||||
"QbSpawner.cpp"
|
||||
"SimpleOnceOnlyMoverSpinnerEvent.cpp"
|
||||
"StoryBoxInteractServer.cpp"
|
||||
"TokenConsoleServer.cpp"
|
||||
"TouchMissionUpdateServer.cpp"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#include "SimpleOnceOnlyMoverSpinnerEvent.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
|
||||
void SimpleOnceOnlyMoverSpinnerEvent::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
const auto event = self->GetVarAsString(u"name_deactivated_event");
|
||||
if (event.empty() || args != event) return;
|
||||
if (auto* const platform = self->GetComponent<MovingPlatformComponent>()) platform->GotoWaypoint(1);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
// L_SIMPLE_ONCE_ONLY_MOVER_SPINNER_EVENT.lua (02_server/Map/firetemple): a simple mover (or a mover on a two point
|
||||
// path) that a spinner sends to its other end. It is put in the spinner's group_deactivated_event group with the
|
||||
// spinner's name_deactivated_event, and goes to waypoint 1 when the spinner fires that event.
|
||||
class SimpleOnceOnlyMoverSpinnerEvent : public CppScripts::Script {
|
||||
public:
|
||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
|
||||
};
|
||||
Reference in New Issue
Block a user