mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 09:51:38 +00:00
The Fire Temple boss fight: intro celebration and camera, the centre portal and the tornado, four elemental phases whose portal moves between its spawner's nodes and is hit by riders of the element's rail, the middle celebration, Garmadon stunned and a wave of spinner enemies each fifth of his health, then the end bouncer. The client's CelebrationCompleted carries no celebration id, so the manager branches on the celebration it started. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49 lines
2.9 KiB
C++
49 lines
2.9 KiB
C++
#pragma once
|
|
#include "CppScripts.h"
|
|
#include "NiPoint3.h"
|
|
#include "NiQuaternion.h"
|
|
|
|
class Spawner;
|
|
|
|
// L_BOSS_MANAGER_SERVER.lua: the Fire Temple boss fight. The first touch plays the intro celebration (26) to the
|
|
// players in BossCutsceneVolume, then the start camera, while the centre portal and the tornado spawn; the tornado then
|
|
// paths. Four elemental phases (earth, ice, lightning, fire) each spawn a portal at a random node of its spawner, which
|
|
// moves every so often, plus the element's rail endposts and activators: a player riding the rail used at the portal's
|
|
// node to the element's rail node hits the portal (twice moves on to the next element). After fire the middle
|
|
// celebration (27) plays, Garmadon spawns stunned, and each fifth of his health lost starts a wave of enemies from the
|
|
// BossSpawnerSpinners; once he dies the end bouncer spawns.
|
|
// Not as the Lua: the client's CelebrationCompleted carries no celebration id (the Lua's msg.celebrationID is always
|
|
// nil there), so the manager branches on the celebration it started. The portal's onhit animation is played on the
|
|
// portal's spawner in the Lua, which has none to play: the wait for it is the Lua's 1.5 s default.
|
|
class BossManagerServer : public CppScripts::Script {
|
|
public:
|
|
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
|
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
|
|
void NotifyCelebrationCompleted(Entity* self, Entity* player) override;
|
|
void NotifyPlayerRailArrived(Entity* self, Entity* activator, const std::u16string& pathName, int32_t waypointNumber) override;
|
|
void NotifyHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) override;
|
|
void NotifyFireEvent(Entity* self, Entity* other, const std::string& args) override;
|
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
|
|
|
// The wave Garmadon's health has dropped into: a fifth of his health lost per wave
|
|
static bool ReachedWave(float health, float maxHealth, int32_t nextWave);
|
|
private:
|
|
void SpawnedObjectLoaded(Entity* self, Entity* object, int32_t spawnNode);
|
|
void ListenToSpawner(Entity* self, Spawner* spawner);
|
|
void PlayCelebration(Entity* self, int32_t cutscene);
|
|
static void PlayCinematic(Entity* self, const std::u16string& cine);
|
|
static std::vector<Entity*> GetPlayersInRange(Entity* self);
|
|
void StartElement(Entity* self, int32_t elementNum);
|
|
void TeleportPortal(Entity* self, const std::string& portalSpawner);
|
|
static void DestroyPortal(const std::string& portalSpawner);
|
|
static void DestroyRails(const std::string& elementString);
|
|
static int32_t GetNewNode(Entity* self, int32_t totalNodes);
|
|
static void UpdateMission(Entity* self);
|
|
void StartNewWave(Entity* self, Entity* garmadon, int32_t nextWave);
|
|
void ActivateWaveSpinners(Entity* self, int32_t waveNum);
|
|
|
|
// Where Garmadon spawned (one boss fight per instance)
|
|
NiPoint3 m_GarmadonPos{};
|
|
NiQuaternion m_GarmadonRot{};
|
|
};
|