Add script to playfx on canisters before consoles are active (#754)

* Add script to playfx on canisters before consoles are active

* remove debug stuff
This commit is contained in:
Aaron Kimbrell 2022-08-27 21:48:03 -05:00 committed by GitHub
parent b70e7334e8
commit 3b75ecc0b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -94,6 +94,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
"FvConsoleRightQuickbuild.cpp"
"FvDragonSmashingGolemQb.cpp"
"FvFacilityBrick.cpp"
"FvFacilityPipes.cpp"
"FvFlyingCreviceDragon.cpp"
"FvFong.cpp"
"FvFreeGfNinjas.cpp"

View File

@ -144,6 +144,7 @@
#include "FvConsoleLeftQuickbuild.h"
#include "FvConsoleRightQuickbuild.h"
#include "FvFacilityBrick.h"
#include "FvFacilityPipes.h"
#include "ImgBrickConsoleQB.h"
#include "ActParadoxPipeFix.h"
#include "FvNinjaGuard.h"
@ -573,6 +574,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new FvConsoleRightQuickbuild();
else if (scriptName == "scripts\\ai\\FV\\L_FV_FACILITY_BRICK.lua")
script = new FvFacilityBrick();
else if (scriptName == "scripts\\ai\\FV\\L_FV_FACILITY_PIPES.lua")
script = new FvFacilityPipes();
else if (scriptName == "scripts\\02_server\\Map\\FV\\L_IMG_BRICK_CONSOLE_QB.lua")
script = new ImgBrickConsoleQB();
else if (scriptName == "scripts\\ai\\FV\\L_ACT_PARADOX_PIPE_FIX.lua")

View File

@ -0,0 +1,10 @@
#include "FvFacilityPipes.h"
#include "GameMessages.h"
void FvFacilityPipes::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
if (args == "startFX") {
GameMessages::SendPlayFXEffect(self->GetObjectID(), m_LeftPipeEffectID, m_EffectType, m_LeftPipeEffectName);
GameMessages::SendPlayFXEffect(self->GetObjectID(), m_RightPipeEffectID, m_EffectType, m_RightPipeEffectName);
GameMessages::SendPlayFXEffect(self->GetObjectID(), m_ImaginationCanisterEffectID, m_EffectType, m_ImaginationCanisterEffectName);
}
}

View File

@ -0,0 +1,15 @@
#pragma once
#include "CppScripts.h"
class FvFacilityPipes : public CppScripts::Script {
public:
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) override;
private:
const std::u16string m_EffectType = u"create";
const std::string m_LeftPipeEffectName = "LeftPipeOff";
const int32_t m_LeftPipeEffectID = 2774;
const std::string m_RightPipeEffectName = "RightPipeOff";
const int32_t m_RightPipeEffectID = 2777;
const std::string m_ImaginationCanisterEffectName = "imagination_canister";
const int32_t m_ImaginationCanisterEffectID = 2750;
};