mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Breakout rest of the enums from dCommonVars and clean it up (#1061)
* Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#include "ActNinjaTurret.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"AmBuilt", true);
|
||||
} else if (state == eRebuildState::REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"AmBuilt", false);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
|
||||
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
|
||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
indexCount++;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_RESETTING) {
|
||||
if (state == eRebuildState::RESETTING) {
|
||||
const auto refinery = EntityManager::Instance()->GetEntitiesInGroup("Paradox");
|
||||
|
||||
if (!refinery.empty()) {
|
||||
|
@@ -61,8 +61,8 @@ void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "reset") {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_OPEN) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "FvConsoleLeftQuickbuild.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
@@ -8,7 +10,7 @@ void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
@@ -16,7 +18,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
||||
}
|
||||
} else if (state == REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
@@ -43,5 +45,5 @@ void FvConsoleLeftQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "FvConsoleRightQuickbuild.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "eTerminateType.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
@@ -8,7 +10,7 @@ void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
self->SetVar(u"IAmBuilt", true);
|
||||
|
||||
const auto objects = EntityManager::Instance()->GetEntitiesInGroup("Facility");
|
||||
@@ -16,7 +18,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
||||
if (!objects.empty()) {
|
||||
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
||||
}
|
||||
} else if (state == REBUILD_RESETTING) {
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
self->SetVar(u"IAmBuilt", false);
|
||||
self->SetVar(u"AmActive", false);
|
||||
|
||||
@@ -43,5 +45,5 @@ void FvConsoleRightQuickbuild::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
}
|
||||
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), FROM_INTERACTION, self->GetObjectID());
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "FvDragonSmashingGolemQb.h"
|
||||
#include "GameMessages.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eRebuildState.h"
|
||||
|
||||
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
||||
self->AddTimer("GolemBreakTimer", 10.5f);
|
||||
@@ -13,7 +14,7 @@ void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) {
|
||||
}
|
||||
|
||||
void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::REBUILD_COMPLETED) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
GameMessages::SendPlayAnimation(self, u"dragonsmash");
|
||||
|
||||
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
||||
|
@@ -56,7 +56,7 @@ void FvFacilityBrick::OnNotifyObject(Entity* self, Entity* sender, const std::st
|
||||
object = EntityManager::Instance()->GetEntitiesInGroup("Canister")[0];
|
||||
|
||||
if (object != nullptr) {
|
||||
object->Smash(self->GetObjectID(), SILENT);
|
||||
object->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
||||
canisterSpawner->Reset();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "FvPandaServer.h"
|
||||
#include "PetComponent.h"
|
||||
#include "Character.h"
|
||||
#include "ePetTamingNotifyType.h"
|
||||
|
||||
void FvPandaServer::OnStartup(Entity* self) {
|
||||
const auto* petComponent = self->GetComponent<PetComponent>();
|
||||
@@ -10,12 +11,12 @@ void FvPandaServer::OnStartup(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) {
|
||||
if (type == NOTIFY_TYPE_BEGIN) {
|
||||
void FvPandaServer::OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) {
|
||||
if (type == ePetTamingNotifyType::BEGIN) {
|
||||
self->CancelAllTimers();
|
||||
} else if (type == NOTIFY_TYPE_QUIT || type == NOTIFY_TYPE_FAILED) {
|
||||
} else if (type == ePetTamingNotifyType::QUIT || type == ePetTamingNotifyType::FAILED) {
|
||||
self->Smash();
|
||||
} else if (type == NOTIFY_TYPE_SUCCESS) {
|
||||
} else if (type == ePetTamingNotifyType::SUCCESS) {
|
||||
// TODO: Remove from groups
|
||||
|
||||
auto* character = tamer->GetCharacter();
|
||||
@@ -29,7 +30,7 @@ void FvPandaServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "killSelf") {
|
||||
const auto* petComponent = self->GetComponent<PetComponent>();
|
||||
if (petComponent != nullptr && petComponent->GetOwner() == nullptr) {
|
||||
self->Smash(self->GetObjectID(), SILENT);
|
||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,6 @@
|
||||
|
||||
class FvPandaServer : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, eNotifyType type) override;
|
||||
void OnNotifyPetTamingMinigame(Entity* self, Entity* tamer, ePetTamingNotifyType type) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user