Merge remote-tracking branch 'origin/main' into grim-lu

This commit is contained in:
wincent
2023-10-07 14:22:23 +02:00
407 changed files with 6059 additions and 3708 deletions

View File

@@ -65,7 +65,7 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
}
void BossSpiderQueenEnemyServer::OnDie(Entity* self, Entity* killer) {
if (dZoneManager::Instance()->GetZoneID().GetMapID() == instanceZoneID) {
if (Game::zoneManager->GetZoneID().GetMapID() == instanceZoneID) {
auto* missionComponent = killer->GetComponent<MissionComponent>();
if (missionComponent == nullptr)
return;
@@ -74,13 +74,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");
}
@@ -110,7 +110,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>();
@@ -127,7 +127,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;
@@ -165,7 +165,11 @@ void BossSpiderQueenEnemyServer::WithdrawSpider(Entity* self, const bool withdra
destroyable->SetArmor(destroyable->GetMaxArmor() / 3);
EntityManager::Instance()->SerializeEntity(self);
auto* destroyable = self->GetComponent<DestroyableComponent>();
destroyable->SetArmor(destroyable->GetMaxArmor() / 3);
Game::entityManager->SerializeEntity(self);
// Prepare a timer for post leap attack
self->AddTimer("AdvanceAttack", attackPause);
@@ -198,7 +202,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());
}
@@ -220,7 +224,7 @@ void BossSpiderQueenEnemyServer::SpiderWaveManager(Entity* self) {
}
if (randomEgg) {
auto* eggEntity = EntityManager::Instance()->GetEntity(randomEgg);
auto* eggEntity = Game::entityManager->GetEntity(randomEgg);
if (eggEntity == nullptr) {
continue;
@@ -253,7 +257,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;
@@ -295,7 +299,7 @@ void BossSpiderQueenEnemyServer::RunRainOfFire(Entity* self) {
auto index = 0u;
for (const auto& rofGroup : ROFTargetGroupIDTable) {
const auto spawners = dZoneManager::Instance()->GetSpawnersInGroup(rofGroup);
const auto spawners = Game::zoneManager->GetSpawnersInGroup(rofGroup);
std::vector<LWOOBJID> spawned;
@@ -334,7 +338,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());
@@ -476,7 +480,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);
@@ -487,7 +491,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
@@ -559,7 +563,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>();
@@ -615,10 +619,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
@@ -689,7 +693,7 @@ void BossSpiderQueenEnemyServer::OnUpdate(Entity* self) {
controllable->SetRotation(NiQuaternion::IDENTITY);
controllable->SetStatic(true);
EntityManager::Instance()->SerializeEntity(self);
Game::entityManager->SerializeEntity(self);
}
//----------------------------------------------

View File

@@ -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);
}
}
}

View File

@@ -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");

View File

@@ -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);
}
}
}

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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;