Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dScripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ set(DSCRIPT_SOURCES "ActivityManager.cpp"
"FvConsoleRightQuickbuild.cpp"
"FvDragonSmashingGolemQb.cpp"
"FvFacilityBrick.cpp"
"FvFacilityPipes.cpp"
"FvFlyingCreviceDragon.cpp"
"FvFong.cpp"
"FvFreeGfNinjas.cpp"
Expand Down
3 changes: 3 additions & 0 deletions dScripts/CppScripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down
10 changes: 10 additions & 0 deletions dScripts/FvFacilityPipes.cpp
Original file line number Diff line number Diff line change
@@ -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);
}
}
15 changes: 15 additions & 0 deletions dScripts/FvFacilityPipes.h
Original file line number Diff line number Diff line change
@@ -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;
};