From 1e85ae203563ebf6f5fc366aaa6a8d6b4afae8b5 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Sun, 17 Apr 2022 15:58:26 -0500 Subject: [PATCH] tabs and log --- dScripts/RockHydrantBroken.cpp | 51 +++++++++++++++++----------------- dScripts/WhFans.cpp | 2 ++ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/dScripts/RockHydrantBroken.cpp b/dScripts/RockHydrantBroken.cpp index 2c145b36..b3d7f717 100644 --- a/dScripts/RockHydrantBroken.cpp +++ b/dScripts/RockHydrantBroken.cpp @@ -4,43 +4,44 @@ void RockHydrantBroken::OnStartup(Entity* self) { - self->AddTimer("playEffect", 1); + self->AddTimer("playEffect", 1); - const auto hydrant = "hydrant" + self->GetVar(u"hydrant"); + const auto hydrant = "hydrant" + self->GetVar(u"hydrant"); - const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant); + const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant); - Game::logger->Log("RockHydrantBroken", "Broken Hydrant spawned (%s)\n", hydrant.c_str()); + Game::logger->Log("RockHydrantBroken", "Broken Rock Hydrant spawned (%s)\n", hydrant.c_str()); - for (auto* bouncer : bouncers) - { - self->SetVar(u"bouncer", bouncer->GetObjectID()); + for (auto* bouncer : bouncers) + { + self->SetVar(u"bouncer", bouncer->GetObjectID()); + Game::logger->Log("RockHydrantBroken", "Activate Bouncer (%s)\n", bouncer.c_str()); - GameMessages::SendBouncerActiveStatus(bouncer->GetObjectID(), true, UNASSIGNED_SYSTEM_ADDRESS); + GameMessages::SendBouncerActiveStatus(bouncer->GetObjectID(), true, UNASSIGNED_SYSTEM_ADDRESS); - GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision", UNASSIGNED_SYSTEM_ADDRESS); - } + GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"enableCollision", UNASSIGNED_SYSTEM_ADDRESS); + } - self->AddTimer("KillBroken", 25); + self->AddTimer("KillBroken", 10); } void RockHydrantBroken::OnTimerDone(Entity* self, std::string timerName) { - if (timerName == "KillBroken") - { - auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar(u"bouncer")); + if (timerName == "KillBroken") + { + auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar(u"bouncer")); - if (bouncer != nullptr) - { - GameMessages::SendBouncerActiveStatus(bouncer->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS); + if (bouncer != nullptr) + { + GameMessages::SendBouncerActiveStatus(bouncer->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS); - GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision", UNASSIGNED_SYSTEM_ADDRESS); - } + GameMessages::SendNotifyObject(bouncer->GetObjectID(), self->GetObjectID(), u"disableCollision", UNASSIGNED_SYSTEM_ADDRESS); + } - self->Kill(); - } - else if (timerName == "playEffect") - { - GameMessages::SendPlayFXEffect(self->GetObjectID(), 384, u"water", "water", LWOOBJID_EMPTY, 1, 1, true); - } + self->Kill(); + } + else if (timerName == "playEffect") + { + GameMessages::SendPlayFXEffect(self->GetObjectID(), 384, u"water", "water", LWOOBJID_EMPTY, 1, 1, true); + } } diff --git a/dScripts/WhFans.cpp b/dScripts/WhFans.cpp index 39bbab3b..dffedc14 100644 --- a/dScripts/WhFans.cpp +++ b/dScripts/WhFans.cpp @@ -11,6 +11,8 @@ void WhFans::OnStartup(Entity* self) { void WhFans::ToggleFX(Entity* self, bool hit) { std::string fanGroup = self->GetGroups()[0]; + + Game::logger->Log("WhFans", "Toggling FX for Fan Group(%s)\n", fanGroup.c_str()); std::vector fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup); auto renderComponent = self->GetComponent();