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:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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");
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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());
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "GameMessages.h"
|
||||
#include "Loot.h"
|
||||
#include "EntityManager.h"
|
||||
#include "eTerminateType.h"
|
||||
|
||||
void WishingWellServer::OnStartup(Entity* self) {
|
||||
}
|
||||
|
Reference in New Issue
Block a user