mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-08 22:03:43 +00:00
refactor: effects, audio, animation and UI text game messages as structs
Converts PlayAnimation, PlayNDAudioEmitter, PlayEmbeddedEffectOnAllClientsNearObject,
PlayFXEffect, StopFXEffect, BroadcastTextToChatbox, Play2DAmbientSound,
Stop2DAmbientSound, UIMessageServerToSingleClient, UIMessageServerToAllClients,
StartCelebrationEffect, DisplayMessageBox, DisplayChatBubble, ChangeIdleFlags,
SetNameBillboardState, ShowBillboardInteractIcon, PlayCinematic, EndCinematic,
SlashCommandTextFeedback, PlayEmote and SetEmoteLockState (21 old Send
functions, 23 with overloads) and the received MessageBoxRespond,
ChoiceBoxRespond, CinematicUpdate and PlayEmote to NetGameMsgs in
EffectsMessages.{h,cpp}. The high traffic messages get a constructor for their
required fields. UI messages own their AMF arguments. Every caller is switched,
the received messages are registered in GameMessageHandler's map, and the old
functions and switch cases are deleted. Handlers are copied verbatim.
No wire change and no change in recipients: functions that always broadcast
whatever address they were given are sent with Send(UNASSIGNED_SYSTEM_ADDRESS),
functions that only did SEND_PACKET use SendToClient. Quirks are kept and
documented on the structs (PlayAnimation's UTF-8 sized name, the always written
null terminator in BroadcastTextToChatbox, StartCelebrationEffect always
writing celebrationID, SetNameBillboardState having no payload).
Verified byte for byte against a frozen verbatim copy of the old functions over
an input grid, to one client and broadcast; received messages compared with the
old handlers' read sequences and every truncated payload rejected; hand
computed golden bytes; round trips; a deliberate width mutation made the tests
fail. The byte-equality helper gains a Broadcast mode for functions that
ignored their address.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "SkillComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void ActMine::OnStartup(Entity* self) {
|
||||
self->SetVar(u"QuickBuildComplete", false);
|
||||
@@ -27,7 +28,7 @@ void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name
|
||||
auto* detroyable = self->GetComponent<DestroyableComponent>();
|
||||
if (!detroyable) return;
|
||||
if (status == "ENTER" && self->GetVar<bool>(u"QuickBuildComplete") == true && detroyable->IsEnemy(entering)) {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("Tick", TICK_TIME);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +41,7 @@ void ActMine::OnTimerDone(Entity* self, std::string timerName) {
|
||||
skill->CalculateBehavior(SKILL_ID, BEHAVIOR_ID, LWOOBJID_EMPTY);
|
||||
self->AddTimer("BlowedUp", BLOWED_UP_TIME);
|
||||
} else {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("Tick", TICK_TIME);
|
||||
self->SetVar(u"NumWarnings", self->GetVar<int>(u"NumWarnings") + 1);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AgBusDoor.h"
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "ProximityMonitorComponent.h"
|
||||
|
||||
void AgBusDoor::OnStartup(Entity* self) {
|
||||
@@ -55,11 +56,11 @@ void AgBusDoor::MoveDoor(Entity* self, bool bOpen) {
|
||||
}
|
||||
|
||||
//This is currently commented out because it might be the reason that people's audio is cutting out.
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, "{9a24f1fa-3177-4745-a2df-fbd996d6e1e3}");
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), "{9a24f1fa-3177-4745-a2df-fbd996d6e1e3}").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void AgBusDoor::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "dustTimer") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 642, u"create", "busDust", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 642, u"create", "busDust").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "AgJetEffectServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
@@ -14,7 +15,7 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
|
||||
if (entities.empty()) return;
|
||||
GameMessages::SendPlayFXEffect(entities.at(0), 641, u"create", "radarDish", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(entities.at(0)->GetObjectID(), 641, u"create", "radarDish").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("radarDish", 2.0f);
|
||||
self->AddTimer("PlayEffect", 2.5f);
|
||||
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
||||
@@ -38,7 +39,7 @@ void AgJetEffectServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "radarDish") {
|
||||
GameMessages::SendStopFXEffect(self, true, "radarDish");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "radarDish").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "PlayEffect") {
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup("mortarMain");
|
||||
if (entities.empty()) return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "AgShipPlayerShockServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "eTerminateType.h"
|
||||
@@ -13,11 +14,11 @@ void AgShipPlayerShockServer::OnUse(Entity* self, Entity* user) {
|
||||
RenderComponent::PlayAnimation(user, shockAnim);
|
||||
GameMessages::SendKnockback(user->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, NiPoint3(-20, 10, -20));
|
||||
|
||||
GameMessages::SendPlayFXEffect(self, 1430, u"create", "console_sparks", LWOOBJID_EMPTY, 1.0, 1.0, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 1430, u"create", "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("FXTime", fxTime);
|
||||
}
|
||||
|
||||
void AgShipPlayerShockServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
GameMessages::SendStopFXEffect(self, true, "console_sparks");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "console_sparks").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
active = false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityInfo.h"
|
||||
#include "GeneralUtils.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "RenderComponent.h"
|
||||
#include "Entity.h"
|
||||
@@ -39,18 +40,24 @@ void AgShipShake::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("ShipShakeIdle", static_cast<float>(time));
|
||||
|
||||
if (ref)
|
||||
GameMessages::SendPlayEmbeddedEffectOnAllClientsNearObject(ref, FXName, ref->GetObjectID(), 500.0f);
|
||||
if (ref) {
|
||||
GameMessages::PlayEmbeddedEffectOnAllClientsNearObject embeddedEffect;
|
||||
embeddedEffect.target = ref->GetObjectID();
|
||||
embeddedEffect.effectName = FXName;
|
||||
embeddedEffect.fromObjectID = ref->GetObjectID();
|
||||
embeddedEffect.radius = 500.0f;
|
||||
embeddedEffect.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
if (debrisObject)
|
||||
GameMessages::SendPlayFXEffect(debrisObject, -1, u"DebrisFall", "Debris", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(debrisObject->GetObjectID(), -1, u"DebrisFall", "Debris").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
const auto randomFx = GeneralUtils::GenerateRandomNumber<int>(0, 3);
|
||||
|
||||
if (shipFxObject) {
|
||||
std::string effectType = "shipboom" + std::to_string(randomFx);
|
||||
GameMessages::SendPlayFXEffect(shipFxObject, 559, GeneralUtils::ASCIIToUTF16(effectType), "FX", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
GameMessages::PlayFXEffect(shipFxObject->GetObjectID(), 559, GeneralUtils::ASCIIToUTF16(effectType), "FX").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
self->AddTimer("ShipShakeExplode", 5.0f);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
#include "RenderComponent.h"
|
||||
|
||||
@@ -38,7 +39,7 @@ void AgSpiderBossMessage::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
// knockback the target
|
||||
auto forward = QuatUtils::Forward(self->GetRotation());
|
||||
box.boxTarget = target->GetObjectID();
|
||||
GameMessages::SendPlayFXEffect(target->GetObjectID(), 1378, u"create", "pushBack");
|
||||
GameMessages::PlayFXEffect(target->GetObjectID(), 1378, u"create", "pushBack").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
RenderComponent::PlayAnimation(target, "knockback-recovery");
|
||||
forward.y += 15;
|
||||
forward.x *= 100;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Entity.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void ActNinjaSensei::OnStartup(Entity* self) {
|
||||
auto students = Game::entityManager->GetEntitiesInGroup(this->m_StudentGroup);
|
||||
@@ -19,54 +20,54 @@ void ActNinjaSensei::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
if (timerName == "crane") {
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"crane");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"crane").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"crane");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"crane").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("bow", 15.33);
|
||||
}
|
||||
|
||||
if (timerName == "bow") {
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"bow");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("tiger", 5);
|
||||
}
|
||||
|
||||
if (timerName == "tiger") {
|
||||
GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"tiger");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("bow2", 15.33);
|
||||
}
|
||||
|
||||
if (timerName == "bow2") {
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"bow");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("mantis", 5);
|
||||
}
|
||||
|
||||
if (timerName == "mantis") {
|
||||
GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"mantis");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("bow3", 15.3);
|
||||
}
|
||||
|
||||
if (timerName == "bow3") {
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto student : students) {
|
||||
if (student) GameMessages::SendPlayAnimation(student, u"bow");
|
||||
if (student) GameMessages::PlayAnimation(student->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("repeat", 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "eEndBehavior.h"
|
||||
|
||||
@@ -30,7 +31,7 @@ void ActParadoxPipeFix::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
GameMessages::SendPlayFXEffect(refinery[0]->GetObjectID(), 3999, u"create", "pipeFX");
|
||||
GameMessages::PlayFXEffect(refinery[0]->GetObjectID(), 3999, u"create", "pipeFX").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
for (auto* object : groupObjs) {
|
||||
@@ -43,7 +44,17 @@ void ActParadoxPipeFix::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
missionComponent->ForceProgressTaskType(769, 1, 1, false);
|
||||
}
|
||||
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), u"ParadoxPipeFinish", player->GetSystemAddress(), true, true, false, false, eEndBehavior::RETURN, false, 2.0f);
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = u"ParadoxPipeFinish";
|
||||
cinematic.allowGhostUpdates = true;
|
||||
cinematic.bCloseMultiInteract = true;
|
||||
cinematic.bSendServerNotify = false;
|
||||
cinematic.bUseControlledObjectForAudioListener = false;
|
||||
cinematic.endBehavior = eEndBehavior::RETURN;
|
||||
cinematic.hidePlayerDuringCine = false;
|
||||
cinematic.leadIn = 2.0f;
|
||||
cinematic.Send(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
object->SetVar(u"PlayerID", LWOOBJID_EMPTY);
|
||||
@@ -56,7 +67,7 @@ void ActParadoxPipeFix::OnQuickBuildNotifyState(Entity* self, eQuickBuildState s
|
||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
GameMessages::SendStopFXEffect(refinery[0], true, "pipeFX");
|
||||
GameMessages::StopFXEffect(refinery[0]->GetObjectID(), true, "pipeFX").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "FvFacilityBrick.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
@@ -17,43 +18,43 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
auto* const canisterSpawner = canisterObjs.empty() ? nullptr : canisterObjs[0];
|
||||
|
||||
if (name == "ConsoleLeftUp") {
|
||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeOff");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2775, u"create", "LeftPipeEnergy");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "LeftPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2775, u"create", "LeftPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (name == "ConsoleLeftDown") {
|
||||
self->SetVar(u"ConsoleLEFTActive", false);
|
||||
|
||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeEnergy");
|
||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeOn");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2774, u"create", "LeftPipeOff");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "LeftPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "LeftPipeOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2774, u"create", "LeftPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (name == "ConsoleLeftActive") {
|
||||
self->SetVar(u"ConsoleLEFTActive", true);
|
||||
|
||||
GameMessages::SendStopFXEffect(self, true, "LeftPipeEnergy");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2776, u"create", "LeftPipeOn");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "LeftPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2776, u"create", "LeftPipeOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
else if (name == "ConsoleRightUp") {
|
||||
GameMessages::SendStopFXEffect(self, true, "RightPipeOff");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2778, u"create", "RightPipeEnergy");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "RightPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2778, u"create", "RightPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (name == "ConsoleRightDown") {
|
||||
self->SetVar(u"ConsoleRIGHTActive", false);
|
||||
|
||||
GameMessages::SendStopFXEffect(self, true, "RightPipeEnergy");
|
||||
GameMessages::SendStopFXEffect(self, true, "RightPipeOn");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2777, u"create", "RightPipeOff");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "RightPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "RightPipeOn").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2777, u"create", "RightPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (name == "ConsoleRightActive") {
|
||||
self->SetVar(u"ConsoleRIGHTActive", true);
|
||||
|
||||
GameMessages::SendStopFXEffect(self, true, "RightPipeOff");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2779, u"create", "RightPipeEnergy");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "RightPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2779, u"create", "RightPipeEnergy").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (self->GetVar<bool>(u"ConsoleLEFTActive") && self->GetVar<bool>(u"ConsoleRIGHTActive")) {
|
||||
auto* object = Game::entityManager->GetEntitiesInGroup("Brick")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
GameMessages::SendPlayFXEffect(object->GetObjectID(), 122, u"create", "bluebrick");
|
||||
GameMessages::SendPlayFXEffect(object->GetObjectID(), 1034, u"cast", "imaginationexplosion");
|
||||
GameMessages::PlayFXEffect(object->GetObjectID(), 122, u"create", "bluebrick").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(object->GetObjectID(), 1034, u"cast", "imaginationexplosion").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
object = Game::entityManager->GetEntitiesInGroup("Canister")[0];
|
||||
@@ -70,7 +71,7 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
auto* object = Game::entityManager->GetEntitiesInGroup("Brick")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
GameMessages::SendStopFXEffect(object, true, "bluebrick");
|
||||
GameMessages::StopFXEffect(object->GetObjectID(), true, "bluebrick").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (bugSpawner) {
|
||||
@@ -101,8 +102,8 @@ void FvFacilityBrick::OnFireEventServerSide(Entity* self, Entity* sender, std::s
|
||||
return;
|
||||
}
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2774, u"create", "LeftPipeOff");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2777, u"create", "RightPipeOff");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2750, u"create", "imagination_canister");
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2751, u"create", "canister_light_filler");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2774, u"create", "LeftPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2777, u"create", "RightPipeOff").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2750, u"create", "imagination_canister").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 2751, u"create", "canister_light_filler").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "FvFacilityPipes.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.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);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), m_LeftPipeEffectID, m_EffectType, m_LeftPipeEffectName).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), m_RightPipeEffectID, m_EffectType, m_RightPipeEffectName).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), m_ImaginationCanisterEffectID, m_EffectType, m_ImaginationCanisterEffectName).Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void ForceFieldEffect::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
|
||||
GameMessages::SendPlayFXEffect(target, 3671, u"cast", "", LWOOBJID_EMPTY);
|
||||
GameMessages::PlayFXEffect(target->GetObjectID(), 3671, u"cast", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "InstanceExitTransferPlayerToLastNonInstance.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "CharacterComponent.h"
|
||||
#include "Character.h"
|
||||
#include "dServer.h"
|
||||
@@ -10,16 +11,15 @@ void InstanceExitTransferPlayerToLastNonInstance::OnUse(Entity* self, Entity* us
|
||||
if (transferText.empty())
|
||||
transferText = u"DRAGON_EXIT_QUESTION";
|
||||
|
||||
GameMessages::SendDisplayMessageBox(
|
||||
user->GetObjectID(),
|
||||
true,
|
||||
self->GetObjectID(),
|
||||
u"Instance_Exit",
|
||||
1,
|
||||
transferText,
|
||||
u"",
|
||||
user->GetSystemAddress()
|
||||
);
|
||||
GameMessages::DisplayMessageBox messageBox;
|
||||
messageBox.target = user->GetObjectID();
|
||||
messageBox.bShow = true;
|
||||
messageBox.callbackClient = self->GetObjectID();
|
||||
messageBox.identifier = u"Instance_Exit";
|
||||
messageBox.imageID = 1;
|
||||
messageBox.text = transferText;
|
||||
messageBox.userData = u"";
|
||||
messageBox.Send(user->GetSystemAddress());
|
||||
}
|
||||
|
||||
void InstanceExitTransferPlayerToLastNonInstance::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "GfOrgan.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Entity.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
@@ -9,7 +10,7 @@ void GfOrgan::OnUse(Entity* self, Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(self, UNASSIGNED_SYSTEM_ADDRESS, "{15d5f8bd-139a-4c31-8904-970c480cd70f}");
|
||||
GameMessages::PlayNDAudioEmitter(self->GetObjectID(), "{15d5f8bd-139a-4c31-8904-970c480cd70f}").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetBoolean(u"bIsInUse", true);
|
||||
self->AddTimer("reset", 5.0f);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "SGCannon.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "ActivityMessages.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "Character.h"
|
||||
@@ -132,10 +133,15 @@ void SGCannon::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button
|
||||
if (!player) return;
|
||||
|
||||
if (identifier == u"Scoreboardinfo") {
|
||||
GameMessages::SendDisplayMessageBox(player->GetObjectID(), true,
|
||||
Game::zoneManager->GetZoneControlObject()->GetObjectID(),
|
||||
u"Shooting_Gallery_Retry", 2, u"Retry?",
|
||||
u"", player->GetSystemAddress());
|
||||
GameMessages::DisplayMessageBox messageBox;
|
||||
messageBox.target = player->GetObjectID();
|
||||
messageBox.bShow = true;
|
||||
messageBox.callbackClient = Game::zoneManager->GetZoneControlObject()->GetObjectID();
|
||||
messageBox.identifier = u"Shooting_Gallery_Retry";
|
||||
messageBox.imageID = 2;
|
||||
messageBox.text = u"Retry?";
|
||||
messageBox.userData = u"";
|
||||
messageBox.Send(player->GetSystemAddress());
|
||||
} else {
|
||||
if ((button == 1 && (identifier == u"Shooting_Gallery_Retry" || identifier == u"RePlay")) || identifier == u"SG1" || button == 0) {
|
||||
if (IsPlayerInActivity(self, player->GetObjectID())) return;
|
||||
@@ -187,7 +193,7 @@ void SGCannon::SpawnWaveTimerFunc(Entity* self) {
|
||||
|
||||
const auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
GameMessages::SendPlayFXEffect(player->GetObjectID(), -1, u"SG-start", "");
|
||||
GameMessages::PlayFXEffect(player->GetObjectID(), -1, u"SG-start", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::StartActivityTime startActivityTime;
|
||||
startActivityTime.target = self->GetObjectID();
|
||||
@@ -362,7 +368,7 @@ void SGCannon::StartGame(Entity* self) {
|
||||
activityStart.target = self->GetObjectID();
|
||||
activityStart.Send(player->GetSystemAddress());
|
||||
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), -1, u"start", "");
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"start", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetNetworkVar<bool>(ClearVariable, true);
|
||||
DoGameStartup(self);
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void NpcNpJetpackGuy::OnUse(Entity* self, Entity* user) {
|
||||
// No effect ID, the client plays the object's own effect of this type.
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"launch", "", LWOOBJID_EMPTY);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"launch", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NsConcertInstrument.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "Item.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "EntityManager.h"
|
||||
@@ -121,7 +122,10 @@ void NsConcertInstrument::StartPlayingInstrument(Entity* self, Entity* player) {
|
||||
EquipInstruments(self, player);
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"startPlaying", 0, 0,
|
||||
player->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::SendPlayCinematic(player->GetObjectID(), cinematics.at(instrumentLot), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = player->GetObjectID();
|
||||
cinematic.pathName = cinematics.at(instrumentLot);
|
||||
cinematic.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddCallbackTimer(1.0f, [player, instrumentLot]() {
|
||||
RenderComponent::PlayAnimation(player, animations.at(instrumentLot), 2.0f);
|
||||
});
|
||||
@@ -153,7 +157,11 @@ void NsConcertInstrument::StopPlayingInstrument(Entity* self, Entity* player) {
|
||||
missions->Progress(eMissionTaskType::SCRIPT, self->GetLOT());
|
||||
}
|
||||
|
||||
GameMessages::SendEndCinematic(player->GetObjectID(), cinematics.at(instrumentLot), UNASSIGNED_SYSTEM_ADDRESS, 1.0f);
|
||||
GameMessages::EndCinematic endCinematic;
|
||||
endCinematic.target = player->GetObjectID();
|
||||
endCinematic.pathName = cinematics.at(instrumentLot);
|
||||
endCinematic.leadOut = 1.0f;
|
||||
endCinematic.Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
RenderComponent::PlayAnimation(player, smashAnimations.at(instrumentLot), 2.0f);
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stopCheckingMovement", 0, 0,
|
||||
player->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "NsConcertChoiceBuildManager.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
@@ -206,8 +207,7 @@ void NsConcertQuickBuild::UpdateEffects(Entity* self) {
|
||||
for (const auto& effectName : setIterator->second.effects) {
|
||||
const auto effectObjects = Game::entityManager->GetEntitiesInGroup(quickBuildFX.at(effectName));
|
||||
for (auto* effectObject : effectObjects) {
|
||||
GameMessages::SendPlayFXEffect(effectObject, 0, GeneralUtils::ASCIIToUTF16(effectName),
|
||||
effectName + "Effect", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(effectObject->GetObjectID(), 0, GeneralUtils::ASCIIToUTF16(effectName), effectName + "Effect").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void NsConcertQuickBuild::CancelEffects(Entity* self) {
|
||||
for (const auto& effectName : setIterator->second.effects) {
|
||||
const auto effectObjects = Game::entityManager->GetEntitiesInGroup(quickBuildFX.at(effectName));
|
||||
for (auto* effectObject : effectObjects) {
|
||||
GameMessages::SendStopFXEffect(effectObject, true, effectName + "Effect");
|
||||
GameMessages::StopFXEffect(effectObject->GetObjectID(), true, effectName + "Effect").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "NsGetFactionMissionServer.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "Character.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
@@ -38,7 +39,10 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
|
||||
factionMissions.push_back(778);
|
||||
|
||||
if (celebrationID != -1) {
|
||||
GameMessages::SendStartCelebrationEffect(player, player->GetSystemAddress(), celebrationID);
|
||||
GameMessages::StartCelebrationEffect celebration;
|
||||
celebration.target = player->GetObjectID();
|
||||
celebration.celebrationID = celebrationID;
|
||||
celebration.SendToClient(player->GetSystemAddress());
|
||||
}
|
||||
|
||||
if (flagID != -1) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "PetMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void RockHydrantBroken::OnStartup(Entity* self) {
|
||||
self->AddTimer("playEffect", 1);
|
||||
@@ -40,6 +41,6 @@ void RockHydrantBroken::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->Kill();
|
||||
} else if (timerName == "playEffect") {
|
||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 4737, u"water", "water", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), 4737, u"water", "water").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "MissionComponent.h"
|
||||
#include "Item.h"
|
||||
#include "eMissionState.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void AgPropGuard::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
|
||||
auto* character = target->GetCharacter();
|
||||
@@ -17,7 +18,10 @@ void AgPropGuard::OnMissionDialogueOK(Entity* self, Entity* target, int missionI
|
||||
if (missionID == 768 && missionState == eMissionState::AVAILABLE) {
|
||||
// Players who have not touched the orb yet get a camera pan showing where it is.
|
||||
if (character && !character->GetPlayerFlag(71)) {
|
||||
GameMessages::SendPlayCinematic(target->GetObjectID(), u"MissionCam", target->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = target->GetObjectID();
|
||||
cinematic.pathName = u"MissionCam";
|
||||
cinematic.Send(target->GetSystemAddress());
|
||||
}
|
||||
} else if (missionID == 768 && missionState >= eMissionState::READY_TO_COMPLETE) {
|
||||
//remove the inventory items
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "AgPropguards.h"
|
||||
#include "Character.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "eMissionState.h"
|
||||
@@ -17,7 +18,10 @@ void AgPropguards::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
||||
if ((missionState == eMissionState::AVAILABLE || missionState == eMissionState::ACTIVE)
|
||||
&& !character->GetPlayerFlag(flag)) {
|
||||
// If the player just started the mission, play a cinematic highlighting the target
|
||||
GameMessages::SendPlayCinematic(target->GetObjectID(), u"MissionCam", target->GetSystemAddress());
|
||||
GameMessages::PlayCinematic cinematic;
|
||||
cinematic.target = target->GetObjectID();
|
||||
cinematic.pathName = u"MissionCam";
|
||||
cinematic.Send(target->GetSystemAddress());
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE) {
|
||||
// Makes the guard disappear once the mission has been completed
|
||||
const auto zoneControlID = Game::entityManager->GetZoneControlEntity()->GetObjectID();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "SpecialCoinSpawner.h"
|
||||
#include "CharacterComponent.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void SpecialCoinSpawner::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(1.5f, "powerupEnter");
|
||||
@@ -10,7 +11,7 @@ void SpecialCoinSpawner::OnProximityUpdate(Entity* self, Entity* entering, const
|
||||
if (!entering->IsPlayer()) return;
|
||||
auto character = entering->GetCharacter();
|
||||
if (!character) return;
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"pickup", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
character->SetCoins(character->GetCoins() + this->m_CurrencyDenomination, eLootSourceType::CURRENCY);
|
||||
self->Smash(entering->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "SpecialPowerupSpawner.h"
|
||||
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
@@ -15,7 +16,7 @@ void SpecialPowerupSpawner::OnProximityUpdate(Entity* self, Entity* entering, co
|
||||
if (!entering->IsPlayer()) return;
|
||||
if (self->GetVar<bool>(u"bIsDead")) return;
|
||||
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"pickup", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "SpecialSpeedBuffSpawner.h"
|
||||
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
@@ -15,7 +16,7 @@ void SpecialSpeedBuffSpawner::OnProximityUpdate(Entity* self, Entity* entering,
|
||||
if (!entering->IsPlayer()) return;
|
||||
if (self->GetVar<bool>(u"bIsDead")) return;
|
||||
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"pickup", "").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto skillComponent = entering->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "LupGenericInteract.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void LupGenericInteract::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayAnimation(self, u"interact");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"interact").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
#include "WildAmbientCrab.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildAmbientCrab::OnStartup(Entity* self){
|
||||
self->SetVar(u"flipped", true);
|
||||
GameMessages::SendPlayAnimation(self, u"idle");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"idle").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void WildAmbientCrab::OnUse(Entity* self, Entity* user) {
|
||||
auto flipped = self->GetVar<bool>(u"flipped");
|
||||
if (flipped) {
|
||||
self->AddTimer("Flipping", 0.6f);
|
||||
GameMessages::SendPlayAnimation(self, u"flip-over");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"flip-over").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar(u"flipped", false);
|
||||
} else if (!flipped) {
|
||||
self->AddTimer("Flipback", 0.8f);
|
||||
GameMessages::SendPlayAnimation(self, u"flip-back");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"flip-back").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar(u"flipped", true);
|
||||
}
|
||||
}
|
||||
|
||||
void WildAmbientCrab::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "Flipping") GameMessages::SendPlayAnimation(self, u"over-idle");
|
||||
else if (timerName == "Flipback") GameMessages::SendPlayAnimation(self, u"idle");
|
||||
if (timerName == "Flipping") GameMessages::PlayAnimation(self->GetObjectID(), u"over-idle").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (timerName == "Flipback") GameMessages::PlayAnimation(self->GetObjectID(), u"idle").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "WildAndScared.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildAndScared::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayAnimation(self, u"scared");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"scared").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "WildGfGlowbug.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildGfGlowbug::OnStartup(Entity* self){
|
||||
self->SetVar(u"switch", false);
|
||||
@@ -9,9 +10,9 @@ void WildGfGlowbug::OnFireEventServerSide(Entity* self, Entity* sender, std::str
|
||||
if (args == "physicsReady") {
|
||||
auto switchState = self->GetVar<bool>(u"switch");
|
||||
if (!switchState) {
|
||||
GameMessages::SendStopFXEffect(self, true, "glowlight");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "glowlight").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (switchState) {
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"light", "glowlight", LWOOBJID_EMPTY);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"light", "glowlight").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,10 +20,10 @@ void WildGfGlowbug::OnFireEventServerSide(Entity* self, Entity* sender, std::str
|
||||
void WildGfGlowbug::OnUse(Entity* self, Entity* user) {
|
||||
auto switchState = self->GetVar<bool>(u"switch");
|
||||
if (switchState) {
|
||||
GameMessages::SendStopFXEffect(self, true, "glowlight");
|
||||
GameMessages::StopFXEffect(self->GetObjectID(), true, "glowlight").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar(u"switch", false);
|
||||
} else if (!switchState) {
|
||||
GameMessages::SendPlayFXEffect(self, -1, u"light", "glowlight", LWOOBJID_EMPTY);
|
||||
GameMessages::PlayFXEffect(self->GetObjectID(), -1, u"light", "glowlight").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar(u"switch", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#include "WildNinjaBricks.h"
|
||||
#include "Entity.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildNinjaBricks::OnStartup(Entity* self) {
|
||||
self->AddToGroup("Ninjastuff");
|
||||
}
|
||||
|
||||
void WildNinjaBricks::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "Crane") GameMessages::SendPlayAnimation(self, u"crane");
|
||||
else if (name == "Tiger") GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
else if (name == "Mantis") GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
if (name == "Crane") GameMessages::PlayAnimation(self->GetObjectID(), u"crane").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (name == "Tiger") GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (name == "Mantis") GameMessages::PlayAnimation(self->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "WildNinjaSensei.h"
|
||||
#include "Entity.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildNinjaSensei::OnStartup(Entity* self) {
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->AddTimer("CraneStart", 5);
|
||||
}
|
||||
|
||||
@@ -12,25 +13,25 @@ void WildNinjaSensei::OnTimerDone(Entity* self, std::string timerName) {
|
||||
for (auto ninja : ninjas) ninja->NotifyObject(self, "Crane");
|
||||
self->AddTimer("Bow", 15.5f);
|
||||
self->AddTimer("TigerStart", 25);
|
||||
GameMessages::SendPlayAnimation(self, u"crane");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"crane").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "TigerStart") {
|
||||
auto ninjas = Game::entityManager->GetEntitiesInGroup("Ninjastuff");
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto ninja : ninjas) ninja->NotifyObject(self, "Tiger");
|
||||
self->AddTimer("Bow", 15.5f);
|
||||
self->AddTimer("MantisStart", 25);
|
||||
GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "MantisStart") {
|
||||
auto ninjas = Game::entityManager->GetEntitiesInGroup("Ninjastuff");
|
||||
GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
for (auto ninja : ninjas) ninja->NotifyObject(self, "Mantis");
|
||||
self->AddTimer("Bow", 15.5f);
|
||||
self->AddTimer("CraneStart", 25);
|
||||
GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "Bow") {
|
||||
auto ninjas = Game::entityManager->GetEntitiesInGroup("Ninjastuff");
|
||||
for (auto ninja : ninjas) ninja->NotifyObject(self, "Bow");
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#include "WildNinjaStudent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildNinjaStudent::OnStartup(Entity* self) {
|
||||
self->AddToGroup("Ninjastuff");
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
void WildNinjaStudent::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "Crane") GameMessages::SendPlayAnimation(self, u"crane");
|
||||
else if (name == "Tiger") GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
else if (name == "Mantis") GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
else if (name == "Bow") GameMessages::SendPlayAnimation(self, u"bow");
|
||||
if (name == "Crane") GameMessages::PlayAnimation(self->GetObjectID(), u"crane").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (name == "Tiger") GameMessages::PlayAnimation(self->GetObjectID(), u"tiger").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (name == "Mantis") GameMessages::PlayAnimation(self->GetObjectID(), u"mantis").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
else if (name == "Bow") GameMessages::PlayAnimation(self->GetObjectID(), u"bow").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "WildPants.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EffectsMessages.h"
|
||||
|
||||
void WildPants::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(5, "scardyPants");
|
||||
}
|
||||
|
||||
void WildPants::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||
if (status == "ENTER") GameMessages::SendPlayAnimation(self, u"scared");
|
||||
if (status == "ENTER") GameMessages::PlayAnimation(self->GetObjectID(), u"scared").Send(UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user