mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Merge branch 'main' into moreMovementAi
This commit is contained in:
@@ -5,7 +5,7 @@ void AmBridge::OnStartup(Entity* self) {
|
||||
|
||||
}
|
||||
|
||||
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AmBridge::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
||||
|
||||
if (consoles.empty()) {
|
||||
|
@@ -5,6 +5,6 @@ class AmBridge : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
@@ -66,7 +66,7 @@ void AmDrawBridge::OnTimerDone(Entity* self, std::string timerName) {
|
||||
return;
|
||||
}
|
||||
|
||||
simplePhysicsComponent->SetAngularVelocity(NiPoint3::ZERO);
|
||||
simplePhysicsComponent->SetAngularVelocity(NiPoint3Constant::ZERO);
|
||||
|
||||
Game::entityManager->SerializeEntity(bridge);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ void AmDrawBridge::MoveBridgeDown(Entity* self, Entity* bridge, bool down) {
|
||||
|
||||
const auto travelTime = 2.0f;
|
||||
|
||||
forwardVect = forwardVect * (float)((degrees / travelTime) * (3.14f / 180.0f));
|
||||
forwardVect = forwardVect * static_cast<float>((degrees / travelTime) * (3.14f / 180.0f));
|
||||
|
||||
simplePhysicsComponent->SetAngularVelocity(forwardVect);
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#include "AmDropshipComputer.h"
|
||||
#include "MissionComponent.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "InventoryComponent.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "eMissionState.h"
|
||||
@@ -10,18 +10,14 @@ void AmDropshipComputer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
if (!quickBuildComponent || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) return;
|
||||
|
||||
auto* missionComponent = user->GetComponent<MissionComponent>();
|
||||
auto* inventoryComponent = user->GetComponent<InventoryComponent>();
|
||||
|
||||
if (missionComponent == nullptr || inventoryComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (!missionComponent || !inventoryComponent) return;
|
||||
|
||||
if (inventoryComponent->GetLotCount(m_NexusTalonDataCard) != 0 || missionComponent->GetMission(979)->GetMissionState() == eMissionState::COMPLETE) {
|
||||
return;
|
||||
@@ -33,14 +29,12 @@ void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
||||
void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
||||
|
||||
int32_t pipeNum = 0;
|
||||
if (!GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1), pipeNum)) {
|
||||
return;
|
||||
}
|
||||
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
||||
if (!pipeNum) return;
|
||||
|
||||
const auto pipeGroup = myGroup.substr(0, 10);
|
||||
|
||||
const auto nextPipeNum = pipeNum + 1;
|
||||
const auto nextPipeNum = pipeNum.value() + 1;
|
||||
|
||||
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
|
||||
@@ -70,13 +64,11 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
||||
}
|
||||
|
||||
void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
const auto* const quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (!quickBuildComponent) return;
|
||||
|
||||
if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
if (timerName == "reset" && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "SkillComponent.h"
|
||||
#include "EntityInfo.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "MissionComponent.h"
|
||||
|
||||
void AmShieldGeneratorQuickbuild::OnStartup(Entity* self) {
|
||||
@@ -100,7 +100,7 @@ void AmShieldGeneratorQuickbuild::OnTimerDone(Entity* self, std::string timerNam
|
||||
}
|
||||
}
|
||||
|
||||
void AmShieldGeneratorQuickbuild::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void AmShieldGeneratorQuickbuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
StartShield(self);
|
||||
|
||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||
@@ -174,9 +174,9 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) {
|
||||
}
|
||||
|
||||
void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intruder) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -8,7 +8,7 @@ public:
|
||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||
void OnDie(Entity* self, Entity* killer) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
|
||||
void StartShield(Entity* self);
|
||||
void BuffPlayers(Entity* self);
|
||||
|
@@ -144,13 +144,10 @@ void AmSkullkinTower::OnChildRemoved(Entity* self, Entity* child) {
|
||||
);
|
||||
|
||||
for (const auto& mission : missions) {
|
||||
int32_t missionID = 0;
|
||||
const auto missionID = GeneralUtils::TryParse<int32_t>(mission);
|
||||
if (!missionID) continue;
|
||||
|
||||
if (!GeneralUtils::TryParse(mission, missionID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
missionIDs.push_back(missionID);
|
||||
missionIDs.push_back(missionID.value());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -12,12 +12,9 @@ void AmTemplateSkillVolume::OnSkillEventFired(Entity* self, Entity* caster, cons
|
||||
const auto missionIDs = GeneralUtils::SplitString(missionIDsVariable, '_');
|
||||
|
||||
for (const auto& missionIDStr : missionIDs) {
|
||||
int32_t missionID = 0;
|
||||
const auto missionID = GeneralUtils::TryParse<uint32_t>(missionIDStr);
|
||||
if (!missionID) continue;
|
||||
|
||||
if (!GeneralUtils::TryParse(missionIDStr, missionID)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
missionComponent->ForceProgressTaskType(missionID, 1, 1, false);
|
||||
missionComponent->ForceProgressTaskType(missionID.value(), 1, 1, false);
|
||||
}
|
||||
}
|
||||
|
@@ -18,3 +18,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_AM
|
||||
"AmTeapotServer.cpp"
|
||||
"WanderingVendor.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
||||
add_library(dScriptsServerMapAM ${DSCRIPTS_SOURCES_02_SERVER_MAP_AM})
|
||||
target_include_directories(dScriptsServerMapAM PUBLIC ".")
|
||||
target_precompile_headers(dScriptsServerMapAM REUSE_FROM dScriptsBase)
|
||||
|
Reference in New Issue
Block a user