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

@@ -59,6 +59,6 @@ void CatapultBaseServer::OnTimerDone(Entity* self, std::string timerName) {
// kill the bouncer
GameMessages::SendNotifyClientObject(bouncer->GetObjectID(), u"TimeToDie");
bouncer->Smash(self->GetObjectID(), VIOLENT);
bouncer->Smash(self->GetObjectID(), eKillType::VIOLENT);
}
}

View File

@@ -45,7 +45,7 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
}
void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state != eRebuildState::REBUILD_RESETTING) {
if (state != eRebuildState::RESETTING) {
return;
}

View File

@@ -9,7 +9,7 @@ void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
return;
}
if (rebuildComponent->GetState() == REBUILD_COMPLETED) {
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
// Use the shrine
BaseUse(self, user);
}

View File

@@ -44,6 +44,6 @@ void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
return;
}
inventoryComponent->AddItem(16644, 1, eLootSourceType::LOOT_SOURCE_NONE);
inventoryComponent->AddItem(16644, 1, eLootSourceType::NONE);
}
}

View File

@@ -4,11 +4,12 @@
#include "Loot.h"
#include "Entity.h"
#include "DestroyableComponent.h"
#include "ePlayerFlag.h"
void NjDragonEmblemChestServer::OnUse(Entity* self, Entity* user) {
auto* character = user->GetCharacter();
if (character != nullptr) {
character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, false);
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
}
auto* destroyable = self->GetComponent<DestroyableComponent>();

View File

@@ -1,6 +1,7 @@
#include "NjGarmadonCelebration.h"
#include "Character.h"
#include "GameMessages.h"
#include "ePlayerFlag.h"
void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
auto* character = target->GetCharacter();
@@ -9,8 +10,8 @@ void NjGarmadonCelebration::OnCollisionPhantom(Entity* self, Entity* target) {
return;
}
if (!character->GetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN)) {
character->SetPlayerFlag(ePlayerFlags::NJ_GARMADON_CINEMATIC_SEEN, true);
if (!character->GetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN)) {
character->SetPlayerFlag(ePlayerFlag::NJ_GARMADON_CINEMATIC_SEEN, true);
GameMessages::SendStartCelebrationEffect(target, target->GetSystemAddress(), GarmadonCelebrationID);
}

View File

@@ -1,12 +1,13 @@
#pragma once
#include "CppScripts.h"
#include <map>
#include "ePlayerFlag.h"
static std::map<std::u16string, uint32_t> ElementFlags = {
{u"earth", ePlayerFlags::NJ_EARTH_SPINJITZU},
{u"lightning", ePlayerFlags::NJ_LIGHTNING_SPINJITZU},
{u"ice", ePlayerFlags::NJ_ICE_SPINJITZU},
{u"fire", ePlayerFlags::NJ_FIRE_SPINJITZU}
static std::map<std::u16string, ePlayerFlag> ElementFlags = {
{u"earth", ePlayerFlag::NJ_EARTH_SPINJITZU},
{u"lightning", ePlayerFlag::NJ_LIGHTNING_SPINJITZU},
{u"ice", ePlayerFlag::NJ_ICE_SPINJITZU},
{u"fire", ePlayerFlag::NJ_FIRE_SPINJITZU}
};
static std::map<std::u16string, uint32_t> ElementMissions = {

View File

@@ -12,6 +12,6 @@ void NjScrollChestServer::OnUse(Entity* self, Entity* user) {
playerInventory->RemoveItem(keyLOT, 1);
// Reward the player with the item set
playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::LOOT_SOURCE_NONE);
playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::NONE);
}
}

View File

@@ -4,6 +4,7 @@
#include "EntityManager.h"
#include "GameMessages.h"
#include "eMissionState.h"
#include "ePlayerFlag.h"
void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
@@ -24,7 +25,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
missionComponent->AcceptMission(subMissionID);
}
character->SetPlayerFlag(ePlayerFlags::NJ_WU_SHOW_DAILY_CHEST, false);
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, false);
// Hide the chest
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {
@@ -37,7 +38,7 @@ void NjWuNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, e
case eMissionState::READY_TO_COMPLETE:
case eMissionState::COMPLETE_READY_TO_COMPLETE:
{
character->SetPlayerFlag(NJ_WU_SHOW_DAILY_CHEST, true);
character->SetPlayerFlag(ePlayerFlag::NJ_WU_SHOW_DAILY_CHEST, true);
// Show the chest
for (auto* chest : EntityManager::Instance()->GetEntitiesInGroup(m_DragonChestGroup)) {

View File

@@ -225,21 +225,21 @@ void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* co
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
switch (state) {
case REBUILD_BUILDING:
case eRebuildState::BUILDING:
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
0, 0, counterWeight->GetObjectID(),
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
UNASSIGNED_SYSTEM_ADDRESS);
return;
case REBUILD_INCOMPLETE:
case eRebuildState::INCOMPLETE:
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
0, 0, LWOOBJID_EMPTY, "",
UNASSIGNED_SYSTEM_ADDRESS);
return;
case REBUILD_RESETTING:
case eRebuildState::RESETTING:
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
return;
case REBUILD_COMPLETED: {
case eRebuildState::COMPLETED: {
// TODO: Move the platform?
// The counterweight is actually a moving platform and we should listen to the last waypoint event here