Files
DarkflameServer/dScripts/02_server/Map/General/WavesManagerServer.h
Aaron Kimbrell 046cb9902d feat(scripts): L_WAVES_MANAGER_SERVER, and scripts can listen to another object's FireEvents
Entity::Subscribe takes "FireEvent" (the Lua's notification request on FireEvent): the subscriber's script hears
every FireEvent the object is sent (NotifyFireEvent). The Fire Temple waves manager uses it to hear its spinners being
sent SpawnedEnemiesDead, which the spinners send to their own group once their enemies are dead (level config
name_deactivated_event / group_deactivated_event). LEVEL:GetCinematicInfo is the camera path's time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 23:40:23 -06:00

26 lines
1.2 KiB
C++

#pragma once
#include "CppScripts.h"
// L_WAVES_MANAGER_SERVER.lua: the Fire Temple waves room. The first touch starts wave 1: each enemy kind's spawner
// network (Waves_<name>_Spawner) gets its count for the team size, the spinners of that kind (group WavesSpinner<name>)
// are sent SpawnEnemies, and the manager listens for each to be sent SpawnedEnemiesDead (the spinners send it to their
// own group once their enemies are dead). When the last is, the players in the room see the door camera, the wave's
// door indicator lights, and the next wave starts after the camera; after the last wave the door and the elevator
// spinner are turned on.
class WavesManagerServer : public CppScripts::Script {
public:
struct Enemy {
std::string name;
int32_t largeNum;
int32_t smallNum;
};
static const std::vector<std::vector<Enemy>>& Waves();
void OnCollisionPhantom(Entity* self, Entity* target) override;
void NotifyFireEvent(Entity* self, Entity* other, const std::string& args) override;
void OnTimerDone(Entity* self, std::string timerName) override;
private:
void ActivateWaveSpinners(Entity* self, int32_t waveNum);
static void PlayCamera(Entity* self, const std::u16string& cine);
};