mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Move EntityManager to Game namespace (#1140)
* Move EntityManager to Game namespace * move initialization to later Need to wait for dZoneManager to be initialized. * Fix bugs - Cannot delete from a RandomAccessIterator while in a range based for loop. Touchup zone manager initialize replace magic numbers with better named constants replace magic zonecontrol id with a more readable hex alternative condense stack variables move initializers closer to their use initialize entity manager with zone control change initialize timings If zone is not zero we expect to initialize the entity manager during zone manager initialization Add constexpr for zone control LOT * Add proper error handling * revert vanity changes * Update WorldServer.cpp * Update dZoneManager.cpp
This commit is contained in:
@@ -61,13 +61,13 @@ void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
|
||||
}
|
||||
|
||||
// There is suppose to be a 0.1 second delay here but that may be admitted?
|
||||
auto* controller = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* controller = Game::entityManager->GetZoneControlEntity();
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SetColGroup", 10, 0, 0, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
self->SetPosition({ 10000, 0, 10000 });
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
controller->OnFireEventServerSide(self, "ClearProperty");
|
||||
}
|
||||
@@ -97,7 +97,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
||||
|
||||
rot = controllable->GetRotation();
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
auto* baseCombatAi = self->GetComponent<BaseCombatAIComponent>();
|
||||
|
||||
@@ -113,7 +113,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
||||
//TODO: Set faction to -1 and set immunity
|
||||
destroyable->SetFaction(-1);
|
||||
destroyable->SetIsImmune(true);
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
self->AddTimer("WithdrawComplete", withdrawTime + 1.0f);
|
||||
waitForIdle = true;
|
||||
@@ -146,7 +146,7 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
|
||||
//Reset the current wave death counter
|
||||
m_DeathCounter = 0;
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
// Prepare a timer for post leap attack
|
||||
self->AddTimer("AdvanceAttack", attackPause);
|
||||
@@ -179,7 +179,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
|
||||
|
||||
std::vector<LWOOBJID> spiderEggs{};
|
||||
|
||||
auto spooders = EntityManager::Instance()->GetEntitiesInGroup("EGG");
|
||||
auto spooders = Game::entityManager->GetEntitiesInGroup("EGG");
|
||||
for (auto spodder : spooders) {
|
||||
spiderEggs.push_back(spodder->GetObjectID());
|
||||
}
|
||||
@@ -201,7 +201,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
|
||||
}
|
||||
|
||||
if (randomEgg) {
|
||||
auto* eggEntity = EntityManager::Instance()->GetEntity(randomEgg);
|
||||
auto* eggEntity = Game::entityManager->GetEntity(randomEgg);
|
||||
|
||||
if (eggEntity == nullptr) {
|
||||
continue;
|
||||
@@ -234,7 +234,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
|
||||
// We have successfully readied a full wave
|
||||
// initiate hatching!
|
||||
for (auto egg : hatchList) {
|
||||
auto* eggEntity = EntityManager::Instance()->GetEntity(egg);
|
||||
auto* eggEntity = Game::entityManager->GetEntity(egg);
|
||||
|
||||
if (eggEntity == nullptr) {
|
||||
continue;
|
||||
@@ -304,7 +304,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self) {
|
||||
|
||||
void BossSpiderQueenEnemyServer::RainOfFireManager(Entity* self) {
|
||||
if (!impactList.empty()) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(impactList[0]);
|
||||
auto* entity = Game::entityManager->GetEntity(impactList[0]);
|
||||
|
||||
impactList.erase(impactList.begin());
|
||||
|
||||
@@ -408,7 +408,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
controllable->SetStatic(false);
|
||||
controllable->SetRotation(rot);
|
||||
controllable->SetStatic(true);
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
//Play the Spider Boss' mountain idle anim
|
||||
auto time = PlayAnimAndReturnTime(self, spiderWithdrawIdle);
|
||||
@@ -419,7 +419,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
rot = controllable->GetRotation();
|
||||
|
||||
//If there are still baby spiders, don't do anyhting either
|
||||
const auto spiders = EntityManager::Instance()->GetEntitiesInGroup("BabySpider");
|
||||
const auto spiders = Game::entityManager->GetEntitiesInGroup("BabySpider");
|
||||
if (spiders.size() > 0)
|
||||
self->AddTimer("checkForSpiders", time);
|
||||
else
|
||||
@@ -491,7 +491,7 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
}*/
|
||||
|
||||
auto landingTarget = self->GetI64(u"LandingTarget");
|
||||
auto landingEntity = EntityManager::Instance()->GetEntity(landingTarget);
|
||||
auto landingEntity = Game::entityManager->GetEntity(landingTarget);
|
||||
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
@@ -547,10 +547,10 @@ void BossSpiderQueenEnemyServer::OnTimerDone(Entity* self, const std::string tim
|
||||
destroyable->SetIsImmune(false);
|
||||
destroyable->SetFaction(4);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
} else if (timerName == "Clear") {
|
||||
EntityManager::Instance()->FireEventServerSide(self, "ClearProperty");
|
||||
Game::entityManager->FireEventServerSide(self, "ClearProperty");
|
||||
self->CancelAllTimers();
|
||||
} else if (timerName == "UnlockSpecials") {
|
||||
//We no longer need to lock specials
|
||||
@@ -605,7 +605,7 @@ void BossSpiderQueenEnemyServer::OnUpdate(Entity* self) {
|
||||
controllable->SetRotation(NiQuaternion::IDENTITY);
|
||||
controllable->SetStatic(true);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
}
|
||||
|
||||
//----------------------------------------------
|
||||
|
@@ -28,7 +28,7 @@ void AmDarklingDragon::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
auto golemId = self->GetVar<LWOOBJID>(u"Golem");
|
||||
|
||||
auto* golem = EntityManager::Instance()->GetEntity(golemId);
|
||||
auto* golem = Game::entityManager->GetEntity(golemId);
|
||||
|
||||
if (golem != nullptr) {
|
||||
golem->Smash(self->GetObjectID());
|
||||
@@ -109,9 +109,9 @@ void AmDarklingDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
||||
new LDFData<LWOOBJID>(u"Dragon", self->GetObjectID())
|
||||
};
|
||||
|
||||
auto* golemObject = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* golemObject = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(golemObject);
|
||||
Game::entityManager->ConstructEntity(golemObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
void FvMaelstromCavalry::OnStartup(Entity* self) {
|
||||
for (const auto& group : self->GetGroups()) {
|
||||
const auto& objects = EntityManager::Instance()->GetEntitiesInGroup(group);
|
||||
const auto& objects = Game::entityManager->GetEntitiesInGroup(group);
|
||||
|
||||
for (auto* obj : objects) {
|
||||
if (obj->GetLOT() != 8551) continue;
|
||||
@@ -22,7 +22,7 @@ void FvMaelstromCavalry::OnDie(Entity* self, Entity* killer) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& triggers = EntityManager::Instance()->GetEntitiesInGroup("HorsemenTrigger");
|
||||
const auto& triggers = Game::entityManager->GetEntitiesInGroup("HorsemenTrigger");
|
||||
|
||||
for (auto* trigger : triggers) {
|
||||
trigger->OnFireEventServerSide(self, "HorsemenDeath");
|
||||
|
@@ -35,13 +35,13 @@ void FvMaelstromDragon::OnDie(Entity* self, Entity* killer) {
|
||||
info.rot = rotation;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* chest = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* chest = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(chest);
|
||||
Game::entityManager->ConstructEntity(chest);
|
||||
|
||||
auto golemId = self->GetVar<LWOOBJID>(u"Golem");
|
||||
|
||||
auto* golem = EntityManager::Instance()->GetEntity(golemId);
|
||||
auto* golem = Game::entityManager->GetEntity(golemId);
|
||||
|
||||
if (golem != nullptr) {
|
||||
golem->Smash(self->GetObjectID());
|
||||
@@ -125,9 +125,9 @@ void FvMaelstromDragon::OnHitOrHealResult(Entity* self, Entity* attacker, int32_
|
||||
new LDFData<LWOOBJID>(u"Dragon", self->GetObjectID())
|
||||
};
|
||||
|
||||
auto* golemObject = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* golemObject = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(golemObject);
|
||||
Game::entityManager->ConstructEntity(golemObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ void BaseEnemyApe::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void BaseEnemyApe::OnDie(Entity* self, Entity* killer) {
|
||||
auto* anchor = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"QB"));
|
||||
auto* anchor = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"QB"));
|
||||
if (anchor != nullptr && !anchor->GetIsDead()) {
|
||||
anchor->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->SetArmor(destroyableComponent->GetMaxArmor() / timesStunned);
|
||||
}
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
GameMessages::SendChangeIdleFlags(self->GetObjectID(), eAnimationFlags::IDLE_COMBAT, eAnimationFlags::IDLE_NONE, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
self->SetVar<uint32_t>(u"timesStunned", timesStunned + 1);
|
||||
StunApe(self, false);
|
||||
@@ -92,14 +92,14 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
|
||||
new LDFData<LWOOBJID>(u"ape", self->GetObjectID())
|
||||
};
|
||||
|
||||
auto* anchor = EntityManager::Instance()->CreateEntity(entityInfo);
|
||||
EntityManager::Instance()->ConstructEntity(anchor);
|
||||
auto* anchor = Game::entityManager->CreateEntity(entityInfo);
|
||||
Game::entityManager->ConstructEntity(anchor);
|
||||
self->SetVar<LWOOBJID>(u"QB", anchor->GetObjectID());
|
||||
|
||||
} else if (timerName == "anchorDamageTimer") {
|
||||
|
||||
// Attacks the ape with some god skill
|
||||
const auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"smasher"));
|
||||
const auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"smasher"));
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
@@ -38,8 +38,8 @@ void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
|
||||
info.spawnerID = self->GetObjectID();
|
||||
info.settings = cfg;
|
||||
|
||||
Entity* turret = EntityManager::Instance()->CreateEntity(info, nullptr);
|
||||
Entity* turret = Game::entityManager->CreateEntity(info, nullptr);
|
||||
if (turret) {
|
||||
EntityManager::Instance()->ConstructEntity(turret);
|
||||
Game::entityManager->ConstructEntity(turret);
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ void GfApeSmashingQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
|
||||
void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
auto* ape = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
||||
auto* ape = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
||||
if (ape != nullptr) {
|
||||
ape->OnFireEventServerSide(target, "rebuildDone");
|
||||
RenderComponent::PlayAnimation(self, u"smash", 1.7f);
|
||||
|
@@ -29,7 +29,7 @@ void TreasureChestDragonServer::OnUse(Entity* self, Entity* user) {
|
||||
rating = team->members.size();
|
||||
|
||||
for (const auto member : team->members) {
|
||||
auto* memberObject = EntityManager::Instance()->GetEntity(member);
|
||||
auto* memberObject = Game::entityManager->GetEntity(member);
|
||||
|
||||
if (memberObject == nullptr) continue;
|
||||
|
||||
|
@@ -7,14 +7,14 @@
|
||||
#include "Loot.h"
|
||||
|
||||
void BootyDigServer::OnStartup(Entity* self) {
|
||||
auto* zoneControlObject = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* zoneControlObject = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControlObject != nullptr) {
|
||||
zoneControlObject->OnFireEventServerSide(self, "CheckForPropertyOwner");
|
||||
}
|
||||
}
|
||||
|
||||
void BootyDigServer::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
auto* zoneControlObject = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* zoneControlObject = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControlObject != nullptr) {
|
||||
zoneControlObject->OnFireEventServerSide(self, "CheckForPropertyOwner");
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ void MaestromExtracticatorServer::OnFireEventServerSide(Entity* self, Entity* se
|
||||
if (sender == nullptr) return;
|
||||
|
||||
if (args == "attemptCollection") {
|
||||
Entity* player = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
|
||||
Entity* player = Game::entityManager->GetEntity(self->GetSpawnerID());
|
||||
if (!player) return;
|
||||
|
||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
||||
//Tell the client to spawn the baby spiderling:
|
||||
auto spooders = EntityManager::Instance()->GetEntitiesInGroup("cagedSpider");
|
||||
auto spooders = Game::entityManager->GetEntitiesInGroup("cagedSpider");
|
||||
for (auto spodder : spooders) {
|
||||
GameMessages::SendFireEventClientSide(spodder->GetObjectID(), user->GetSystemAddress(), u"toggle", LWOOBJID_EMPTY, 0, 0, user->GetObjectID());
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ void AgMonumentBirds::OnProximityUpdate(Entity* self, Entity* entering, std::str
|
||||
void AgMonumentBirds::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName != "killBird") return;
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"PlayerID"));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"PlayerID"));
|
||||
|
||||
if (player == nullptr) return;
|
||||
|
||||
|
@@ -2,14 +2,14 @@
|
||||
#include "EntityManager.h"
|
||||
|
||||
void AgMonumentLaserServer::OnStartup(Entity* self) {
|
||||
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
auto lasers = Game::entityManager->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
for (auto laser : lasers) {
|
||||
if (laser) laser->SetBoolean(u"active", true);
|
||||
}
|
||||
}
|
||||
|
||||
void AgMonumentLaserServer::OnDie(Entity* self, Entity* killer) {
|
||||
auto lasers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
auto lasers = Game::entityManager->GetEntitiesInGroup(self->GetVarAsString(u"volGroup"));
|
||||
for (auto laser : lasers) {
|
||||
if (laser) laser->SetBoolean(u"active", false);
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
|
||||
void AgMonumentRaceCancel::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
auto managers = EntityManager::Instance()->GetEntitiesInGroup("race_manager");
|
||||
auto managers = Game::entityManager->GetEntitiesInGroup("race_manager");
|
||||
if (!managers.empty()) {
|
||||
managers[0]->OnFireEventServerSide(target, "course_cancel");
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ void AgMonumentRaceGoal::OnStartup(Entity* self) {
|
||||
|
||||
void AgMonumentRaceGoal::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||
if (name == "RaceGoal" && entering && entering->IsPlayer() && status == "ENTER") {
|
||||
auto managers = EntityManager::Instance()->GetEntitiesInGroup("race_manager");
|
||||
auto managers = Game::entityManager->GetEntitiesInGroup("race_manager");
|
||||
if (managers.empty() || !managers.at(0)) return;
|
||||
managers.at(0)->OnFireEventServerSide(entering, "course_finish");
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
|
||||
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(sender->GetObjectID());
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
} else if (identifier == u"player_dialog_start_course" && button == 1) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"start_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
|
||||
@@ -54,7 +54,7 @@ void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int3
|
||||
|
||||
data->values[1] = *(float*)&startTime;
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
} else if (identifier == u"FootRaceCancel") {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
|
||||
@@ -95,7 +95,7 @@ void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
"performact_time");
|
||||
}
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
LeaderboardManager::SaveScore(sender->GetObjectID(), scriptedActivityComponent->GetActivityID(),
|
||||
0, (uint32_t)finish);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
: std::vector<std::string>{ "MaelstromSamples", "MaelstromSamples2ndary1", "MaelstromSamples2ndary2" };
|
||||
|
||||
for (const auto& group : groups) {
|
||||
auto samples = EntityManager::Instance()->GetEntitiesInGroup(group);
|
||||
auto samples = Game::entityManager->GetEntitiesInGroup(group);
|
||||
for (auto* sample : samples) {
|
||||
GameMessages::SendNotifyClientObject(sample->GetObjectID(), u"SetVisibility", visible, 0,
|
||||
target->GetObjectID(), "", target->GetSystemAddress());
|
||||
|
@@ -63,7 +63,7 @@ void ZoneAgSpiderQueen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
|
||||
if (timerName == "killSpider") {
|
||||
auto spawnTargets = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(LandTargetGroup));
|
||||
auto spawnTargets = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(LandTargetGroup));
|
||||
for (auto* spawnTarget : spawnTargets) {
|
||||
EntityInfo info{};
|
||||
|
||||
@@ -75,8 +75,8 @@ void ZoneAgSpiderQueen::OnTimerDone(Entity* self, std::string timerName) {
|
||||
new LDFData<LWOOBJID>(u"parent_tag", self->GetObjectID())
|
||||
};
|
||||
|
||||
auto* chest = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(chest);
|
||||
auto* chest = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(chest);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,16 +27,16 @@ void AmBlueX::OnSkillEventFired(Entity* self, Entity* caster, const std::string&
|
||||
info.rot = self->GetRotation();
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* fxObject = EntityManager::Instance()->CreateEntity(info, nullptr, self);
|
||||
EntityManager::Instance()->ConstructEntity(fxObject);
|
||||
auto* fxObject = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(fxObject);
|
||||
|
||||
auto fxObjectID = fxObject->GetObjectID();
|
||||
auto playerID = caster->GetObjectID();
|
||||
|
||||
// Add a callback for the bomb to explode
|
||||
self->AddCallbackTimer(m_BombTime, [this, self, fxObjectID, playerID]() {
|
||||
auto* fxObject = EntityManager::Instance()->GetEntity(fxObjectID);
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* fxObject = Game::entityManager->GetEntity(fxObjectID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr)
|
||||
|
@@ -6,7 +6,7 @@ void AmBridge::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
||||
|
||||
if (consoles.empty()) {
|
||||
return;
|
||||
|
@@ -68,7 +68,7 @@ void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
simplePhysicsComponent->SetAngularVelocity(NiPoint3::ZERO);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(bridge);
|
||||
Game::entityManager->SerializeEntity(bridge);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void AmDrawBridge::MoveBridgeDown(Entity* self, Entity* bridge, bool down) {
|
||||
|
||||
simplePhysicsComponent->SetAngularVelocity(forwardVect);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(bridge);
|
||||
Game::entityManager->SerializeEntity(bridge);
|
||||
|
||||
self->AddTimer("rotateBridgeDown", travelTime);
|
||||
}
|
||||
@@ -118,5 +118,5 @@ void AmDrawBridge::NotifyDie(Entity* self, Entity* other) {
|
||||
Entity* AmDrawBridge::GetBridge(Entity* self) {
|
||||
const auto bridgeID = self->GetVar<LWOOBJID>(u"BridgeID");
|
||||
|
||||
return EntityManager::Instance()->GetEntity(bridgeID);
|
||||
return Game::entityManager->GetEntity(bridgeID);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ void AmShieldGenerator::OnProximityUpdate(Entity* self, Entity* entering, std::s
|
||||
void AmShieldGenerator::OnDie(Entity* self, Entity* killer) {
|
||||
self->CancelAllTimers();
|
||||
|
||||
auto* child = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Child"));
|
||||
auto* child = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Child"));
|
||||
|
||||
if (child != nullptr) {
|
||||
child->Kill();
|
||||
@@ -69,7 +69,7 @@ void AmShieldGenerator::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||
|
||||
for (const auto enemyID : enemiesInProximity) {
|
||||
auto* enemy = EntityManager::Instance()->GetEntity(enemyID);
|
||||
auto* enemy = Game::entityManager->GetEntity(enemyID);
|
||||
|
||||
if (enemy != nullptr) {
|
||||
EnemyEnteredShield(self, enemy);
|
||||
@@ -94,7 +94,7 @@ void AmShieldGenerator::StartShield(Entity* self) {
|
||||
info.rot = myRot;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* child = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* child = Game::entityManager->CreateEntity(info);
|
||||
|
||||
self->SetVar(u"Child", child->GetObjectID());
|
||||
|
||||
@@ -111,7 +111,7 @@ void AmShieldGenerator::BuffPlayers(Entity* self) {
|
||||
auto entitiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Players");
|
||||
|
||||
for (const auto playerID : entitiesInProximity) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -69,7 +69,7 @@ void AmShieldGeneratorQuickbuild::OnProximityUpdate(Entity* self, Entity* enteri
|
||||
void AmShieldGeneratorQuickbuild::OnDie(Entity* self, Entity* killer) {
|
||||
self->CancelAllTimers();
|
||||
|
||||
auto* child = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Child"));
|
||||
auto* child = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Child"));
|
||||
|
||||
if (child != nullptr) {
|
||||
child->Kill();
|
||||
@@ -89,7 +89,7 @@ void AmShieldGeneratorQuickbuild::OnTimerDone(Entity* self, std::string timerNam
|
||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||
|
||||
for (const auto enemyID : enemiesInProximity) {
|
||||
auto* enemy = EntityManager::Instance()->GetEntity(enemyID);
|
||||
auto* enemy = Game::entityManager->GetEntity(enemyID);
|
||||
|
||||
if (enemy != nullptr) {
|
||||
EnemyEnteredShield(self, enemy);
|
||||
@@ -106,7 +106,7 @@ void AmShieldGeneratorQuickbuild::OnRebuildComplete(Entity* self, Entity* target
|
||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||
|
||||
for (const auto enemyID : enemiesInProximity) {
|
||||
auto* enemy = EntityManager::Instance()->GetEntity(enemyID);
|
||||
auto* enemy = Game::entityManager->GetEntity(enemyID);
|
||||
|
||||
if (enemy != nullptr) {
|
||||
enemy->Smash();
|
||||
@@ -116,7 +116,7 @@ void AmShieldGeneratorQuickbuild::OnRebuildComplete(Entity* self, Entity* target
|
||||
auto entitiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Players");
|
||||
|
||||
for (const auto playerID : entitiesInProximity) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
continue;
|
||||
@@ -146,7 +146,7 @@ void AmShieldGeneratorQuickbuild::StartShield(Entity* self) {
|
||||
info.rot = myRot;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* child = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* child = Game::entityManager->CreateEntity(info);
|
||||
|
||||
self->SetVar(u"Child", child->GetObjectID());
|
||||
|
||||
@@ -163,7 +163,7 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) {
|
||||
auto entitiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Players");
|
||||
|
||||
for (const auto playerID : entitiesInProximity) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -44,7 +44,7 @@ Entity* AmSkullkinDrill::GetStandObj(Entity* self) {
|
||||
|
||||
groupName.push_back(myGroup[0][myGroup[0].size() - 1]);
|
||||
|
||||
const auto standObjs = EntityManager::Instance()->GetEntitiesInGroup(groupName);
|
||||
const auto standObjs = Game::entityManager->GetEntitiesInGroup(groupName);
|
||||
|
||||
if (standObjs.empty()) {
|
||||
return nullptr;
|
||||
@@ -105,16 +105,16 @@ void AmSkullkinDrill::OnWaypointReached(Entity* self, uint32_t waypointIndex) {
|
||||
info.scale = 3; // Needs the scale, otherwise attacks fail
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* child = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* child = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(child);
|
||||
Game::entityManager->ConstructEntity(child);
|
||||
|
||||
self->SetVar(u"ChildSmash", child->GetObjectID());
|
||||
|
||||
child->AddDieCallback([this, self]() {
|
||||
const auto& userID = self->GetVar<LWOOBJID>(u"activaterID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(userID);
|
||||
auto* player = Game::entityManager->GetEntity(userID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -180,7 +180,7 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
|
||||
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"userID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player != nullptr) {
|
||||
PlayAnim(self, player, "spinjitzu-staff-end");
|
||||
@@ -199,7 +199,7 @@ void AmSkullkinDrill::OnArrived(Entity* self, uint32_t waypointIndex) {
|
||||
}
|
||||
|
||||
void AmSkullkinDrill::PlayCinematic(Entity* self) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"userID"));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"userID"));
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -235,7 +235,7 @@ void AmSkullkinDrill::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t
|
||||
|
||||
const auto activaterID = self->GetVar<LWOOBJID>(u"activaterID");
|
||||
|
||||
auto* activator = EntityManager::Instance()->GetEntity(activaterID);
|
||||
auto* activator = Game::entityManager->GetEntity(activaterID);
|
||||
|
||||
// TODO: Missions
|
||||
if (activator != nullptr) {
|
||||
@@ -263,7 +263,7 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "killDrill") {
|
||||
const auto childID = self->GetVar<LWOOBJID>(u"ChildSmash");
|
||||
|
||||
auto* child = EntityManager::Instance()->GetEntity(childID);
|
||||
auto* child = Game::entityManager->GetEntity(childID);
|
||||
|
||||
if (child != nullptr) {
|
||||
child->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
@@ -301,7 +301,7 @@ void AmSkullkinDrill::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"userID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -64,9 +64,9 @@ void AmSkullkinTower::SpawnLegs(Entity* self, const std::string& loc) {
|
||||
|
||||
info.rot = NiQuaternion::LookAt(info.pos, self->GetPosition());
|
||||
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(entity);
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
|
||||
OnChildLoaded(self, entity);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void AmSkullkinTower::OnChildLoaded(Entity* self, Entity* child) {
|
||||
const auto selfID = self->GetObjectID();
|
||||
|
||||
child->AddDieCallback([this, selfID, child]() {
|
||||
auto* self = EntityManager::Instance()->GetEntity(selfID);
|
||||
auto* self = Game::entityManager->GetEntity(selfID);
|
||||
auto* destroyableComponent = child->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr || self == nullptr) {
|
||||
@@ -157,7 +157,7 @@ void AmSkullkinTower::OnChildRemoved(Entity* self, Entity* child) {
|
||||
const auto& players = self->GetVar<std::vector<LWOOBJID>>(u"Players");
|
||||
|
||||
for (const auto& playerID : players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
continue;
|
||||
@@ -233,9 +233,9 @@ void AmSkullkinTower::OnTimerDone(Entity* self, std::string timerName) {
|
||||
for (size_t i = 0; i < 2; i++) {
|
||||
info.pos.x += i * 2; // Just to set the apart a bit
|
||||
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(entity);
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
}
|
||||
|
||||
self->AddTimer("killTower", 0.7f);
|
||||
|
@@ -22,13 +22,13 @@ void EnemyRoninSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
info.rot = self->GetRotation();
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* spawnedEntity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* spawnedEntity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
if (spawnedEntity == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(spawnedEntity);
|
||||
Game::entityManager->ConstructEntity(spawnedEntity);
|
||||
|
||||
spawnedEntity->AddCallbackTimer(60, [spawnedEntity]() {
|
||||
spawnedEntity->Smash(spawnedEntity->GetObjectID());
|
||||
|
@@ -33,7 +33,7 @@ FvHorsemenTrigger::OnFireEventServerSide(Entity* self, Entity* sender, std::stri
|
||||
|
||||
if (args == "HorsemenDeath") {
|
||||
for (const auto& playerId : self->GetVar<std::vector<LWOOBJID>>(u"players")) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||
auto* player = Game::entityManager->GetEntity(playerId);
|
||||
|
||||
if (player == nullptr) {
|
||||
continue;
|
||||
|
@@ -23,7 +23,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (!self->GetNetworkVar<bool>(u"used")) {
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
|
||||
auto bothBuilt = false;
|
||||
|
||||
@@ -59,7 +59,7 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
onFX = 2779;
|
||||
}
|
||||
|
||||
const auto& facility = EntityManager::Instance()->GetEntitiesInGroup("FacilityPipes");
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeEnergy");
|
||||
@@ -106,13 +106,13 @@ void ImgBrickConsoleQB::SpawnBrick(Entity* self) {
|
||||
}
|
||||
|
||||
void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
||||
const auto brick = EntityManager::Instance()->GetEntitiesInGroup("Imagination");
|
||||
const auto brick = Game::entityManager->GetEntitiesInGroup("Imagination");
|
||||
if (!brick.empty()) {
|
||||
GameMessages::SendPlayFXEffect(brick[0]->GetObjectID(), 122, u"create", "bluebrick");
|
||||
GameMessages::SendPlayFXEffect(brick[0]->GetObjectID(), 1034, u"cast", "imaginationexplosion");
|
||||
}
|
||||
|
||||
const auto canisters = EntityManager::Instance()->GetEntitiesInGroup("Canister");
|
||||
const auto canisters = Game::entityManager->GetEntitiesInGroup("Canister");
|
||||
for (auto* canister : canisters) {
|
||||
canister->Smash(canister->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
@@ -135,14 +135,14 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
energyFX = 2778;
|
||||
}
|
||||
|
||||
const auto& facility = EntityManager::Instance()->GetEntitiesInGroup("FacilityPipes");
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeOff");
|
||||
GameMessages::SendPlayFXEffect(facility[0]->GetObjectID(), energyFX, u"create", location + "PipeEnergy");
|
||||
}
|
||||
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
|
||||
for (auto* console : consoles) {
|
||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
||||
@@ -179,7 +179,7 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
||||
offFX = 2777;
|
||||
}
|
||||
|
||||
const auto& facility = EntityManager::Instance()->GetEntitiesInGroup("FacilityPipes");
|
||||
const auto& facility = Game::entityManager->GetEntitiesInGroup("FacilityPipes");
|
||||
|
||||
if (!facility.empty()) {
|
||||
GameMessages::SendStopFXEffect(facility[0], true, location + "PipeEnergy");
|
||||
@@ -233,7 +233,7 @@ void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
} else if (timerName == "Die") {
|
||||
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||
|
||||
for (auto* console : consoles) {
|
||||
console->Smash(console->GetObjectID(), eKillType::VIOLENT);
|
||||
|
@@ -29,7 +29,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
Entity* player;
|
||||
|
||||
if (possessableComponent != nullptr) {
|
||||
player = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||
player = Game::entityManager->GetEntity(possessableComponent->GetPossessor());
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -43,7 +43,7 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
return;
|
||||
}
|
||||
|
||||
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||
vehicle = Game::entityManager->GetEntity(possessorComponent->GetPossessable());
|
||||
|
||||
if (vehicle == nullptr) {
|
||||
return;
|
||||
|
@@ -40,7 +40,7 @@ void GfCaptainsCannon::OnUse(Entity* self, Entity* user) {
|
||||
void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
const auto playerId = self->GetVar<LWOOBJID>(u"userID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||
auto* player = Game::entityManager->GetEntity(playerId);
|
||||
|
||||
if (player == nullptr) {
|
||||
self->SetVar<bool>(u"bIsInUse", false);
|
||||
@@ -56,7 +56,7 @@ void GfCaptainsCannon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
self->AddTimer("cinematicTimer", cinematicTime);
|
||||
|
||||
const auto sharkObjects = EntityManager::Instance()->GetEntitiesInGroup("SharkCannon");
|
||||
const auto sharkObjects = Game::entityManager->GetEntitiesInGroup("SharkCannon");
|
||||
|
||||
for (auto* shark : sharkObjects) {
|
||||
if (shark->GetLOT() != m_SharkItemID) continue;
|
||||
|
@@ -32,7 +32,7 @@ void GfTikiTorch::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "Relight") {
|
||||
LightTorch(self);
|
||||
} else if (timerName == "InteractionCooldown") {
|
||||
Entity* player = EntityManager::Instance()->GetEntity(self->GetI64(u"userID"));
|
||||
Entity* player = Game::entityManager->GetEntity(self->GetI64(u"userID"));
|
||||
|
||||
if (player != nullptr && player->GetCharacter()) {
|
||||
GameMessages::SendTerminateInteraction(player->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
|
@@ -33,7 +33,7 @@ void MastTeleport::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
const auto playerId = self->GetVar<LWOOBJID>(u"userID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||
auto* player = Game::entityManager->GetEntity(playerId);
|
||||
|
||||
if (player == nullptr) return;
|
||||
|
||||
@@ -88,6 +88,6 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
||||
);
|
||||
auto* destroyableComponent = player->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetStatusImmunity(eStateChangeType::POP, true, true, true, true, true, false, false, true, true);
|
||||
EntityManager::Instance()->SerializeEntity(player);
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
}
|
||||
}
|
||||
|
@@ -18,5 +18,5 @@ void ForceVolumeServer::OnStartup(Entity* self) {
|
||||
phantomPhysicsComponent->SetDirection({ forceX, forceY, forceZ });
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
}
|
||||
|
@@ -10,13 +10,13 @@ void NjIceRailActivator::OnPlayerRailArrived(Entity* self, Entity* sender, const
|
||||
if (breakPoint == waypoint) {
|
||||
const auto& blockGroup = self->GetVar<std::u16string>(BlockGroupVariable);
|
||||
|
||||
for (auto* block : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(blockGroup))) {
|
||||
for (auto* block : Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(blockGroup))) {
|
||||
RenderComponent::PlayAnimation(block, u"explode");
|
||||
|
||||
const auto blockID = block->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(1.0f, [self, blockID]() {
|
||||
auto* block = EntityManager::Instance()->GetEntity(blockID);
|
||||
auto* block = Game::entityManager->GetEntity(blockID);
|
||||
|
||||
if (block != nullptr) {
|
||||
block->Kill(self);
|
||||
|
@@ -42,7 +42,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
Entity* NjRailPostServer::GetRelatedRail(Entity* self) {
|
||||
const auto& railGroup = self->GetVar<std::u16string>(RailGroupVariable);
|
||||
if (!railGroup.empty()) {
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(railGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(railGroup))) {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) {
|
||||
// TODO: Reset other pets
|
||||
|
||||
// Handles smashing leftovers (edge case for the AG X)
|
||||
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
auto* xObject = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
if (xObject != nullptr) {
|
||||
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
if (playerID == LWOOBJID_EMPTY || playerID != owner->GetObjectID())
|
||||
return;
|
||||
|
||||
auto* playerEntity = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* playerEntity = Game::entityManager->GetEntity(playerID);
|
||||
if (!playerEntity || !playerEntity->GetParentUser() || !playerEntity->GetParentUser()->GetLastUsedChar())
|
||||
return;
|
||||
|
||||
@@ -134,7 +134,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
|
||||
player->SetPlayerFlag(playerFlag, true);
|
||||
}
|
||||
|
||||
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
auto* xObject = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"X"));
|
||||
if (xObject != nullptr) {
|
||||
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
|
||||
}
|
||||
@@ -211,8 +211,8 @@ void PetDigServer::SpawnPet(Entity* self, const Entity* owner, const DigInfo dig
|
||||
new LDFData<float>(u"spawnTimer", 1.0)
|
||||
};
|
||||
|
||||
auto* spawnedPet = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(spawnedPet);
|
||||
auto* spawnedPet = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(spawnedPet);
|
||||
}
|
||||
|
||||
Entity* PetDigServer::GetClosestTresure(NiPoint3 position) {
|
||||
@@ -220,7 +220,7 @@ Entity* PetDigServer::GetClosestTresure(NiPoint3 position) {
|
||||
Entity* closest = nullptr;
|
||||
|
||||
for (const auto tresureId : treasures) {
|
||||
auto* tresure = EntityManager::Instance()->GetEntity(tresureId);
|
||||
auto* tresure = Game::entityManager->GetEntity(tresureId);
|
||||
|
||||
if (tresure == nullptr) continue;
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include "eMissionState.h"
|
||||
|
||||
void PropertyDevice::OnStartup(Entity* self) {
|
||||
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* zoneControl = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControl != nullptr) {
|
||||
zoneControl->OnFireEventServerSide(self, "CheckForPropertyOwner");
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ void QbSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto gateObjID = self->GetVar<LWOOBJID>(u"gateObj");
|
||||
if (!gateObjID) return;
|
||||
|
||||
auto* gate = EntityManager::Instance()->GetEntity(gateObjID);
|
||||
auto* gate = Game::entityManager->GetEntity(gateObjID);
|
||||
if (!gate) return;
|
||||
|
||||
auto oPos = gate->GetPosition();
|
||||
@@ -75,12 +75,12 @@ void QbSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
new LDFData<int>(u"mobTableLoc", i)
|
||||
};
|
||||
|
||||
auto* child = EntityManager::Instance()->CreateEntity(info, nullptr, self);
|
||||
EntityManager::Instance()->ConstructEntity(child);
|
||||
auto* child = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(child);
|
||||
|
||||
OnChildLoaded(self, child);
|
||||
} else {
|
||||
auto* mob = EntityManager::Instance()->GetEntity(mobTable[i]);
|
||||
auto* mob = Game::entityManager->GetEntity(mobTable[i]);
|
||||
AggroTargetObject(self, mob);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ void QbSpawner::OnChildLoaded(Entity* self, Entity* child) {
|
||||
const auto selfID = self->GetObjectID();
|
||||
|
||||
child->AddDieCallback([this, selfID, child]() {
|
||||
auto* self = EntityManager::Instance()->GetEntity(selfID);
|
||||
auto* self = Game::entityManager->GetEntity(selfID);
|
||||
OnChildRemoved(self, child);
|
||||
}
|
||||
);
|
||||
@@ -120,7 +120,7 @@ void QbSpawner::AggroTargetObject(Entity* self, Entity* enemy) {
|
||||
|
||||
auto gateObjID = self->GetVar<LWOOBJID>(u"gateObj");
|
||||
if (gateObjID) {
|
||||
auto* gate = EntityManager::Instance()->GetEntity(gateObjID);
|
||||
auto* gate = Game::entityManager->GetEntity(gateObjID);
|
||||
if (gate) {
|
||||
auto* movementAIComponent = enemy->GetComponent<MovementAIComponent>();
|
||||
if (movementAIComponent) movementAIComponent->SetDestination(gate->GetPosition());
|
||||
|
@@ -33,7 +33,7 @@ void WishingWellServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto userID = user->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(10, [self, userID]() {
|
||||
auto* user = EntityManager::Instance()->GetEntity(userID);
|
||||
auto* user = Game::entityManager->GetEntity(userID);
|
||||
|
||||
if (user == nullptr) return;
|
||||
|
||||
|
@@ -40,8 +40,8 @@ void NsConcertChoiceBuildManager::SpawnCrate(Entity* self) {
|
||||
new LDFData<float>(u"crateTime", crate.time),
|
||||
};
|
||||
|
||||
auto* spawnedCrate = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(spawnedCrate);
|
||||
auto* spawnedCrate = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(spawnedCrate);
|
||||
|
||||
spawnedCrate->AddDieCallback([self]() {
|
||||
self->CancelAllTimers(); // Don't switch if the crate was smashed
|
||||
@@ -56,7 +56,7 @@ void NsConcertChoiceBuildManager::SpawnCrate(Entity* self) {
|
||||
self->AddCallbackTimer(crate.time, [self]() {
|
||||
auto crateID = self->GetVar<LWOOBJID>(u"currentCrate");
|
||||
if (crateID != LWOOBJID_EMPTY) {
|
||||
EntityManager::Instance()->DestroyEntity(crateID);
|
||||
Game::entityManager->DestroyEntity(crateID);
|
||||
self->SetVar<LWOOBJID>(u"currentCrate", LWOOBJID_EMPTY);
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ void NtAssemblyTubeServer::RunAssemblyTube(Entity* self, Entity* player) {
|
||||
const auto animTime = 3;
|
||||
|
||||
self->AddCallbackTimer(animTime, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ void NtAssemblyTubeServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
auto* destination = self;
|
||||
|
||||
if (!destinationGroup.empty()) {
|
||||
const auto& groupObjs = EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
const auto& groupObjs = Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
|
||||
if (!groupObjs.empty()) {
|
||||
destination = groupObjs[0];
|
||||
@@ -92,7 +92,7 @@ void NtAssemblyTubeServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
const auto playerID = player->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(animTime, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
void NtCombatChallengeDummy::OnDie(Entity* self, Entity* killer) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
|
||||
auto* challengeObject = EntityManager::Instance()->GetEntity(challengeObjectID);
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
@@ -16,7 +16,7 @@ void NtCombatChallengeDummy::OnDie(Entity* self, Entity* killer) {
|
||||
void NtCombatChallengeDummy::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
|
||||
auto* challengeObject = EntityManager::Instance()->GetEntity(challengeObjectID);
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
void NtCombatChallengeExplodingDummy::OnDie(Entity* self, Entity* killer) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
|
||||
auto* challengeObject = EntityManager::Instance()->GetEntity(challengeObjectID);
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
@@ -17,7 +17,7 @@ void NtCombatChallengeExplodingDummy::OnDie(Entity* self, Entity* killer) {
|
||||
void NtCombatChallengeExplodingDummy::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
|
||||
auto* challengeObject = EntityManager::Instance()->GetEntity(challengeObjectID);
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
|
@@ -19,7 +19,7 @@ void NtCombatChallengeServer::OnDie(Entity* self, Entity* killer) {
|
||||
void NtCombatChallengeServer::OnHitOrHealResult(Entity* self, Entity* attacker, int32_t damage) {
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"playerID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -69,7 +69,7 @@ void NtCombatChallengeServer::OnMessageBoxResponse(Entity* self, Entity* sender,
|
||||
void NtCombatChallengeServer::SpawnTargetDummy(Entity* self) {
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"playerID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -91,11 +91,11 @@ void NtCombatChallengeServer::SpawnTargetDummy(Entity* self) {
|
||||
info.rot = self->GetRotation();
|
||||
info.settings = { new LDFData<std::string>(u"custom_script_server", "scripts\\02_server\\Map\\NT\\L_NT_COMBAT_CHALLENGE_DUMMY.lua") };
|
||||
|
||||
auto* dummy = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* dummy = Game::entityManager->CreateEntity(info);
|
||||
|
||||
dummy->SetVar(u"challengeObjectID", self->GetObjectID());
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(dummy);
|
||||
Game::entityManager->ConstructEntity(dummy);
|
||||
|
||||
self->SetVar(u"currentDummy", dummy->GetObjectID());
|
||||
}
|
||||
@@ -111,7 +111,7 @@ void NtCombatChallengeServer::OnChildLoaded(Entity* self, Entity* child) {
|
||||
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"playerID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -121,7 +121,7 @@ void NtCombatChallengeServer::OnChildLoaded(Entity* self, Entity* child) {
|
||||
|
||||
self->SetVar(u"currentTargetID", child->GetObjectID());
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(child);
|
||||
Game::entityManager->SerializeEntity(child);
|
||||
|
||||
child->GetGroups().push_back("targets_" + std::to_string(self->GetObjectID()));
|
||||
}
|
||||
@@ -130,7 +130,7 @@ void NtCombatChallengeServer::ResetGame(Entity* self) {
|
||||
const auto totalDmg = self->GetVar<int32_t>(u"totalDmg");
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"playerID");
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player != nullptr) {
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
@@ -150,7 +150,7 @@ void NtCombatChallengeServer::ResetGame(Entity* self) {
|
||||
self->SetNetworkVar(u"totalDmg", false);
|
||||
self->SetNetworkVar(u"update_time", 0);
|
||||
|
||||
const auto& targetObjs = EntityManager::Instance()->GetEntitiesInGroup("targets_" + std::to_string(self->GetObjectID()));
|
||||
const auto& targetObjs = Game::entityManager->GetEntitiesInGroup("targets_" + std::to_string(self->GetObjectID()));
|
||||
|
||||
for (auto* target : targetObjs) {
|
||||
target->Smash(self->GetObjectID());
|
||||
@@ -158,7 +158,7 @@ void NtCombatChallengeServer::ResetGame(Entity* self) {
|
||||
|
||||
const auto currentID = self->GetVar<LWOOBJID>(u"currentDummy");
|
||||
|
||||
auto* current = EntityManager::Instance()->GetEntity(currentID);
|
||||
auto* current = Game::entityManager->GetEntity(currentID);
|
||||
|
||||
if (current != nullptr) {
|
||||
current->Smash(self->GetObjectID());
|
||||
|
@@ -40,7 +40,7 @@ void NtImagBeamBuffer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
|
||||
for (const auto entityID : m_EntitiesInProximity) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(entityID);
|
||||
auto* entity = Game::entityManager->GetEntity(entityID);
|
||||
|
||||
if (entity == nullptr) {
|
||||
continue;
|
||||
|
@@ -21,7 +21,7 @@ void NtOverbuildServer::SetVariables(Entity* self) {
|
||||
|
||||
// Find the second object Dr. Overbuild interacts with
|
||||
LWOOBJID otherConvoObjectID = LWOOBJID_EMPTY;
|
||||
for (auto* otherConvoObject : EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(m_OtherEntitiesGroupVariable)))) {
|
||||
for (auto* otherConvoObject : Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(m_OtherEntitiesGroupVariable)))) {
|
||||
otherConvoObjectID = otherConvoObject->GetObjectID();
|
||||
break;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
self->AddCallbackTimer(2, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -55,7 +55,7 @@ void NtParadoxPanelServer::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayFXEffect(self, 6432, u"create", "console_sparks", LWOOBJID_EMPTY, 1.0, 1.0, true);
|
||||
|
||||
self->AddCallbackTimer(2, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -33,7 +33,7 @@ void NtParadoxTeleServer::OnProximityUpdate(Entity* self, Entity* entering, std:
|
||||
if (animTime == 0.0f) animTime = 2.0f;
|
||||
|
||||
self->AddCallbackTimer(animTime, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -55,7 +55,7 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
auto* destination = self;
|
||||
|
||||
if (!destinationGroup.empty()) {
|
||||
const auto& groupObjs = EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
const auto& groupObjs = Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
|
||||
if (!groupObjs.empty()) {
|
||||
destination = groupObjs[0];
|
||||
@@ -81,7 +81,7 @@ void NtParadoxTeleServer::TeleportPlayer(Entity* self, Entity* player) {
|
||||
const auto playerID = player->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(animTime, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -25,7 +25,7 @@ void NtSentinelWalkwayServer::OnStartup(Entity* self) {
|
||||
phantomPhysicsComponent->SetDirection(forward);
|
||||
phantomPhysicsComponent->SetPhysicsEffectActive(true);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
self->SetProximityRadius(3, "speedboost");
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
|
||||
});
|
||||
|
||||
self->AddCallbackTimer(1.5f, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -57,7 +57,7 @@ void NtVentureCannonServer::OnUse(Entity* self, Entity* user) {
|
||||
void NtVentureCannonServer::EnterCannonEnded(Entity* self, Entity* player) {
|
||||
const auto playerID = player->GetObjectID();
|
||||
|
||||
const auto& cannonEffectGroup = EntityManager::Instance()->GetEntitiesInGroup("cannonEffect");
|
||||
const auto& cannonEffectGroup = Game::entityManager->GetEntitiesInGroup("cannonEffect");
|
||||
|
||||
if (!cannonEffectGroup.empty()) {
|
||||
auto* cannonEffect = cannonEffectGroup[0];
|
||||
@@ -83,7 +83,7 @@ void NtVentureCannonServer::EnterCannonEnded(Entity* self, Entity* player) {
|
||||
);
|
||||
|
||||
self->AddCallbackTimer(1.5f, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -112,7 +112,7 @@ void NtVentureCannonServer::FirePlayer(Entity* self, Entity* player) {
|
||||
auto* destination = self;
|
||||
|
||||
if (!destinationGroup.empty()) {
|
||||
const auto& groupObjs = EntityManager::Instance()->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
const auto& groupObjs = Game::entityManager->GetEntitiesInGroup(GeneralUtils::UTF16ToWTF8(destinationGroup));
|
||||
|
||||
if (!groupObjs.empty()) {
|
||||
destination = groupObjs[0];
|
||||
|
@@ -7,7 +7,7 @@ void HydrantBroken::OnStartup(Entity* self) {
|
||||
|
||||
const auto hydrant = "hydrant" + self->GetVar<std::string>(u"hydrant");
|
||||
|
||||
const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant);
|
||||
const auto bouncers = Game::entityManager->GetEntitiesInGroup(hydrant);
|
||||
|
||||
for (auto* bouncer : bouncers) {
|
||||
self->SetVar<LWOOBJID>(u"bouncer", bouncer->GetObjectID());
|
||||
@@ -22,7 +22,7 @@ void HydrantBroken::OnStartup(Entity* self) {
|
||||
|
||||
void HydrantBroken::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "KillBroken") {
|
||||
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"bouncer"));
|
||||
auto* bouncer = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"bouncer"));
|
||||
|
||||
if (bouncer != nullptr) {
|
||||
GameMessages::SendBouncerActiveStatus(bouncer->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
@@ -19,7 +19,7 @@ void EnemySpiderSpawner::OnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
if (dest) {
|
||||
dest->SetFaction(-1);
|
||||
}
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
|
||||
// Keep track of who prepped me
|
||||
self->SetI64(u"SpawnOwner", sender->GetObjectID());
|
||||
@@ -48,9 +48,9 @@ void EnemySpiderSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
info.spawnerID = self->GetI64(u"SpawnOwner");
|
||||
info.spawnerNodeID = 0;
|
||||
|
||||
Entity* newEntity = EntityManager::Instance()->CreateEntity(info, nullptr);
|
||||
Entity* newEntity = Game::entityManager->CreateEntity(info, nullptr);
|
||||
if (newEntity) {
|
||||
EntityManager::Instance()->ConstructEntity(newEntity);
|
||||
Game::entityManager->ConstructEntity(newEntity);
|
||||
newEntity->GetGroups().push_back("BabySpider");
|
||||
|
||||
/*
|
||||
|
@@ -128,13 +128,13 @@ void ZoneAgProperty::KillSpots(Entity* self) {
|
||||
}
|
||||
|
||||
for (const auto& groupName : self->GetVar<std::vector<std::string>>(ROFTargetsGroup)) {
|
||||
for (auto* spot : EntityManager::Instance()->GetEntitiesInGroup(groupName)) {
|
||||
for (auto* spot : Game::entityManager->GetEntitiesInGroup(groupName)) {
|
||||
spot->Kill();
|
||||
}
|
||||
}
|
||||
|
||||
DeactivateSpawner(self->GetVar<std::string>(LandTargetSpawner));
|
||||
for (auto* landTarget : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(LandTargetSpawner))) {
|
||||
for (auto* landTarget : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(LandTargetSpawner))) {
|
||||
landTarget->Kill();
|
||||
}
|
||||
}
|
||||
@@ -197,20 +197,20 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
if (zoneId != 1150)
|
||||
return;
|
||||
|
||||
const auto entities = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
if (entities.empty())
|
||||
return;
|
||||
|
||||
auto* entity = entities[0];
|
||||
|
||||
GameMessages::SendNotifyClientObject(EntityManager::Instance()->GetZoneControlEntity()->GetObjectID(), u"GuardChat", 0, 0, entity->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(), u"GuardChat", 0, 0, entity->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
LoadProperty(self);
|
||||
|
||||
self->AddTimer("KillGuard", 5);
|
||||
} else if (timerName == "KillGuard") {
|
||||
KillGuard(self);
|
||||
} else if (timerName == "tornadoOff") {
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
auto* renderComponent = entity->GetComponent<RenderComponent>();
|
||||
if (renderComponent != nullptr) {
|
||||
renderComponent->StopEffect("TornadoDebris", false);
|
||||
@@ -222,7 +222,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
self->AddTimer("ShowVendor", 1.2f);
|
||||
self->AddTimer("ShowClearEffects", 2);
|
||||
} else if (timerName == "ShowClearEffects") {
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
auto* renderComponent = entity->GetComponent<RenderComponent>();
|
||||
if (renderComponent != nullptr) {
|
||||
renderComponent->PlayEffect(-1, u"beamOn", "beam");
|
||||
@@ -236,7 +236,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"SkyOff", 0, 0, LWOOBJID_EMPTY,
|
||||
"", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == "killSpider") {
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup))) {
|
||||
entity->Kill();
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
DeactivateSpawner(self->GetVar<std::string>(SpiderScreamSpawner));
|
||||
DestroySpawner(self->GetVar<std::string>(SpiderScreamSpawner));
|
||||
|
||||
for (auto* player : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::CHARACTER)) {
|
||||
for (auto* player : Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::CHARACTER)) {
|
||||
GameMessages::SendStop2DAmbientSound(player, true, GUIDMaelstrom);
|
||||
GameMessages::SendPlay2DAmbientSound(player, GUIDPeaceful);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
|
||||
} else if (timerName == "pollTornadoFX") {
|
||||
StartTornadoFx(self);
|
||||
} else if (timerName == "killFXObject") {
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup))) {
|
||||
auto* renderComponent = entity->GetComponent<RenderComponent>();
|
||||
if (renderComponent != nullptr) {
|
||||
renderComponent->StopEffect("beam");
|
||||
@@ -385,7 +385,7 @@ void ZoneAgProperty::RemovePlayerRef(Entity* self) {
|
||||
void ZoneAgProperty::BaseOnFireEventServerSide(Entity* self, Entity* sender, std::string args) {
|
||||
if (args == "propertyRented") {
|
||||
const auto playerId = self->GetVar<LWOOBJID>(u"playerID");
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||
auto* player = Game::entityManager->GetEntity(playerId);
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
@@ -409,7 +409,7 @@ void ZoneAgProperty::BaseOnFireEventServerSide(Entity* self, Entity* sender, std
|
||||
sender->SetNetworkVar<std::string>(u"PropertyOwnerID", std::to_string(self->GetVar<LWOOBJID>(u"PropertyOwner")));
|
||||
} else if (args == "ClearProperty") {
|
||||
const auto playerId = self->GetVar<LWOOBJID>(u"playerID");
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerId);
|
||||
auto* player = Game::entityManager->GetEntity(playerId);
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
|
@@ -5,14 +5,14 @@
|
||||
#include "Entity.h"
|
||||
|
||||
void PropertyBankInteract::OnStartup(Entity* self) {
|
||||
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* zoneControl = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControl != nullptr) {
|
||||
zoneControl->OnFireEventServerSide(self, "CheckForPropertyOwner");
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyBankInteract::OnPlayerLoaded(Entity* self, Entity* player) {
|
||||
auto* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
auto* zoneControl = Game::entityManager->GetZoneControlEntity();
|
||||
if (zoneControl != nullptr) {
|
||||
zoneControl->OnFireEventServerSide(self, "CheckForPropertyOwner");
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ void VeBricksampleServer::OnUse(Entity* self, Entity* user) {
|
||||
if (loot && inventoryComponent != nullptr && inventoryComponent->GetLotCount(loot) == 0) {
|
||||
inventoryComponent->AddItem(loot, 1, eLootSourceType::ACTIVITY);
|
||||
|
||||
for (auto* brickEntity : EntityManager::Instance()->GetEntitiesInGroup("Bricks")) {
|
||||
for (auto* brickEntity : Game::entityManager->GetEntitiesInGroup("Bricks")) {
|
||||
GameMessages::SendNotifyClientObject(brickEntity->GetObjectID(), u"Pickedup");
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ void VeEpsilonServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
||||
|
||||
// Notify the client that all objects have updated
|
||||
self->AddCallbackTimer(3.0f, [this]() {
|
||||
for (const auto* console : EntityManager::Instance()->GetEntitiesInGroup(m_ConsoleGroup)) {
|
||||
for (const auto* console : Game::entityManager->GetEntitiesInGroup(m_ConsoleGroup)) {
|
||||
GameMessages::SendNotifyClientObject(console->GetObjectID(), u"");
|
||||
}
|
||||
});
|
||||
|
@@ -19,7 +19,7 @@ void CatapultBaseServer::OnNotifyObject(Entity* self, Entity* sender, const std:
|
||||
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"));
|
||||
const auto arm = Game::entityManager->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) {
|
||||
@@ -34,7 +34,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->AddTimer("bounce", 3);
|
||||
} else if (timerName == "launchAnim") {
|
||||
// get the arm asset
|
||||
auto* arm = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
|
||||
auto* arm = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
|
||||
if (arm == nullptr) return;
|
||||
|
||||
// tell the arm to player the launcher animation
|
||||
@@ -42,7 +42,7 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->AddTimer("resetArm", animTime);
|
||||
RenderComponent::PlayAnimation(arm, u"launch");
|
||||
} else if (timerName == "bounce") {
|
||||
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
|
||||
auto* bouncer = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
|
||||
if (bouncer == nullptr) return;
|
||||
|
||||
// bounce all players
|
||||
@@ -50,13 +50,13 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
// add a delay to play the animation
|
||||
self->AddTimer("launchAnim", .3);
|
||||
} else if (timerName == "resetArm") {
|
||||
auto* arm = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
|
||||
auto* arm = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Arm"));
|
||||
if (arm == nullptr) return;
|
||||
|
||||
// set the arm back to natural state
|
||||
RenderComponent::PlayAnimation(arm, u"idle");
|
||||
|
||||
auto* bouncer = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
|
||||
auto* bouncer = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Bouncer"));
|
||||
if (bouncer == nullptr) return;
|
||||
|
||||
// kill the bouncer
|
||||
|
@@ -7,7 +7,7 @@ void CatapultBouncerServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
self->SetNetworkVar<bool>(u"Built", true);
|
||||
|
||||
const auto base = EntityManager::Instance()->GetEntitiesInGroup(self->GetVarAsString(u"BaseGroup"));
|
||||
const auto base = Game::entityManager->GetEntitiesInGroup(self->GetVarAsString(u"BaseGroup"));
|
||||
|
||||
for (auto* obj : base) {
|
||||
obj->NotifyObject(self, "BouncerBuilt");
|
||||
|
@@ -36,13 +36,13 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
// Spawn the villager inside the jail
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
// Save the villeger ID
|
||||
self->SetVar<LWOOBJID>(u"villager", entity->GetObjectID());
|
||||
|
||||
// Construct the entity
|
||||
EntityManager::Instance()->ConstructEntity(entity);
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
}
|
||||
|
||||
void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
@@ -77,7 +77,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
|
||||
rebuildComponent->AddRebuildCompleteCallback([this, self](Entity* user) {
|
||||
// The counterweight is a simple mover, which is not implemented, so we'll just set it's position
|
||||
auto* counterweight = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||
auto* counterweight = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||
|
||||
if (counterweight == nullptr) {
|
||||
return;
|
||||
@@ -87,7 +87,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
counterweight->SetPosition(counterweight->GetPosition() + NiPoint3(0, -2, 0));
|
||||
|
||||
// Serialize the counterweight
|
||||
EntityManager::Instance()->SerializeEntity(counterweight);
|
||||
Game::entityManager->SerializeEntity(counterweight);
|
||||
|
||||
// notifyPlatformAtLastWaypoint
|
||||
|
||||
@@ -95,7 +95,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
self->SetVar<LWOOBJID>(u"Builder", user->GetObjectID());
|
||||
|
||||
// Get the button and make sure it still exists
|
||||
auto* button = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Button"));
|
||||
auto* button = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Button"));
|
||||
|
||||
if (button == nullptr) {
|
||||
return;
|
||||
@@ -117,7 +117,7 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
||||
}
|
||||
|
||||
void CavePrisonCage::GetButton(Entity* self) {
|
||||
const auto buttons = EntityManager::Instance()->GetEntitiesInGroup("PrisonButton_0" + std::to_string(self->GetVarAs<int32_t>(u"myNumber")));
|
||||
const auto buttons = Game::entityManager->GetEntitiesInGroup("PrisonButton_0" + std::to_string(self->GetVarAs<int32_t>(u"myNumber")));
|
||||
|
||||
if (buttons.size() == 0) {
|
||||
// Try again in 0.5 seconds
|
||||
@@ -146,7 +146,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
RenderComponent::PlayAnimation(self, u"idle-up");
|
||||
|
||||
// Get the villeger
|
||||
auto* villager = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"villager"));
|
||||
auto* villager = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"villager"));
|
||||
|
||||
if (villager == nullptr) {
|
||||
return;
|
||||
@@ -155,7 +155,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
GameMessages::SendNotifyClientObject(villager->GetObjectID(), u"TimeToChat", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
// Get the builder and make sure it still exists
|
||||
auto* builder = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Builder"));
|
||||
auto* builder = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Builder"));
|
||||
|
||||
if (builder == nullptr) {
|
||||
return;
|
||||
@@ -170,7 +170,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->AddTimer("VillagerEscape", 5.0f);
|
||||
} else if (timerName == "VillagerEscape") {
|
||||
// Get the villeger and make sure it still exists
|
||||
auto* villager = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"villager"));
|
||||
auto* villager = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"villager"));
|
||||
|
||||
if (villager == nullptr) {
|
||||
return;
|
||||
@@ -183,7 +183,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
self->AddTimer("SmashCounterweight", 2.0f);
|
||||
} else if (timerName == "SmashCounterweight") {
|
||||
// Get the counterweight and make sure it still exists
|
||||
auto* counterweight = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||
auto* counterweight = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||
|
||||
if (counterweight == nullptr) {
|
||||
return;
|
||||
@@ -193,7 +193,7 @@ void CavePrisonCage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
counterweight->Smash();
|
||||
|
||||
// Get the button and make sure it still exists
|
||||
auto* button = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Button"));
|
||||
auto* button = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Button"));
|
||||
|
||||
if (button == nullptr) {
|
||||
return;
|
||||
|
@@ -28,13 +28,13 @@ void EnemySkeletonSpawner::OnTimerDone(Entity* self, std::string timerName) {
|
||||
info.rot = self->GetRotation();
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* spawnedEntity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* spawnedEntity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
if (spawnedEntity == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(spawnedEntity);
|
||||
Game::entityManager->ConstructEntity(spawnedEntity);
|
||||
|
||||
spawnedEntity->AddCallbackTimer(60, [spawnedEntity]() {
|
||||
spawnedEntity->Smash(spawnedEntity->GetObjectID());
|
||||
|
@@ -9,7 +9,7 @@ void MonCoreSmashableDoors::OnDie(Entity* self, Entity* killer) {
|
||||
auto triggerGroup = "CoreNookTrig0" + myNum;
|
||||
|
||||
// Get the trigger
|
||||
auto triggers = EntityManager::Instance()->GetEntitiesInGroup(triggerGroup);
|
||||
auto triggers = Game::entityManager->GetEntitiesInGroup(triggerGroup);
|
||||
|
||||
if (triggers.empty()) {
|
||||
return;
|
||||
|
@@ -12,7 +12,7 @@ void NjNPCMissionSpinjitzuServer::OnMissionDialogueOK(Entity* self, Entity* targ
|
||||
|
||||
// Wait for an animation to complete and flag that the player has learned spinjitzu
|
||||
self->AddCallbackTimer(5.0f, [targetID, element]() {
|
||||
auto* target = EntityManager::Instance()->GetEntity(targetID);
|
||||
auto* target = Game::entityManager->GetEntity(targetID);
|
||||
if (target != nullptr) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
|
@@ -28,7 +28,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
|
||||
|
||||
// Hide the chest
|
||||
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
for (auto* chest : Game::entityManager->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
GameMessages::SendNotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 0, -1,
|
||||
target->GetObjectID(), "", target->GetSystemAddress());
|
||||
}
|
||||
@@ -41,19 +41,19 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
|
||||
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, true);
|
||||
|
||||
// Show the chest
|
||||
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
for (auto* chest : Game::entityManager->GetEntitiesInGroup(m_DragonChestGroup)) {
|
||||
GameMessages::SendNotifyClientObject(chest->GetObjectID(), m_ShowChestNotification, 1, -1,
|
||||
target->GetObjectID(), "", target->GetSystemAddress());
|
||||
}
|
||||
|
||||
auto playerID = target->GetObjectID();
|
||||
self->AddCallbackTimer(5.0f, [this, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
// Stop the dragon effects
|
||||
for (auto* dragon : EntityManager::Instance()->GetEntitiesInGroup(m_DragonStatueGroup)) {
|
||||
for (auto* dragon : Game::entityManager->GetEntitiesInGroup(m_DragonStatueGroup)) {
|
||||
GameMessages::SendStopFXEffect(dragon, true, "on");
|
||||
}
|
||||
});
|
||||
|
@@ -18,9 +18,9 @@ void RainOfArrows::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
info.rot = myRot;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(entity);
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
|
||||
self->SetVar<LWOOBJID>(u"ChildFX", entity->GetObjectID());
|
||||
self->SetVar<LWOOBJID>(u"playerID", target->GetObjectID());
|
||||
@@ -30,11 +30,11 @@ void RainOfArrows::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void RainOfArrows::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto* child = EntityManager::Instance()->GetEntity(
|
||||
auto* child = Game::entityManager->GetEntity(
|
||||
self->GetVar<LWOOBJID>(u"ChildFX")
|
||||
);
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(
|
||||
auto* player = Game::entityManager->GetEntity(
|
||||
self->GetVar<LWOOBJID>(u"playerID")
|
||||
);
|
||||
|
||||
|
@@ -122,7 +122,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
if (timerName == WaitingForPlayersTimer) {
|
||||
StartFight(self);
|
||||
} else if (timerName == SpawnNextWaveTimer) {
|
||||
auto* frakjaw = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
auto* frakjaw = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
if (frakjaw != nullptr) {
|
||||
SummonWave(self, frakjaw);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
}
|
||||
}
|
||||
} else if (timerName + TimerSplitChar == UnstunTimer) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(objectID);
|
||||
auto* entity = Game::entityManager->GetEntity(objectID);
|
||||
if (entity != nullptr) {
|
||||
auto* combatAI = entity->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
@@ -164,7 +164,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
}
|
||||
} else if (timerName == LowerFrakjawCamTimer) {
|
||||
// Destroy the frakjaw on the ledge
|
||||
auto* ledgeFrakjaw = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
auto* ledgeFrakjaw = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
if (ledgeFrakjaw != nullptr) {
|
||||
ledgeFrakjaw->Kill();
|
||||
}
|
||||
@@ -188,7 +188,7 @@ void NjMonastryBossInstance::OnActivityTimerDone(Entity* self, const std::string
|
||||
spawner->Activate();
|
||||
}
|
||||
} else if (timerName + TimerSplitChar == FrakjawSpawnInTimer) {
|
||||
auto* lowerFrakjaw = EntityManager::Instance()->GetEntity(objectID);
|
||||
auto* lowerFrakjaw = Game::entityManager->GetEntity(objectID);
|
||||
if (lowerFrakjaw != nullptr) {
|
||||
LowerFrakjawSummon(self, lowerFrakjaw);
|
||||
}
|
||||
@@ -250,7 +250,7 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
|
||||
counterWeight->Kill();
|
||||
}
|
||||
|
||||
auto* frakjaw = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
auto* frakjaw = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(LedgeFrakjawVariable));
|
||||
if (frakjaw == nullptr) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"LedgeFrakjawDead", 0,
|
||||
0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
@@ -342,7 +342,7 @@ void NjMonastryBossInstance::HandleLowerFrakjawHit(Entity* self, Entity* lowerFr
|
||||
std::vector<LWOOBJID> newTrashMobs = {};
|
||||
|
||||
for (const auto& trashMobID : trashMobsAlive) {
|
||||
auto* trashMob = EntityManager::Instance()->GetEntity(trashMobID);
|
||||
auto* trashMob = Game::entityManager->GetEntity(trashMobID);
|
||||
if (trashMob != nullptr) {
|
||||
newTrashMobs.push_back(trashMobID);
|
||||
|
||||
@@ -393,7 +393,7 @@ void NjMonastryBossInstance::HandleWaveEnemyDied(Entity* self, Entity* waveEnemy
|
||||
}
|
||||
|
||||
void NjMonastryBossInstance::TeleportPlayer(Entity* player, uint32_t position) {
|
||||
for (const auto* spawnPoint : EntityManager::Instance()->GetEntitiesInGroup("SpawnPoint" + std::to_string(position))) {
|
||||
for (const auto* spawnPoint : Game::entityManager->GetEntitiesInGroup("SpawnPoint" + std::to_string(position))) {
|
||||
GameMessages::SendTeleport(player->GetObjectID(), spawnPoint->GetPosition(), spawnPoint->GetRotation(),
|
||||
player->GetSystemAddress(), true);
|
||||
}
|
||||
@@ -433,7 +433,7 @@ void NjMonastryBossInstance::RemovePoison(Entity* self) {
|
||||
const auto& totalPlayer = self->GetVar<std::vector<LWOOBJID>>(TotalPlayersLoadedVariable);
|
||||
for (const auto& playerID : totalPlayer) {
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
|
||||
auto* buffComponent = player->GetComponent<BuffComponent>();
|
||||
@@ -505,7 +505,7 @@ void NjMonastryBossInstance::FightOver(Entity* self) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification, 0, 0,
|
||||
LWOOBJID_EMPTY, TreasureChestSpawning, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto treasureChests = EntityManager::Instance()->GetEntitiesInGroup(ChestSpawnpointGroup);
|
||||
auto treasureChests = Game::entityManager->GetEntitiesInGroup(ChestSpawnpointGroup);
|
||||
for (auto* treasureChest : treasureChests) {
|
||||
auto info = EntityInfo{};
|
||||
|
||||
@@ -518,7 +518,7 @@ void NjMonastryBossInstance::FightOver(Entity* self) {
|
||||
};
|
||||
|
||||
// Finally spawn a treasure chest at the correct spawn point
|
||||
auto* chestObject = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(chestObject);
|
||||
auto* chestObject = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(chestObject);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ void MinigameTreasureChestServer::OnUse(Entity* self, Entity* user) {
|
||||
uint32_t activityRating = 0;
|
||||
if (team != nullptr) {
|
||||
for (const auto& teamMemberID : team->members) {
|
||||
auto* teamMember = EntityManager::Instance()->GetEntity(teamMemberID);
|
||||
auto* teamMember = Game::entityManager->GetEntity(teamMemberID);
|
||||
if (teamMember != nullptr) {
|
||||
activityRating = CalculateActivityRating(self, teamMemberID);
|
||||
|
||||
|
@@ -53,7 +53,7 @@ void AgSurvivalBuffStation::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
auto team = self->GetVar<std::vector<LWOOBJID>>(u"BuilderTeam");
|
||||
for (auto memberID : team) {
|
||||
auto member = EntityManager::Instance()->GetEntity(memberID);
|
||||
auto member = Game::entityManager->GetEntity(memberID);
|
||||
if (member != nullptr && !member->GetIsDead()) {
|
||||
GameMessages::SendDropClientLoot(member, self->GetObjectID(), powerupToDrop, 0, self->GetPosition());
|
||||
} else {
|
||||
|
@@ -25,8 +25,8 @@ void StinkyFishTarget::OnSkillEventFired(Entity* self, Entity* caster, const std
|
||||
new LDFData<bool>(u"no_timed_spawn", true)
|
||||
};
|
||||
|
||||
auto* fish = EntityManager::Instance()->CreateEntity(entityInfo);
|
||||
EntityManager::Instance()->ConstructEntity(fish);
|
||||
auto* fish = Game::entityManager->CreateEntity(entityInfo);
|
||||
Game::entityManager->ConstructEntity(fish);
|
||||
|
||||
self->SetVar<LWOOBJID>(u"fish", fish->GetObjectID());
|
||||
self->AddTimer("smash", 5.0f);
|
||||
@@ -35,7 +35,7 @@ void StinkyFishTarget::OnSkillEventFired(Entity* self, Entity* caster, const std
|
||||
void StinkyFishTarget::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "smash") {
|
||||
const auto playerID = self->GetVar<LWOOBJID>(u"player");
|
||||
auto* fish = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"fish"));
|
||||
auto* fish = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"fish"));
|
||||
|
||||
if (fish) {
|
||||
fish->Smash(playerID);
|
||||
|
@@ -20,7 +20,7 @@ void ActivityManager::UpdatePlayer(Entity* self, LWOOBJID playerID, const bool r
|
||||
if (remove) {
|
||||
sac->PlayerRemove(playerID);
|
||||
} else {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
sac->PlayerJoin(player);
|
||||
SetActivityScore(self, playerID, 0);
|
||||
@@ -63,7 +63,7 @@ void ActivityManager::StopActivity(Entity* self, const LWOOBJID playerID, const
|
||||
if (quit) {
|
||||
UpdatePlayer(self, playerID, true);
|
||||
} else {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
@@ -96,7 +96,7 @@ bool ActivityManager::TakeActivityCost(const Entity* self, const LWOOBJID player
|
||||
if (sac == nullptr)
|
||||
return false;
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
return false;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ void BaseConsoleTeleportServer::BaseOnMessageBoxResponse(Entity* self, Entity* s
|
||||
const auto playerID = player->GetObjectID();
|
||||
|
||||
self->AddCallbackTimer(animTime, [playerID, self]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
|
@@ -49,7 +49,7 @@ void BasePropertyServer::SetGameVariables(Entity* self) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::CheckForOwner(Entity* self) {
|
||||
if (EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(PropertyPlaqueGroup)).empty()) {
|
||||
if (Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(PropertyPlaqueGroup)).empty()) {
|
||||
self->AddTimer(RunPlayerLoadedAgainTimer, 0.5f);
|
||||
return;
|
||||
}
|
||||
@@ -87,9 +87,9 @@ void BasePropertyServer::BasePlayerLoaded(Entity* self, Entity* player) {
|
||||
self->SetNetworkVar(PropertyOwnerIDVariable, propertyOwner);
|
||||
|
||||
if (rented) {
|
||||
auto plaques = EntityManager::Instance()->GetEntitiesInGroup("PropertyVendor");
|
||||
auto plaques = Game::entityManager->GetEntitiesInGroup("PropertyVendor");
|
||||
for (auto* plaque : plaques) {
|
||||
EntityManager::Instance()->DestructEntity(plaque);
|
||||
Game::entityManager->DestructEntity(plaque);
|
||||
}
|
||||
|
||||
const auto& mapID = dZoneManager::Instance()->GetZone()->GetZoneID();
|
||||
@@ -164,9 +164,9 @@ void BasePropertyServer::BaseZonePropertyRented(Entity* self, Entity* player) co
|
||||
self->AddTimer(BoundsVisOnTimer, 2);
|
||||
self->SetVar<LWOOBJID>(PropertyOwnerVariable, player->GetObjectID());
|
||||
|
||||
auto plaques = EntityManager::Instance()->GetEntitiesInGroup("PropertyVendor");
|
||||
auto plaques = Game::entityManager->GetEntitiesInGroup("PropertyVendor");
|
||||
for (auto* plaque : plaques) {
|
||||
EntityManager::Instance()->DestructEntity(plaque);
|
||||
Game::entityManager->DestructEntity(plaque);
|
||||
}
|
||||
|
||||
auto brickLinkMissionID = self->GetVar<uint32_t>(brickLinkMissionIDFlag);
|
||||
@@ -234,7 +234,7 @@ void BasePropertyServer::StartMaelstrom(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::StartTornadoFx(Entity* self) const {
|
||||
const auto entities = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
if (entities.empty()) {
|
||||
self->AddTimer("pollTornadoFX", 0.1f);
|
||||
return;
|
||||
@@ -259,7 +259,7 @@ void BasePropertyServer::BasePlayerExit(Entity* self, Entity* player) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::KillGuard(Entity* self) {
|
||||
const auto entities = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
if (entities.empty())
|
||||
return;
|
||||
|
||||
@@ -328,12 +328,12 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
if (dZoneManager::Instance()->GetZoneID().GetMapID() == 1150)
|
||||
return;
|
||||
|
||||
const auto entities = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
const auto entities = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GuardGroup));
|
||||
if (entities.empty())
|
||||
return;
|
||||
|
||||
auto* guard = entities[0];
|
||||
GameMessages::SendNotifyClientObject(EntityManager::Instance()->GetZoneControlEntity()->GetObjectID(),
|
||||
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
|
||||
u"GuardChat", 0, 0, guard->GetObjectID(),
|
||||
"", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
@@ -341,7 +341,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
} else if (timerName == KillGuardTimer) {
|
||||
KillGuard(self);
|
||||
} else if (timerName == TornadoOffTimer) {
|
||||
auto fxManagers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
auto fxManagers = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
|
||||
for (auto* fxManager : fxManagers) {
|
||||
auto* renderComponent = fxManager->GetComponent<RenderComponent>();
|
||||
@@ -354,7 +354,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
|
||||
self->AddTimer(ShowClearEffectsTimer, 2);
|
||||
} else if (timerName == ShowClearEffectsTimer) {
|
||||
auto fxManagers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
auto fxManagers = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
|
||||
for (auto* fxManager : fxManagers) {
|
||||
auto* renderComponent = fxManager->GetComponent<RenderComponent>();
|
||||
@@ -370,7 +370,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
GameMessages::SendNotifyClientObject(controller->GetObjectID(), u"SkyOff", 0, 0,
|
||||
LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (timerName == KillStrombiesTimer) {
|
||||
const auto enemies = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup));
|
||||
const auto enemies = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(EnemiesGroup));
|
||||
for (auto* enemy : enemies) {
|
||||
RequestDie(self, enemy);
|
||||
}
|
||||
@@ -378,7 +378,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
DestroySpawner(self->GetVar<std::string>(SmashablesSpawner));
|
||||
KillSpots(self);
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
@@ -393,7 +393,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
DestroySpawner(behaviorObjectSpawner);
|
||||
}
|
||||
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(ImagOrbGroup))) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(ImagOrbGroup))) {
|
||||
entity->Smash();
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
|
||||
self->AddTimer(ShowVendorTimer, 1.0f);
|
||||
} else if (timerName == ShowVendorTimer) {
|
||||
GameMessages::SendNotifyClientObject(EntityManager::Instance()->GetZoneControlEntity()->GetObjectID(),
|
||||
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
|
||||
u"vendorOn", 0, 0, LWOOBJID_EMPTY, "",
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
@@ -416,7 +416,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
} else if (timerName == PollTornadoFXTimer) {
|
||||
StartTornadoFx(self);
|
||||
} else if (timerName == KillFXObjectTimer) {
|
||||
const auto fxManagers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
const auto fxManagers = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(FXManagerGroup));
|
||||
if (fxManagers.empty()) {
|
||||
self->AddTimer(KillFXObjectTimer, 1.0f);
|
||||
return;
|
||||
@@ -436,7 +436,7 @@ void BasePropertyServer::BaseTimerDone(Entity* self, const std::string& timerNam
|
||||
|
||||
void BasePropertyServer::HandleOrbsTimer(Entity* self) {
|
||||
self->SetVar<bool>(CollidedVariable, false);
|
||||
auto orbs = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(ImagOrbGroup));
|
||||
auto orbs = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(ImagOrbGroup));
|
||||
if (orbs.empty()) {
|
||||
self->AddTimer(StartOrbTimer, 0.5f);
|
||||
return;
|
||||
@@ -455,12 +455,12 @@ void BasePropertyServer::HandleOrbsTimer(Entity* self) {
|
||||
}
|
||||
|
||||
DestroySpawner(self->GetVar<std::string>(GeneratorFXSpawner));
|
||||
GameMessages::SendNotifyClientObject(EntityManager::Instance()->GetZoneControlEntity()->GetObjectID(),
|
||||
GameMessages::SendNotifyClientObject(Game::entityManager->GetZoneControlEntity()->GetObjectID(),
|
||||
u"PlayCinematic", 0, 0, LWOOBJID_EMPTY,
|
||||
"DestroyMaelstrom", UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
// Notifies the client that the property has been claimed with a flag, completes missions too
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
auto* character = player->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
@@ -476,7 +476,7 @@ void BasePropertyServer::HandleOrbsTimer(Entity* self) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::HandleGeneratorTimer(Entity* self) {
|
||||
auto generators = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(GeneratorGroup));
|
||||
auto generators = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(GeneratorGroup));
|
||||
if (generators.empty()) {
|
||||
self->AddTimer(StartGeneratorTimer, 0.5f);
|
||||
return;
|
||||
@@ -496,7 +496,7 @@ void BasePropertyServer::HandleGeneratorTimer(Entity* self) {
|
||||
}
|
||||
|
||||
void BasePropertyServer::HandleQuickBuildTimer(Entity* self) {
|
||||
auto claimMarkers = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(ClaimMarkerGroup));
|
||||
auto claimMarkers = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(ClaimMarkerGroup));
|
||||
if (claimMarkers.empty()) {
|
||||
self->AddTimer(StartQuickbuildTimer, 0.5f);
|
||||
return;
|
||||
|
@@ -212,7 +212,7 @@ void BaseSurvivalServer::OnActivityTimerDone(Entity* self, const std::string& na
|
||||
ActivityTimerStart(self, PlaySpawnSoundTimer, 3, 3);
|
||||
} else if (name == PlaySpawnSoundTimer) {
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), spawnSoundGUID);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ void BaseSurvivalServer::OnActivityTimerDone(Entity* self, const std::string& na
|
||||
}
|
||||
|
||||
void BaseSurvivalServer::ResetStats(LWOOBJID playerID) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
|
||||
// Boost all the player stats when loading in
|
||||
@@ -284,7 +284,7 @@ void BaseSurvivalServer::StartWaves(Entity* self) {
|
||||
state.waitingPlayers.clear();
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
const auto player = EntityManager::Instance()->GetEntity(playerID);
|
||||
const auto player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
state.waitingPlayers.push_back(playerID);
|
||||
UpdatePlayer(self, playerID);
|
||||
@@ -311,7 +311,7 @@ bool BaseSurvivalServer::CheckAllPlayersDead() {
|
||||
auto deadPlayers = 0;
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr || player->GetIsDead()) {
|
||||
deadPlayers++;
|
||||
}
|
||||
@@ -323,9 +323,9 @@ bool BaseSurvivalServer::CheckAllPlayersDead() {
|
||||
void BaseSurvivalServer::SetPlayerSpawnPoints() {
|
||||
auto spawnerIndex = 1;
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
auto possibleSpawners = EntityManager::Instance()->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
if (!possibleSpawners.empty()) {
|
||||
auto* spawner = possibleSpawners.at(0);
|
||||
GameMessages::SendTeleport(playerID, spawner->GetPosition(), spawner->GetRotation(), player->GetSystemAddress(), true);
|
||||
@@ -348,7 +348,7 @@ void BaseSurvivalServer::GameOver(Entity* self) {
|
||||
SpawnerReset(spawnerNetworks.rewardNetworks);
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
continue;
|
||||
|
||||
|
@@ -195,7 +195,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
ActivityTimerStart(self, PlaySpawnSoundTimer, 3, 3);
|
||||
} else if (name == PlaySpawnSoundTimer) {
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), spawnSoundGUID);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
} else if (name == GameOverWinTimer) {
|
||||
GameOver(self, true);
|
||||
} else if (name == CinematicDoneTimer) {
|
||||
for (auto* boss : EntityManager::Instance()->GetEntitiesInGroup("boss")) {
|
||||
for (auto* boss : Game::entityManager->GetEntitiesInGroup("boss")) {
|
||||
boss->OnFireEventServerSide(self, "startAI");
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
|
||||
// Done
|
||||
void BaseWavesServer::ResetStats(LWOOBJID playerID) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
|
||||
// Boost all the player stats when loading in
|
||||
@@ -284,7 +284,7 @@ void BaseWavesServer::StartWaves(Entity* self) {
|
||||
state.waitingPlayers.clear();
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
const auto player = EntityManager::Instance()->GetEntity(playerID);
|
||||
const auto player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
state.waitingPlayers.push_back(playerID);
|
||||
|
||||
@@ -309,7 +309,7 @@ bool BaseWavesServer::CheckAllPlayersDead() {
|
||||
auto deadPlayers = 0;
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr || player->GetIsDead()) {
|
||||
deadPlayers++;
|
||||
}
|
||||
@@ -322,9 +322,9 @@ bool BaseWavesServer::CheckAllPlayersDead() {
|
||||
void BaseWavesServer::SetPlayerSpawnPoints(const LWOOBJID& specificPlayerID) {
|
||||
auto spawnerIndex = 1;
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr && (specificPlayerID == LWOOBJID_EMPTY || playerID == specificPlayerID)) {
|
||||
auto possibleSpawners = EntityManager::Instance()->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
if (!possibleSpawners.empty()) {
|
||||
auto* spawner = possibleSpawners.at(0);
|
||||
GameMessages::SendTeleport(playerID, spawner->GetPosition(), spawner->GetRotation(), player->GetSystemAddress(), true);
|
||||
@@ -353,7 +353,7 @@ void BaseWavesServer::GameOver(Entity* self, bool won) {
|
||||
ClearSpawners();
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -429,7 +429,7 @@ void BaseWavesServer::SpawnWave(Entity* self) {
|
||||
}
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player && player->GetIsDead()) {
|
||||
player->Resurrect();
|
||||
}
|
||||
@@ -471,7 +471,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
|
||||
state.currentSpawned--;
|
||||
|
||||
auto* enemy = EntityManager::Instance()->GetEntity(enemyID);
|
||||
auto* enemy = Game::entityManager->GetEntity(enemyID);
|
||||
if (enemy != nullptr && enemy->IsPlayer() && IsPlayerInActivity(self, enemyID)) {
|
||||
SetActivityValue(self, enemyID, 0, GetActivityValue(self, enemyID, 0) + score);
|
||||
}
|
||||
@@ -499,7 +499,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
const auto soloWaveMissions = waves.at(completedWave).soloMissions;
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr && !player->GetIsDead()) {
|
||||
SetActivityValue(self, playerID, 1, currentTime);
|
||||
SetActivityValue(self, playerID, 2, state.waveNumber);
|
||||
@@ -558,7 +558,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
// Done
|
||||
void BaseWavesServer::UpdateMissionForAllPlayers(Entity* self, uint32_t missionID) {
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
if (missionComponent == nullptr) return;
|
||||
|
@@ -12,7 +12,7 @@ void Darkitect::Reveal(Entity* self, Entity* player) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"reveal", 0, 0, playerID, "", player->GetSystemAddress());
|
||||
|
||||
self->AddCallbackTimer(20, [this, self, playerID]() {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
@@ -29,7 +29,7 @@ void Darkitect::Reveal(Entity* self, Entity* player) {
|
||||
character->SetPlayerFlag(1911, true);
|
||||
}
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(player);
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ void PersonalFortress::OnStartup(Entity* self) {
|
||||
true, true, true, true, true, true, true, true, true
|
||||
);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(owner);
|
||||
Game::entityManager->SerializeEntity(owner);
|
||||
}
|
||||
|
||||
void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
||||
@@ -47,7 +47,7 @@ void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
||||
true, true, true, true, true, true, true, true, true
|
||||
);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(owner);
|
||||
Game::entityManager->SerializeEntity(owner);
|
||||
}
|
||||
|
||||
void PersonalFortress::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
@@ -21,7 +21,7 @@ void ScriptedPowerupSpawner::OnTimerDone(Entity* self, std::string message) {
|
||||
drops.emplace(itemLOT, 1);
|
||||
|
||||
// Spawn the required number of powerups
|
||||
auto* owner = EntityManager::Instance()->GetEntity(self->GetSpawnerID());
|
||||
auto* owner = Game::entityManager->GetEntity(self->GetSpawnerID());
|
||||
if (owner != nullptr) {
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
for (auto i = 0; i < self->GetVar<uint32_t>(u"numberOfPowerups"); i++) {
|
||||
|
@@ -11,7 +11,7 @@ void SpawnPetBaseServer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) {
|
||||
auto possibleSpawners = EntityManager::Instance()->GetEntitiesInGroup(self->GetVar<std::string>(u"petType") + "Spawner");
|
||||
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup(self->GetVar<std::string>(u"petType") + "Spawner");
|
||||
if (possibleSpawners.empty())
|
||||
return;
|
||||
|
||||
@@ -33,8 +33,8 @@ void SpawnPetBaseServer::OnUse(Entity* self, Entity* user) {
|
||||
new LDFData<float_t>(u"spawnTimer", 1.0f)
|
||||
};
|
||||
|
||||
auto* pet = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(pet);
|
||||
auto* pet = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(pet);
|
||||
|
||||
self->SetVar<std::string>(u"spawnedPets", self->GetVar<std::string>(u"spawnedPets") + ","
|
||||
+ std::to_string(pet->GetObjectID()));
|
||||
@@ -57,7 +57,7 @@ bool SpawnPetBaseServer::CheckNumberOfPets(Entity* self, Entity* user) {
|
||||
if (petID.empty())
|
||||
continue;
|
||||
|
||||
const auto* spawnedPet = EntityManager::Instance()->GetEntity(std::stoull(petID));
|
||||
const auto* spawnedPet = Game::entityManager->GetEntity(std::stoull(petID));
|
||||
if (spawnedPet == nullptr)
|
||||
continue;
|
||||
|
||||
|
@@ -14,7 +14,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
Entity* player;
|
||||
|
||||
if (possessableComponent != nullptr) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(possessableComponent->GetPossessor());
|
||||
auto* player = Game::entityManager->GetEntity(possessableComponent->GetPossessor());
|
||||
|
||||
if (player == nullptr) {
|
||||
return;
|
||||
@@ -28,7 +28,7 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
return;
|
||||
}
|
||||
|
||||
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
||||
vehicle = Game::entityManager->GetEntity(possessorComponent->GetPossessable());
|
||||
|
||||
if (vehicle == nullptr) {
|
||||
return;
|
||||
|
@@ -11,7 +11,7 @@ void BaseFootRaceManager::OnFireEventServerSide(Entity* self, Entity* sender, st
|
||||
if (splitArguments.size() > 1) {
|
||||
|
||||
const auto eventName = splitArguments[0];
|
||||
const auto player = EntityManager::Instance()->GetEntity(std::stoull(splitArguments[1]));
|
||||
const auto player = Game::entityManager->GetEntity(std::stoull(splitArguments[1]));
|
||||
|
||||
if (player != nullptr) {
|
||||
if (eventName == "updatePlayer") {
|
||||
|
@@ -24,12 +24,12 @@ void AgBusDoor::OnProximityUpdate(Entity* self, Entity* entering, std::string na
|
||||
m_OuterCounter = 0;
|
||||
|
||||
for (const auto& pair : proximityMonitorComponent->GetProximityObjects("busDoor")) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(pair.first);
|
||||
auto* entity = Game::entityManager->GetEntity(pair.first);
|
||||
if (entity != nullptr && entity->IsPlayer()) m_Counter++;
|
||||
}
|
||||
|
||||
for (const auto& pair : proximityMonitorComponent->GetProximityObjects("busDoorOuter")) {
|
||||
auto* entity = EntityManager::Instance()->GetEntity(pair.first);
|
||||
auto* entity = Game::entityManager->GetEntity(pair.first);
|
||||
if (entity != nullptr && entity->IsPlayer()) m_OuterCounter++;
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ void AgFans::OnStartup(Entity* self) {
|
||||
|
||||
void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
std::string fanGroup = self->GetGroups()[0];
|
||||
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
|
||||
std::vector<Entity*> fanVolumes = Game::entityManager->GetEntitiesInGroup(fanGroup);
|
||||
|
||||
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
|
||||
|
||||
@@ -45,9 +45,9 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
|
||||
if (!volumePhys) continue;
|
||||
volumePhys->SetPhysicsEffectActive(false);
|
||||
EntityManager::Instance()->SerializeEntity(volume);
|
||||
Game::entityManager->SerializeEntity(volume);
|
||||
if (!hit) {
|
||||
Entity* fxObj = EntityManager::Instance()->GetEntitiesInGroup(fanGroup + "fx")[0];
|
||||
Entity* fxObj = Game::entityManager->GetEntitiesInGroup(fanGroup + "fx")[0];
|
||||
RenderComponent::PlayAnimation(fxObj, u"trigger");
|
||||
}
|
||||
}
|
||||
@@ -61,9 +61,9 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
|
||||
if (!volumePhys) continue;
|
||||
volumePhys->SetPhysicsEffectActive(true);
|
||||
EntityManager::Instance()->SerializeEntity(volume);
|
||||
Game::entityManager->SerializeEntity(volume);
|
||||
if (!hit) {
|
||||
Entity* fxObj = EntityManager::Instance()->GetEntitiesInGroup(fanGroup + "fx")[0];
|
||||
Entity* fxObj = Game::entityManager->GetEntitiesInGroup(fanGroup + "fx")[0];
|
||||
RenderComponent::PlayAnimation(fxObj, u"idle");
|
||||
}
|
||||
}
|
||||
|
@@ -36,9 +36,9 @@ void AgImagSmashable::CrateAnimal(Entity* self) {
|
||||
info.spawnerID = self->GetSpawnerID();
|
||||
info.spawnerNodeID = 0;
|
||||
|
||||
Entity* newEntity = EntityManager::Instance()->CreateEntity(info, nullptr);
|
||||
Entity* newEntity = Game::entityManager->CreateEntity(info, nullptr);
|
||||
if (newEntity) {
|
||||
EntityManager::Instance()->ConstructEntity(newEntity);
|
||||
Game::entityManager->ConstructEntity(newEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
||||
);
|
||||
inUse = true;
|
||||
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("Jet_FX");
|
||||
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);
|
||||
self->AddTimer("radarDish", 2.0f);
|
||||
@@ -22,7 +22,7 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
void AgJetEffectServer::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
if (self->GetLOT() != 6209) return;
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("Jet_FX");
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
|
||||
if (entities.empty()) return;
|
||||
RenderComponent::PlayAnimation(entities.at(0), u"jetFX");
|
||||
|
||||
@@ -40,7 +40,7 @@ void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "radarDish") {
|
||||
GameMessages::SendStopFXEffect(self, true, "radarDish");
|
||||
} else if (timerName == "PlayEffect") {
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup("mortarMain");
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup("mortarMain");
|
||||
if (entities.empty()) return;
|
||||
|
||||
const auto selected = GeneralUtils::GenerateRandomNumber<int>(0, entities.size() - 1);
|
||||
|
@@ -26,7 +26,7 @@ void AgQbElevator::OnProximityUpdate(Entity* self, Entity* entering, std::string
|
||||
if (self->GetBoolean(u"qbPlayerRdy")) return;
|
||||
|
||||
if (status == "ENTER") {
|
||||
Entity* builder = EntityManager::Instance()->GetEntity(self->GetI64(u"qbPlayer"));
|
||||
Entity* builder = Game::entityManager->GetEntity(self->GetI64(u"qbPlayer"));
|
||||
if (builder && builder == entering) {
|
||||
//the builder has entered so cancel the start timer and just start moving
|
||||
self->SetBoolean(u"qbPlayerRdy", true);
|
||||
|
@@ -4,7 +4,7 @@ void AgQbWall::OnRebuildComplete(Entity* self, Entity* player) {
|
||||
self->SetVar(u"player", player->GetObjectID());
|
||||
auto targetWallSpawners = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner"));
|
||||
if (targetWallSpawners != "") {
|
||||
auto groupObjs = EntityManager::Instance()->GetEntitiesInGroup(targetWallSpawners);
|
||||
auto groupObjs = Game::entityManager->GetEntitiesInGroup(targetWallSpawners);
|
||||
for (auto* obj : groupObjs) {
|
||||
if (obj) {
|
||||
obj->SetVar(u"player", player->GetObjectID());
|
||||
|
@@ -15,9 +15,9 @@ void AgSpaceStuff::OnStartup(Entity* self) {
|
||||
info.lot = 33;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* ref = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* ref = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(ref);
|
||||
Game::entityManager->ConstructEntity(ref);
|
||||
|
||||
self->SetVar(u"ShakeObject", ref->GetObjectID());
|
||||
|
||||
@@ -47,7 +47,7 @@ void AgSpaceStuff::OnTimerDone(Entity* self, std::string timerName) {
|
||||
void AgSpaceStuff::DoShake(Entity* self, bool explodeIdle) {
|
||||
|
||||
if (!explodeIdle) {
|
||||
auto* ref = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"ShakeObject"));
|
||||
auto* ref = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"ShakeObject"));
|
||||
|
||||
const auto randomTime = self->GetVar<int>(u"RandomTime");
|
||||
auto time = GeneralUtils::GenerateRandomNumber<int>(0, randomTime + 1);
|
||||
@@ -92,7 +92,7 @@ void AgSpaceStuff::DoShake(Entity* self, bool explodeIdle) {
|
||||
}
|
||||
|
||||
Entity* AgSpaceStuff::GetEntityInGroup(const std::string& group) {
|
||||
auto entities = EntityManager::Instance()->GetEntitiesInGroup(group);
|
||||
auto entities = Game::entityManager->GetEntitiesInGroup(group);
|
||||
Entity* en = nullptr;
|
||||
|
||||
for (auto entity : entities) {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#include "GameMessages.h"
|
||||
|
||||
void ActNinjaSensei::OnStartup(Entity* self) {
|
||||
auto students = EntityManager::Instance()->GetEntitiesInGroup(this->m_StudentGroup);
|
||||
auto students = Game::entityManager->GetEntitiesInGroup(this->m_StudentGroup);
|
||||
std::vector<Entity*> validStudents = {};
|
||||
for (auto* student : students) {
|
||||
if (student && student->GetLOT() == this->m_StudentLOT) validStudents.push_back(student);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
const auto myGroup = "AllPipes";
|
||||
|
||||
const auto groupObjs = EntityManager::Instance()->GetEntitiesInGroup(myGroup);
|
||||
const auto groupObjs = Game::entityManager->GetEntitiesInGroup(myGroup);
|
||||
|
||||
auto indexCount = 0;
|
||||
|
||||
@@ -27,14 +27,14 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
if (indexCount >= 2) {
|
||||
const auto refinery = EntityManager::Instance()->GetEntitiesInGroup("Paradox");
|
||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
GameMessages::SendPlayFXEffect(refinery[0]->GetObjectID(), 3999, u"create", "pipeFX");
|
||||
}
|
||||
|
||||
for (auto* object : groupObjs) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(object->GetVar<LWOOBJID>(u"PlayerID"));
|
||||
auto* player = Game::entityManager->GetEntity(object->GetVar<LWOOBJID>(u"PlayerID"));
|
||||
|
||||
if (player != nullptr) {
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
@@ -53,7 +53,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::RESETTING) {
|
||||
const auto refinery = EntityManager::Instance()->GetEntitiesInGroup("Paradox");
|
||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
GameMessages::SendStopFXEffect(refinery[0], true, "pipeFX");
|
||||
|
@@ -13,7 +13,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
||||
@@ -22,7 +22,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftDown");
|
||||
@@ -38,7 +38,7 @@ void FvConsoleLeftQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
if (self->GetVar<bool>(u"IAmBuilt")) {
|
||||
self->SetVar(u"AmActive", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftActive");
|
||||
|
@@ -13,7 +13,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
||||
@@ -22,7 +22,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightDown");
|
||||
@@ -38,7 +38,7 @@ void FvConsoleRightQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
if (self->GetVar<bool>(u"IAmBuilt")) {
|
||||
self->SetVar(u"AmActive", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightActive");
|
||||
|
@@ -21,7 +21,7 @@ void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
|
||||
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
||||
|
||||
auto* dragon = EntityManager::Instance()->GetEntity(dragonId);
|
||||
auto* dragon = Game::entityManager->GetEntity(dragonId);
|
||||
|
||||
if (dragon != nullptr) {
|
||||
dragon->OnFireEventServerSide(self, "rebuildDone");
|
||||
|
@@ -46,14 +46,14 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
}
|
||||
|
||||
if (self->GetVar<bool>(u"ConsoleLEFTActive") && self->GetVar<bool>(u"ConsoleRIGHTActive")) {
|
||||
auto* object = EntityManager::Instance()->GetEntitiesInGroup("Brick")[0];
|
||||
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");
|
||||
}
|
||||
|
||||
object = EntityManager::Instance()->GetEntitiesInGroup("Canister")[0];
|
||||
object = Game::entityManager->GetEntitiesInGroup("Canister")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
object->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
@@ -64,7 +64,7 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
} else if (self->GetVar<bool>(u"ConsoleLEFTActive") || self->GetVar<bool>(u"ConsoleRIGHTActive")) {
|
||||
brickSpawner->Activate();
|
||||
|
||||
auto* object = EntityManager::Instance()->GetEntitiesInGroup("Brick")[0];
|
||||
auto* object = Game::entityManager->GetEntitiesInGroup("Brick")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
GameMessages::SendStopFXEffect(object, true, "bluebrick");
|
||||
|
@@ -34,7 +34,7 @@ void FvFlyingCreviceDragon::OnTimerDone(Entity* self, std::string timerName) {
|
||||
groupName = "dragonFireballs3";
|
||||
}
|
||||
|
||||
const auto& group = EntityManager::Instance()->GetEntitiesInGroup(groupName);
|
||||
const auto& group = Game::entityManager->GetEntitiesInGroup(groupName);
|
||||
|
||||
if (group.empty()) {
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ void FvFlyingCreviceDragon::OnArrived(Entity* self) {
|
||||
} else if (point == 12) {
|
||||
RenderComponent::PlayAnimation(self, u"attack2", 2.0f);
|
||||
|
||||
const auto& group2 = EntityManager::Instance()->GetEntitiesInGroup("dragonFireballs2");
|
||||
const auto& group2 = Game::entityManager->GetEntitiesInGroup("dragonFireballs2");
|
||||
|
||||
if (group2.empty()) {
|
||||
return;
|
||||
|
@@ -22,13 +22,13 @@ void FvNinjaGuard::OnEmoteReceived(Entity* self, const int32_t emote, Entity* ta
|
||||
RenderComponent::PlayAnimation(self, u"scared");
|
||||
|
||||
if (self->GetLOT() == 7412) {
|
||||
auto* rightGuard = EntityManager::Instance()->GetEntity(m_RightGuard);
|
||||
auto* rightGuard = Game::entityManager->GetEntity(m_RightGuard);
|
||||
|
||||
if (rightGuard != nullptr) {
|
||||
RenderComponent::PlayAnimation(rightGuard, u"laugh_rt");
|
||||
}
|
||||
} else if (self->GetLOT() == 11128) {
|
||||
auto* leftGuard = EntityManager::Instance()->GetEntity(m_LeftGuard);
|
||||
auto* leftGuard = Game::entityManager->GetEntity(m_LeftGuard);
|
||||
|
||||
if (leftGuard != nullptr) {
|
||||
RenderComponent::PlayAnimation(leftGuard, u"laugh_lt");
|
||||
|
@@ -9,7 +9,7 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
auto* character = target->GetCharacter();
|
||||
if (character != nullptr && character->GetPlayerFlag(81)) {
|
||||
|
||||
auto raceObjects = EntityManager::Instance()->GetEntitiesInGroup("PandaRaceObject");
|
||||
auto raceObjects = Game::entityManager->GetEntitiesInGroup("PandaRaceObject");
|
||||
if (raceObjects.empty())
|
||||
return;
|
||||
|
||||
@@ -19,7 +19,7 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
return;
|
||||
|
||||
// If the player already spawned a panda
|
||||
auto playerPandas = EntityManager::Instance()->GetEntitiesInGroup("panda" + std::to_string(target->GetObjectID()));
|
||||
auto playerPandas = Game::entityManager->GetEntitiesInGroup("panda" + std::to_string(target->GetObjectID()));
|
||||
if (!playerPandas.empty()) {
|
||||
GameMessages::SendFireEventClientSide(self->GetObjectID(), target->GetSystemAddress(), u"playerPanda",
|
||||
target->GetObjectID(), 0, 0, target->GetObjectID());
|
||||
@@ -27,7 +27,7 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
// If there's already too many spawned pandas
|
||||
auto pandas = EntityManager::Instance()->GetEntitiesInGroup("pandas");
|
||||
auto pandas = Game::entityManager->GetEntitiesInGroup("pandas");
|
||||
if (pandas.size() > 4) {
|
||||
GameMessages::SendFireEventClientSide(self->GetObjectID(), target->GetSystemAddress(), u"tooManyPandas",
|
||||
target->GetObjectID(), 0, 0, target->GetObjectID());
|
||||
@@ -43,7 +43,7 @@ void FvPandaSpawnerServer::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
new LDFData<std::u16string>(u"groupID", u"panda" + (GeneralUtils::to_u16string(target->GetObjectID())) + u";pandas")
|
||||
};
|
||||
|
||||
auto* panda = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(panda);
|
||||
auto* panda = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(panda);
|
||||
}
|
||||
}
|
||||
|
@@ -20,9 +20,9 @@ void GfBanana::SpawnBanana(Entity* self) {
|
||||
info.lot = 6909;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(entity);
|
||||
Game::entityManager->ConstructEntity(entity);
|
||||
|
||||
self->SetVar(u"banana", entity->GetObjectID());
|
||||
|
||||
@@ -46,7 +46,7 @@ void GfBanana::OnHit(Entity* self, Entity* attacker) {
|
||||
|
||||
if (bananaId == LWOOBJID_EMPTY) return;
|
||||
|
||||
auto* bananaEntity = EntityManager::Instance()->GetEntity(bananaId);
|
||||
auto* bananaEntity = Game::entityManager->GetEntity(bananaId);
|
||||
|
||||
if (bananaEntity == nullptr) {
|
||||
self->SetVar(u"banana", LWOOBJID_EMPTY);
|
||||
@@ -79,12 +79,12 @@ void GfBanana::OnHit(Entity* self, Entity* attacker) {
|
||||
info.lot = 6718;
|
||||
info.spawnerID = self->GetObjectID();
|
||||
|
||||
auto* entity = EntityManager::Instance()->CreateEntity(info);
|
||||
auto* entity = Game::entityManager->CreateEntity(info);
|
||||
|
||||
EntityManager::Instance()->ConstructEntity(entity, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
Game::entityManager->ConstructEntity(entity, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
*/
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
}
|
||||
|
||||
void GfBanana::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
@@ -83,7 +83,7 @@ void GfCampfire::OnTimerDone(Entity* self, std::string timerName) {
|
||||
|
||||
const auto targetId = self->GetVar<LWOOBJID>("target");
|
||||
|
||||
auto* entering = EntityManager::Instance()->GetEntity(targetId);
|
||||
auto* entering = Game::entityManager->GetEntity(targetId);
|
||||
|
||||
if (entering == nullptr)
|
||||
{
|
||||
|
@@ -30,8 +30,8 @@ void PetDigBuild::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
}
|
||||
|
||||
auto* treasure = EntityManager::Instance()->CreateEntity(info);
|
||||
EntityManager::Instance()->ConstructEntity(treasure);
|
||||
auto* treasure = Game::entityManager->CreateEntity(info);
|
||||
Game::entityManager->ConstructEntity(treasure);
|
||||
self->SetVar<LWOOBJID>(u"chestObj", treasure->GetObjectID());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void PetDigBuild::OnDie(Entity* self, Entity* killer) {
|
||||
if (treasureID == LWOOBJID_EMPTY)
|
||||
return;
|
||||
|
||||
auto treasure = EntityManager::Instance()->GetEntity(treasureID);
|
||||
auto treasure = Game::entityManager->GetEntity(treasureID);
|
||||
if (treasure == nullptr)
|
||||
return;
|
||||
|
||||
|
@@ -78,7 +78,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
const std::u16string& stringValue) {
|
||||
Game::logger->Log("SGCannon", "Got activity state change request: %s", GeneralUtils::UTF16ToWTF8(stringValue).c_str());
|
||||
if (stringValue == u"clientready") {
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
Game::logger->Log("SGCannon", "Player is ready");
|
||||
/*GameMessages::SendSetStunned(player->GetObjectID(), eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
|
||||
@@ -95,7 +95,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
|
||||
Game::logger->Log("SGCannon", "Setting player ID");
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
} else {
|
||||
Game::logger->Log("SGCannon", "Shooting gallery component is null");
|
||||
}
|
||||
@@ -111,7 +111,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
possessor->SetPossessableType(ePossessionType::NO_POSSESSION);
|
||||
}
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(player);
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
}
|
||||
|
||||
self->SetNetworkVar<bool>(HideScoreBoardVariable, true);
|
||||
@@ -137,7 +137,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
||||
}
|
||||
|
||||
void SGCannon::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (!player) return;
|
||||
|
||||
if (identifier == u"Scoreboardinfo") {
|
||||
@@ -193,7 +193,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
|
||||
ActivityTimerStart(self, EndWaveTimer, timeLimit, timeLimit);
|
||||
}
|
||||
|
||||
const auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
const auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
GameMessages::SendPlayFXEffect(player->GetObjectID(), -1, u"SG-start", "");
|
||||
|
||||
@@ -234,13 +234,13 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
|
||||
PauseChargeCannon(self);
|
||||
}
|
||||
} else if (name == GameOverTimer) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
Game::logger->Log("SGCannon", "Sending ActivityPause true");
|
||||
|
||||
GameMessages::SendActivityPause(self->GetObjectID(), true, player->GetSystemAddress());
|
||||
|
||||
/*const auto leftoverCannonballs = EntityManager::Instance()->GetEntitiesInGroup("cannonball");
|
||||
/*const auto leftoverCannonballs = Game::entityManager->GetEntitiesInGroup("cannonball");
|
||||
if (leftoverCannonballs.empty()) {
|
||||
RecordPlayerScore(self);
|
||||
|
||||
@@ -284,8 +284,8 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
|
||||
|
||||
Game::logger->Log("SGCannon", "Spawning enemy %i on path %s", toSpawn.lot, path->pathName.c_str());
|
||||
|
||||
auto* enemy = EntityManager::Instance()->CreateEntity(info, nullptr, self);
|
||||
EntityManager::Instance()->ConstructEntity(enemy);
|
||||
auto* enemy = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(enemy);
|
||||
|
||||
auto* movementAI = new MovementAIComponent(enemy, {});
|
||||
|
||||
@@ -334,12 +334,12 @@ void SGCannon::StartGame(Entity* self) {
|
||||
self->SetNetworkVar<bool>(AudioStartIntroVariable, true);
|
||||
self->SetVar<LOT>(CurrentRewardVariable, LOT_NULL);
|
||||
|
||||
auto rewardObjects = EntityManager::Instance()->GetEntitiesInGroup(constants.rewardModelGroup);
|
||||
auto rewardObjects = Game::entityManager->GetEntitiesInGroup(constants.rewardModelGroup);
|
||||
for (auto* reward : rewardObjects) {
|
||||
reward->OnFireEventServerSide(self, ModelToBuildEvent);
|
||||
}
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
GetLeaderboardData(self, player->GetObjectID(), GetActivityID(self));
|
||||
Game::logger->Log("SGCannon", "Sending ActivityStart");
|
||||
@@ -384,9 +384,9 @@ void SGCannon::SpawnNewModel(Entity* self) {
|
||||
self->SetNetworkVar<int32_t>(RewardAddedVariable, currentReward);
|
||||
}
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
for (auto* rewardModel : EntityManager::Instance()->GetEntitiesInGroup(constants.rewardModelGroup)) {
|
||||
for (auto* rewardModel : Game::entityManager->GetEntitiesInGroup(constants.rewardModelGroup)) {
|
||||
uint32_t lootMatrix;
|
||||
switch (self->GetVar<uint32_t>(MatrixVariable)) {
|
||||
case 1:
|
||||
@@ -422,7 +422,7 @@ void SGCannon::SpawnNewModel(Entity* self) {
|
||||
}
|
||||
|
||||
void SGCannon::RemovePlayer(LWOOBJID playerID) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
@@ -508,7 +508,7 @@ void SGCannon::RecordPlayerScore(Entity* self) {
|
||||
}
|
||||
|
||||
void SGCannon::PlaySceneAnimation(Entity* self, const std::u16string& animationName, bool onCannon, bool onPlayer, float_t priority) {
|
||||
for (auto* cannon : EntityManager::Instance()->GetEntitiesInGroup("cannongroup")) {
|
||||
for (auto* cannon : Game::entityManager->GetEntitiesInGroup("cannongroup")) {
|
||||
RenderComponent::PlayAnimation(cannon, animationName, priority);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ void SGCannon::PlaySceneAnimation(Entity* self, const std::u16string& animationN
|
||||
}
|
||||
|
||||
if (onPlayer) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player != nullptr) {
|
||||
RenderComponent::PlayAnimation(player, animationName, priority);
|
||||
}
|
||||
@@ -538,7 +538,7 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
|
||||
self->SetNetworkVar<bool>(ReSetSuperChargeVariable, true);
|
||||
self->SetNetworkVar<bool>(HideSuperChargeVariable, true);
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player == nullptr)
|
||||
return;
|
||||
|
||||
@@ -596,7 +596,7 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
|
||||
ActivityTimerStopAllTimers(self);
|
||||
|
||||
// Destroy all spawners
|
||||
for (auto* entity : EntityManager::Instance()->GetEntitiesInGroup("SGEnemy")) {
|
||||
for (auto* entity : Game::entityManager->GetEntitiesInGroup("SGEnemy")) {
|
||||
entity->Kill();
|
||||
}
|
||||
|
||||
@@ -663,7 +663,7 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
|
||||
|
||||
self->SetNetworkVar<std::u16string>(u"beatHighScore", GeneralUtils::to_u16string(newScore));
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
if (player == nullptr) return;
|
||||
|
||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
||||
@@ -713,7 +713,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
|
||||
if (enable && self->GetVar<bool>(SuperChargeActiveVariable))
|
||||
return;
|
||||
|
||||
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
auto* player = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
|
||||
|
||||
if (player == nullptr) {
|
||||
Game::logger->Log("SGCannon", "Player not found in toggle super charge");
|
||||
@@ -788,8 +788,8 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
|
||||
|
||||
shootingGalleryComponent->SetDynamicParams(properties);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(self);
|
||||
EntityManager::Instance()->SerializeEntity(player);
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
Game::entityManager->SerializeEntity(player);
|
||||
|
||||
self->SetNetworkVar<uint64_t>(CannonBallSkillIDVariable, skillID);
|
||||
self->SetVar<bool>(SuperChargeActiveVariable, enable);
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "EntityManager.h"
|
||||
|
||||
void ZoneSGServer::OnStartup(Entity* self) {
|
||||
const auto cannons = EntityManager::Instance()->GetEntitiesByLOT(1864);
|
||||
const auto cannons = Game::entityManager->GetEntitiesByLOT(1864);
|
||||
for (const auto& cannon : cannons)
|
||||
self->SetVar<LWOOBJID>(CannonIDVariable, cannon->GetObjectID());
|
||||
}
|
||||
@@ -10,7 +10,7 @@ void ZoneSGServer::OnStartup(Entity* self) {
|
||||
void ZoneSGServer::OnActivityStateChangeRequest(Entity* self, const LWOOBJID senderID, const int32_t value1,
|
||||
const int32_t value2, const std::u16string& stringValue) {
|
||||
|
||||
auto* cannon = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
||||
auto* cannon = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
||||
if (cannon != nullptr) {
|
||||
cannon->OnActivityStateChangeRequest(senderID, value1, value2, stringValue);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ void ZoneSGServer::OnActivityStateChangeRequest(Entity* self, const LWOOBJID sen
|
||||
void ZoneSGServer::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3) {
|
||||
|
||||
auto* cannon = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
||||
auto* cannon = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(CannonIDVariable));
|
||||
if (cannon != nullptr) {
|
||||
cannon->OnFireEventServerSide(sender, args, param1, param2, param3);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user