format codebase

This commit is contained in:
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -2,30 +2,25 @@
#include "GameMessages.h"
#include "EntityManager.h"
void CatapultBaseServer::OnNotifyObject(Entity *self, Entity *sender, const std::string& name, int32_t param1, int32_t param2)
{
if (name == "BouncerBuilt")
{
// start a timer for the arm to player the with bouncer animation
self->AddTimer("PlatAnim", .75);
void CatapultBaseServer::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
if (name == "BouncerBuilt") {
// start a timer for the arm to player the with bouncer animation
self->AddTimer("PlatAnim", .75);
// set the bouncer so we can use it later
self->SetVar(u"Bouncer", sender->GetObjectID());
// set the bouncer so we can use it later
self->SetVar(u"Bouncer", sender->GetObjectID());
GameMessages::SendBouncerActiveStatus(sender->GetObjectID(), true, UNASSIGNED_SYSTEM_ADDRESS);
}
}
void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName)
{
if (timerName == "PlatAnim")
{
// get the arm asset
const auto arm = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"ArmGroup"));
void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "PlatAnim") {
// get the arm asset
const auto arm = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"ArmGroup"));
// tell the arm to the play the platform animation, which is just the arm laying there but with bouncer
for (auto* obj : arm)
{
for (auto* obj : arm) {
GameMessages::SendPlayAnimation(obj, u"idle-platform");
GameMessages::SendPlayNDAudioEmitter(obj, UNASSIGNED_SYSTEM_ADDRESS, "{8cccf912-69e3-4041-a20b-63e4afafc993}");
// set the art so we can use it again
@@ -35,9 +30,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName)
// start a timer till the bouncer actually bounces
self->AddTimer("bounce", 3);
}
else if (timerName == "launchAnim")
{
} else if (timerName == "launchAnim") {
// get the arm asset
auto* arm = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
if (arm == nullptr) return;
@@ -46,9 +39,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName)
auto animTime = 1;
self->AddTimer("resetArm", animTime);
GameMessages::SendPlayAnimation(arm, u"launch");
}
else if (timerName == "bounce")
{
} else if (timerName == "bounce") {
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
if (bouncer == nullptr) return;
@@ -56,9 +47,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName)
bouncer->NotifyObject(bouncer, "bounceAllInProximity"); // Likely to trigger server side bounce, bodging this
// add a delay to play the animation
self->AddTimer("launchAnim", .3);
}
else if (timerName == "resetArm")
{
} else if (timerName == "resetArm") {
auto* arm = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
if (arm == nullptr) return;