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:
Aaron Kimbrell
2023-05-02 17:39:21 -05:00
committed by GitHub
parent e8590a5853
commit 6aa90ad5b2
161 changed files with 960 additions and 776 deletions

View File

@@ -7,7 +7,7 @@ void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
// Only allow use if this is not a quick build or the quick build is built
if (rebuildComponent == nullptr || rebuildComponent->GetState() == REBUILD_COMPLETED) {
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {
auto* character = user->GetCharacter();
if (character != nullptr) {
character->SetPlayerFlag(flag, true);

View File

@@ -19,7 +19,7 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s
}
void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state == REBUILD_COMPLETED) {
if (state == eRebuildState::COMPLETED) {
auto* relatedRail = GetRelatedRail(self);
if (relatedRail == nullptr)
return;
@@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
return;
self->SetNetworkVar(NetworkNotActiveVariable, false);
} else if (state == REBUILD_RESETTING) {
} else if (state == eRebuildState::RESETTING) {
auto* relatedRail = GetRelatedRail(self);
if (relatedRail == nullptr)
return;

View File

@@ -5,5 +5,5 @@ void NjhubLavaPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* targe
if (!target->IsPlayer())
return;
target->Smash(self->GetObjectID(), VIOLENT, u"drown");
target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"drown");
}

View File

@@ -97,7 +97,7 @@ void PetDigServer::OnDie(Entity* self, Entity* killer) {
// Handles smashing leftovers (edge case for the AG X)
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
if (xObject != nullptr) {
xObject->Smash(xObject->GetObjectID(), VIOLENT);
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
}
}
@@ -112,7 +112,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
auto* player = playerEntity->GetCharacter();
const auto groupID = self->GetVar<std::u16string>(u"groupID");
auto playerFlag = 0;
int32_t playerFlag = 0;
// The flag that the player dug up
if (groupID == u"Flag1") {
@@ -136,7 +136,7 @@ void PetDigServer::HandleXBuildDig(const Entity* self, Entity* owner, Entity* pe
auto* xObject = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"X"));
if (xObject != nullptr) {
xObject->Smash(xObject->GetObjectID(), VIOLENT);
xObject->Smash(xObject->GetObjectID(), eKillType::VIOLENT);
}
}

View File

@@ -15,7 +15,7 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == REBUILD_COMPLETED) {
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
// if (movingPlatform != nullptr) {
// movingPlatform->GotoWaypoint(1);

View File

@@ -3,6 +3,8 @@
#include "GameMessages.h"
#include "Character.h"
#include "eReplicaComponentType.h"
#include "eTerminateType.h"
#include "ePlayerFlag.h"
//2021-05-03 - max - added script, omitted some parts related to inheritance in lua which we don't need
@@ -22,15 +24,15 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
if (!character) return;
// At this point the player has to be in a faction.
LOT tokenLOT = 0;
if (character->GetPlayerFlag(ePlayerFlags::VENTURE_FACTION)) //venture
if (character->GetPlayerFlag(ePlayerFlag::VENTURE_FACTION)) //venture
tokenLOT = 8321;
else if (character->GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION)) //assembly
else if (character->GetPlayerFlag(ePlayerFlag::ASSEMBLY_FACTION)) //assembly
tokenLOT = 8318;
else if (character->GetPlayerFlag(ePlayerFlags::PARADOX_FACTION)) //paradox
else if (character->GetPlayerFlag(ePlayerFlag::PARADOX_FACTION)) //paradox
tokenLOT = 8320;
else if (character->GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) //sentinel
else if (character->GetPlayerFlag(ePlayerFlag::SENTINEL_FACTION)) //sentinel
tokenLOT = 8319;
inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::LOOT_SOURCE_NONE);
inv->AddItem(tokenLOT, tokensToGive, eLootSourceType::NONE);
}
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "Loot.h"
#include "EntityManager.h"
#include "eTerminateType.h"
void WishingWellServer::OnStartup(Entity* self) {
}