Rename RebuildComponent to QuickbuildComponent

This commit is contained in:
Aaron Kimbre 2023-06-09 17:12:57 -05:00
parent ddc5f0e117
commit a68fa69e7a
31 changed files with 155 additions and 155 deletions

View File

@ -47,7 +47,7 @@
#include "MovingPlatformComponent.h"
#include "MissionComponent.h"
#include "MissionOfferComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "BuildBorderComponent.h"
#include "MovementAIComponent.h"
#include "VendorComponent.h"
@ -1016,9 +1016,9 @@ void Entity::AddCollisionPhantomCallback(const std::function<void(Entity* target
}
void Entity::AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const {
auto rebuildComponent = GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr) {
rebuildComponent->AddRebuildCompleteCallback(callback);
auto quickBuildComponent = GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr) {
quickBuildComponent->AddRebuildCompleteCallback(callback);
}
}

View File

@ -192,11 +192,11 @@ Entity::Initialize() {
*/
int buffComponentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::BUFF);
int rebuildComponentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::QUICK_BUILD);
int quickBuildComponentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::QUICK_BUILD);
int componentID = 0;
if (collectibleComponentID > 0) componentID = collectibleComponentID;
if (rebuildComponentID > 0) componentID = rebuildComponentID;
if (quickBuildComponentID > 0) componentID = quickBuildComponentID;
if (buffComponentID > 0) componentID = buffComponentID;
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
@ -383,11 +383,11 @@ Entity::Initialize() {
// }
if (int componentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::QUICK_BUILD) > 0) {
RebuildComponent* comp = new RebuildComponent(this);
QuickBuildComponent* comp = new QuickBuildComponent(this);
m_Components.insert(std::make_pair(eReplicaComponentType::QUICK_BUILD, comp));
CDRebuildComponentTable* rebCompTable = CDClientManager::Instance().GetTable<CDRebuildComponentTable>();
std::vector<CDRebuildComponent> rebCompData = rebCompTable->Query([=](CDRebuildComponent entry) { return (entry.id == rebuildComponentID); });
std::vector<CDRebuildComponent> rebCompData = rebCompTable->Query([=](CDRebuildComponent entry) { return (entry.id == quickBuildComponentID); });
if (rebCompData.size() > 0) {
comp->SetResetTime(rebCompData[0].reset_time);

View File

@ -7,7 +7,7 @@
#include "dLogger.h"
#include "BehaviorBranchContext.h"
#include "BehaviorContext.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "DestroyableComponent.h"
#include "Game.h"
#include "dLogger.h"

View File

@ -13,7 +13,7 @@
#include "DestroyableComponent.h"
#include "EchoSyncSkill.h"
#include "PhantomPhysicsComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "eReplicaComponentType.h"
#include "eConnectionType.h"

View File

@ -6,7 +6,7 @@
#include "Game.h"
#include "dLogger.h"
#include "DestroyableComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "Entity.h"
#include "EntityInfo.h"
#include "eReplicaComponentType.h"
@ -53,10 +53,10 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
entity->SetOwnerOverride(context->originator);
// Unset the flag to reposition the player, this makes it harder to glitch out of the map
auto* rebuildComponent = entity->GetComponent<RebuildComponent>();
auto* quickBuildComponent = entity->GetComponent<QuickBuildComponent>();
if (rebuildComponent != nullptr) {
rebuildComponent->SetRepositionPlayer(false);
if (quickBuildComponent != nullptr) {
quickBuildComponent->SetRepositionPlayer(false);
}
EntityManager::Instance()->ConstructEntity(entity);

View File

@ -6,7 +6,7 @@
#include "BehaviorContext.h"
#include "BaseCombatAIComponent.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "DestroyableComponent.h"
#include <vector>

View File

@ -20,7 +20,7 @@
#include <vector>
#include "SkillComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "DestroyableComponent.h"
#include "Metrics.hpp"
#include "CDComponentsRegistryTable.h"
@ -244,7 +244,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
bool hadRemainingDowntime = m_SkillTime > 0.0f;
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
auto* rebuild = m_ParentEntity->GetComponent<RebuildComponent>();
auto* rebuild = m_ParentEntity->GetComponent<QuickBuildComponent>();
if (rebuild != nullptr) {
const auto state = rebuild->GetState();
@ -562,7 +562,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
return false;
}
auto* quickbuild = entity->GetComponent<RebuildComponent>();
auto* quickbuild = entity->GetComponent<QuickBuildComponent>();
if (quickbuild != nullptr) {
const auto state = quickbuild->GetState();

View File

@ -29,7 +29,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"RacingControlComponent.cpp"
"RacingStatsComponent.cpp"
"RailActivatorComponent.cpp"
"RebuildComponent.cpp"
"QuickBuildComponent.cpp"
"RenderComponent.cpp"
"RigidbodyPhantomPhysicsComponent.cpp"
"MultiZoneEntranceComponent.cpp"

View File

@ -12,9 +12,9 @@ Legend
LWOActivityComponent
├── LWOShootingGalleryComponent
├── LWOScriptedActivityComponent
└── LWOBaseRacingControlComponent
├── LWORacingControlComponent
└── LWOGateRushControlComponent
| └── LWOBaseRacingControlComponent
| ├── LWORacingControlComponent
| └── LWOGateRushControlComponent
├── LWOQuickBuildComponent
├── LWOMiniGameControlComponent
LWOBaseCombatAIComponent
@ -32,11 +32,11 @@ LWOBaseRenderComponent
├── LWOSkinnedRenderComponent
LWOBaseVendorComponent
├── LWOVendorComponent
├~~ LWOProximityMonitorComponent
| ├~~ LWOProximityMonitorComponent
├── LWODonationVendorComponent
├~~ LWOProximityMonitorComponent
| ├~~ LWOProximityMonitorComponent
├── LWOAchievementVendorComponent
├~~ LWOProximityMonitorComponent
| ├~~ LWOProximityMonitorComponent
LWOBBBComponent_Common
├── LWOBBBComponent_Client
LWOBlueprintComponent
@ -51,7 +51,7 @@ LWOCharacterComponent
├~~ LWOPetCreatorComponent
├~~ LWOLevelProgressionComponent
├~~ LWOPlayerForcedMovementComponent
├~? LWOPathfindingControlComponent
| ├~? LWOPathfindingControlComponent
LWOChestComponent
LWOChoiceBuildComponent
LWOCollectibleComponent
@ -68,7 +68,7 @@ LWOGhostComponent
LWOHFLightDirectionGadgetComponent
LWOInventoryComponent_Common
├── LWOInventoryComponent_Client
└── LWOInventoryComponent_EquippedItem
| └── LWOInventoryComponent_EquippedItem
LWOItemComponent
LWOLUPExhibitComponent
LWOMissionOfferComponent
@ -91,7 +91,7 @@ LWOPetComponent
├~~ LWOPathfindingControlComponent
├~? LWOItemComponent
├~? LWOModelBehaviorComponent
├~~ ...
| ├~~ ...
LWOPlatformBoundaryComponent
LWOPlatformComponent
├-> LWOMoverPlatformSubComponent

View File

@ -11,7 +11,7 @@
#include "CDClientManager.h"
#include "CDDestructibleComponentTable.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "CppScripts.h"
#include "Loot.h"
#include "Character.h"
@ -82,11 +82,11 @@ void DestroyableComponent::Reinitialize(LOT templateID) {
int32_t buffComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::BUFF);
int32_t collectibleComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::COLLECTIBLE);
int32_t rebuildComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::QUICK_BUILD);
int32_t quickBuildComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::QUICK_BUILD);
int32_t componentID = 0;
if (collectibleComponentID > 0) componentID = collectibleComponentID;
if (rebuildComponentID > 0) componentID = rebuildComponentID;
if (quickBuildComponentID > 0) componentID = quickBuildComponentID;
if (buffComponentID > 0) componentID = buffComponentID;
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
@ -499,7 +499,7 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor
return false;
}
auto* targetQuickbuild = targetEntity->GetComponent<RebuildComponent>();
auto* targetQuickbuild = targetEntity->GetComponent<QuickBuildComponent>();
if (targetQuickbuild != nullptr) {
const auto state = targetQuickbuild->GetState();

View File

@ -1,4 +1,4 @@
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "Entity.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
@ -24,7 +24,7 @@
#include "CppScripts.h"
RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
QuickBuildComponent::QuickBuildComponent(Entity* entity) : Component(entity) {
std::u16string checkPreconditions = entity->GetVar<std::u16string>(u"CheckPrecondition");
if (!checkPreconditions.empty()) {
@ -39,14 +39,14 @@ RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
GeneralUtils::TryParse(positionAsVector[1], m_ActivatorPosition.y) &&
GeneralUtils::TryParse(positionAsVector[2], m_ActivatorPosition.z)) {
} else {
Game::logger->Log("RebuildComponent", "Failed to find activator position for lot %i. Defaulting to parents position.", m_ParentEntity->GetLOT());
Game::logger->Log("QuickBuildComponent", "Failed to find activator position for lot %i. Defaulting to parents position.", m_ParentEntity->GetLOT());
m_ActivatorPosition = m_ParentEntity->GetPosition();
}
SpawnActivator();
}
RebuildComponent::~RebuildComponent() {
QuickBuildComponent::~QuickBuildComponent() {
delete m_Precondition;
Entity* builder = GetBuilder();
@ -57,7 +57,7 @@ RebuildComponent::~RebuildComponent() {
DespawnActivator();
}
void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
void QuickBuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
if (!m_ParentEntity->GetComponent<DestroyableComponent>()) {
if (bIsInitialUpdate) {
outBitStream->Write(false);
@ -110,7 +110,7 @@ void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitia
m_StateDirty = false;
}
void RebuildComponent::Update(float deltaTime) {
void QuickBuildComponent::Update(float deltaTime) {
m_Activator = GetActivator();
// Serialize the quickbuild every so often, fixes the odd bug where the quickbuild is not buildable
@ -242,7 +242,7 @@ void RebuildComponent::Update(float deltaTime) {
}
}
void RebuildComponent::OnUse(Entity* originator) {
void QuickBuildComponent::OnUse(Entity* originator) {
if (GetBuilder() != nullptr || m_State == eRebuildState::COMPLETED) {
return;
}
@ -254,7 +254,7 @@ void RebuildComponent::OnUse(Entity* originator) {
StartRebuild(originator);
}
void RebuildComponent::SpawnActivator() {
void QuickBuildComponent::SpawnActivator() {
if (!m_SelfActivator || m_ActivatorPosition != NiPoint3::ZERO) {
if (!m_Activator) {
EntityInfo info;
@ -274,7 +274,7 @@ void RebuildComponent::SpawnActivator() {
}
}
void RebuildComponent::DespawnActivator() {
void QuickBuildComponent::DespawnActivator() {
if (m_Activator) {
EntityManager::Instance()->DestructEntity(m_Activator);
@ -286,73 +286,73 @@ void RebuildComponent::DespawnActivator() {
}
}
Entity* RebuildComponent::GetActivator() {
Entity* QuickBuildComponent::GetActivator() {
return EntityManager::Instance()->GetEntity(m_ActivatorId);
}
NiPoint3 RebuildComponent::GetActivatorPosition() {
NiPoint3 QuickBuildComponent::GetActivatorPosition() {
return m_ActivatorPosition;
}
float RebuildComponent::GetResetTime() {
float QuickBuildComponent::GetResetTime() {
return m_ResetTime;
}
float RebuildComponent::GetCompleteTime() {
float QuickBuildComponent::GetCompleteTime() {
return m_CompleteTime;
}
int RebuildComponent::GetTakeImagination() {
int QuickBuildComponent::GetTakeImagination() {
return m_TakeImagination;
}
bool RebuildComponent::GetInterruptible() {
bool QuickBuildComponent::GetInterruptible() {
return m_Interruptible;
}
bool RebuildComponent::GetSelfActivator() {
bool QuickBuildComponent::GetSelfActivator() {
return m_SelfActivator;
}
std::vector<int> RebuildComponent::GetCustomModules() {
std::vector<int> QuickBuildComponent::GetCustomModules() {
return m_CustomModules;
}
int RebuildComponent::GetActivityId() {
int QuickBuildComponent::GetActivityId() {
return m_ActivityId;
}
int RebuildComponent::GetPostImaginationCost() {
int QuickBuildComponent::GetPostImaginationCost() {
return m_PostImaginationCost;
}
float RebuildComponent::GetTimeBeforeSmash() {
float QuickBuildComponent::GetTimeBeforeSmash() {
return m_TimeBeforeSmash;
}
eRebuildState RebuildComponent::GetState() {
eRebuildState QuickBuildComponent::GetState() {
return m_State;
}
Entity* RebuildComponent::GetBuilder() const {
Entity* QuickBuildComponent::GetBuilder() const {
auto* builder = EntityManager::Instance()->GetEntity(m_Builder);
return builder;
}
bool RebuildComponent::GetRepositionPlayer() const {
bool QuickBuildComponent::GetRepositionPlayer() const {
return m_RepositionPlayer;
}
void RebuildComponent::SetActivatorPosition(NiPoint3 value) {
void QuickBuildComponent::SetActivatorPosition(NiPoint3 value) {
m_ActivatorPosition = value;
}
void RebuildComponent::SetResetTime(float value) {
void QuickBuildComponent::SetResetTime(float value) {
m_ResetTime = value;
}
void RebuildComponent::SetCompleteTime(float value) {
void QuickBuildComponent::SetCompleteTime(float value) {
if (value < 0) {
m_CompleteTime = 4.5f;
} else {
@ -360,31 +360,31 @@ void RebuildComponent::SetCompleteTime(float value) {
}
}
void RebuildComponent::SetTakeImagination(int value) {
void QuickBuildComponent::SetTakeImagination(int value) {
m_TakeImagination = value;
}
void RebuildComponent::SetInterruptible(bool value) {
void QuickBuildComponent::SetInterruptible(bool value) {
m_Interruptible = value;
}
void RebuildComponent::SetSelfActivator(bool value) {
void QuickBuildComponent::SetSelfActivator(bool value) {
m_SelfActivator = value;
}
void RebuildComponent::SetCustomModules(std::vector<int> value) {
void QuickBuildComponent::SetCustomModules(std::vector<int> value) {
m_CustomModules = value;
}
void RebuildComponent::SetActivityId(int value) {
void QuickBuildComponent::SetActivityId(int value) {
m_ActivityId = value;
}
void RebuildComponent::SetPostImaginationCost(int value) {
void QuickBuildComponent::SetPostImaginationCost(int value) {
m_PostImaginationCost = value;
}
void RebuildComponent::SetTimeBeforeSmash(float value) {
void QuickBuildComponent::SetTimeBeforeSmash(float value) {
if (value < 0) {
m_TimeBeforeSmash = 10.0f;
} else {
@ -392,11 +392,11 @@ void RebuildComponent::SetTimeBeforeSmash(float value) {
}
}
void RebuildComponent::SetRepositionPlayer(bool value) {
void QuickBuildComponent::SetRepositionPlayer(bool value) {
m_RepositionPlayer = value;
}
void RebuildComponent::StartRebuild(Entity* user) {
void QuickBuildComponent::StartRebuild(Entity* user) {
if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) {
m_Builder = user->GetObjectID();
@ -429,7 +429,7 @@ void RebuildComponent::StartRebuild(Entity* user) {
}
}
void RebuildComponent::CompleteRebuild(Entity* user) {
void QuickBuildComponent::CompleteRebuild(Entity* user) {
if (user == nullptr) {
return;
}
@ -439,7 +439,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
characterComponent->SetCurrentActivity(eGameActivity::NONE);
characterComponent->TrackRebuildComplete();
} else {
Game::logger->Log("RebuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow.");
Game::logger->Log("QuickBuildComponent", "Some user tried to finish the rebuild but they didn't have a character somehow.");
return;
}
@ -521,7 +521,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
RenderComponent::PlayAnimation(user, u"rebuild-celebrate", 1.09f);
}
void RebuildComponent::ResetRebuild(bool failed) {
void QuickBuildComponent::ResetRebuild(bool failed) {
Entity* builder = GetBuilder();
if (m_State == eRebuildState::BUILDING && builder) {
@ -556,7 +556,7 @@ void RebuildComponent::ResetRebuild(bool failed) {
}
}
void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failReason, bool skipChecks) {
void QuickBuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failReason, bool skipChecks) {
if (m_State != eRebuildState::COMPLETED || skipChecks) {
m_Builder = LWOOBJID_EMPTY;
@ -595,10 +595,10 @@ void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failR
}
}
void RebuildComponent::AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) {
void QuickBuildComponent::AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) {
m_RebuildCompleteCallbacks.push_back(callback);
}
void RebuildComponent::AddRebuildStateCallback(const std::function<void(eRebuildState state)>& callback) {
void QuickBuildComponent::AddRebuildStateCallback(const std::function<void(eRebuildState state)>& callback) {
m_RebuildStateCallbacks.push_back(callback);
}

View File

@ -1,5 +1,5 @@
#ifndef REBUILDCOMPONENT_H
#define REBUILDCOMPONENT_H
#ifndef __QUICKBUILDCOMPONENT__H__
#define __QUICKBUILDCOMPONENT__H__
#include <BitStream.h>
#include <vector>
@ -20,12 +20,12 @@ enum class eQuickBuildFailReason : uint32_t;
* consists of an activator that shows a popup and then the actual entity that the bricks are built into. Note
* that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent.
*/
class RebuildComponent : public Component {
class QuickBuildComponent : public Component {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
RebuildComponent(Entity* entity);
~RebuildComponent() override;
QuickBuildComponent(Entity* entity);
~QuickBuildComponent() override;
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
void Update(float deltaTime) override;
@ -362,4 +362,4 @@ private:
void CompleteRebuild(Entity* user);
};
#endif // REBUILDCOMPONENT_H
#endif //!__QUICKBUILDCOMPONENT__H__

View File

@ -4,7 +4,7 @@
#include "CDRailActivatorComponent.h"
#include "Entity.h"
#include "GameMessages.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "RenderComponent.h"
@ -43,13 +43,13 @@ RailActivatorComponent::RailActivatorComponent(Entity* parent, int32_t component
RailActivatorComponent::~RailActivatorComponent() = default;
void RailActivatorComponent::OnUse(Entity* originator) {
auto* rebuildComponent = m_ParentEntity->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED)
auto* quickBuildComponent = m_ParentEntity->GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() != eRebuildState::COMPLETED)
return;
if (rebuildComponent != nullptr) {
if (quickBuildComponent != nullptr) {
// Don't want it to be destroyed while a player is using it
rebuildComponent->SetResetTime(rebuildComponent->GetResetTime() + 10.0f);
quickBuildComponent->SetResetTime(quickBuildComponent->GetResetTime() + 10.0f);
}
m_EntitiesOnRail.push_back(originator->GetObjectID());
@ -59,7 +59,7 @@ void RailActivatorComponent::OnUse(Entity* originator) {
GameMessages::SendPlayFXEffect(originator->GetObjectID(), m_StartEffect.first, m_StartEffect.second,
std::to_string(m_StartEffect.first));
}
float animationLength = 0.5f;
if (!m_StartAnimation.empty()) {
animationLength = RenderComponent::PlayAnimation(originator, m_StartAnimation);
@ -116,11 +116,11 @@ void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
true, true, true, true, true, true, true
);
auto* rebuildComponent = m_ParentEntity->GetComponent<RebuildComponent>();
auto* quickBuildComponent = m_ParentEntity->GetComponent<QuickBuildComponent>();
if (rebuildComponent != nullptr) {
if (quickBuildComponent != nullptr) {
// Set back reset time
rebuildComponent->SetResetTime(rebuildComponent->GetResetTime() - 10.0f);
quickBuildComponent->SetResetTime(quickBuildComponent->GetResetTime() - 10.0f);
}
if (std::find(m_EntitiesOnRail.begin(), m_EntitiesOnRail.end(), originator->GetObjectID()) != m_EntitiesOnRail.end()) {

View File

@ -10,7 +10,7 @@ SwitchComponent::SwitchComponent(Entity* parent) : Component(parent) {
m_ResetTime = m_ParentEntity->GetVarAs<int32_t>(u"switch_reset_time");
m_Rebuild = m_ParentEntity->GetComponent<RebuildComponent>();
m_Rebuild = m_ParentEntity->GetComponent<QuickBuildComponent>();
}
SwitchComponent::~SwitchComponent() {

View File

@ -5,7 +5,7 @@
#include "Entity.h"
#include "GameMessages.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "BouncerComponent.h"
#include <algorithm>
#include "Component.h"
@ -75,7 +75,7 @@ private:
/**
* Attached rebuild component.
*/
RebuildComponent* m_Rebuild;
QuickBuildComponent* m_Rebuild;
/**
* If the switch is on or off.

View File

@ -10,7 +10,7 @@
#include "MissionComponent.h"
#include "PhantomPhysicsComponent.h"
#include "Player.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "SkillComponent.h"
#include "eEndBehavior.h"
@ -205,12 +205,12 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
}
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
auto* rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
if (!rebuildComponent) {
auto* quickBuildComponent = targetEntity->GetComponent<QuickBuildComponent>();
if (!quickBuildComponent) {
Game::logger->LogDebug("TriggerComponent::HandleResetRebuild", "Rebuild component not found!");
return;
}
rebuildComponent->ResetRebuild(args == "1");
quickBuildComponent->ResetRebuild(args == "1");
}
void TriggerComponent::HandleMoveObject(Entity* targetEntity, std::vector<std::string> argArray){

View File

@ -61,7 +61,7 @@
#include "MissionComponent.h"
#include "DestroyableComponent.h"
#include "ScriptComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "VendorComponent.h"
#include "InventoryComponent.h"
#include "RocketLaunchpadControlComponent.h"
@ -5030,7 +5030,7 @@ void GameMessages::HandleRebuildCancel(RakNet::BitStream* inStream, Entity* enti
inStream->Read(bEarlyRelease);
inStream->Read(userID);
auto* rebComp = entity->GetComponent<RebuildComponent>();
auto* rebComp = entity->GetComponent<QuickBuildComponent>();
if (!rebComp) return;
rebComp->CancelRebuild(EntityManager::Instance()->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY);

View File

@ -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,9 +10,9 @@ 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) {
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() != eRebuildState::COMPLETED) {
return;
}
@ -70,13 +70,13 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
}
void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent == nullptr) {
if (quickBuildComponent == nullptr) {
return;
}
if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) {
if (timerName == "reset" && quickBuildComponent->GetState() == eRebuildState::OPEN) {
self->Smash(self->GetObjectID(), eKillType::SILENT);
}
}

View File

@ -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) {
@ -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() != eRebuildState::COMPLETED) {
return;
}

View File

@ -1,5 +1,5 @@
#include "ImgBrickConsoleQB.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "GameMessages.h"
@ -19,18 +19,18 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) {
}
void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
if (!self->GetNetworkVar<bool>(u"used")) {
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
auto bothBuilt = false;
for (auto* console : consoles) {
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
if (consoleQuickBuildComponent->GetState() != eRebuildState::COMPLETED) {
continue;
}
@ -145,9 +145,9 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console");
for (auto* console : consoles) {
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
if (consoleQuickBuildComponent->GetState() != eRebuildState::COMPLETED) {
continue;
}
@ -166,9 +166,9 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
self->SetVar(u"Died", true);
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
auto offFX = 0;
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
@ -227,9 +227,9 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "reset") {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::OPEN) {
if (quickBuildComponent->GetState() == eRebuildState::OPEN) {
self->Smash(self->GetObjectID(), eKillType::SILENT);
}
} else if (timerName == "Die") {

View File

@ -1,13 +1,13 @@
#include "NjRailActivatorsServer.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "Character.h"
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
// Only allow use if this is not a quick build or the quick build is built
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
auto* character = user->GetCharacter();
if (character != nullptr) {
character->SetPlayerFlag(flag, true);

View File

@ -1,10 +1,10 @@
#include "NjRailPostServer.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "EntityManager.h"
void NjRailPostServer::OnStartup(Entity* self) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr) {
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr) {
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
}
}

View File

@ -1,5 +1,5 @@
#include "PropertyPlatform.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "GameMessages.h"
#include "MovingPlatformComponent.h"
@ -14,8 +14,8 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
// if (movingPlatform != nullptr) {
// movingPlatform->GotoWaypoint(1);

View File

@ -3,7 +3,7 @@
#include "GameMessages.h"
#include "Character.h"
#include "MissionComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "eTerminateType.h"
#include "ePlayerFlag.h"
@ -12,13 +12,13 @@ void NsTokenConsoleServer::OnStartup(Entity* self) {
}
void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent == nullptr) {
if (quickBuildComponent == nullptr) {
return;
}
if (rebuildComponent->GetState() != eRebuildState::COMPLETED) {
if (quickBuildComponent->GetState() != eRebuildState::COMPLETED) {
return;
}

View File

@ -1,6 +1,6 @@
#include "CavePrisonCage.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "GameMessages.h"
#include "Character.h"
#include "dZoneManager.h"
@ -68,14 +68,14 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
self->SetVar<LWOOBJID>(u"Counterweight", counterweight->GetObjectID());
auto* rebuildComponent = counterweight->GetComponent<RebuildComponent>();
auto* quickBuildComponent = counterweight->GetComponent<QuickBuildComponent>();
if (rebuildComponent != nullptr) {
rebuildComponent->AddRebuildStateCallback([this, self](eRebuildState state) {
if (quickBuildComponent != nullptr) {
quickBuildComponent->AddRebuildStateCallback([this, self](eRebuildState state) {
OnRebuildNotifyState(self, state);
});
rebuildComponent->AddRebuildCompleteCallback([this, self](Entity* user) {
quickBuildComponent->AddRebuildCompleteCallback([this, self](Entity* user) {
// The counterweight is a simple mover, which is not implemented, so we'll just set it's position
auto* counterweight = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));

View File

@ -1,15 +1,15 @@
#include "ImaginationShrineServer.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
// If the rebuild component is complete, use the shrine
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent == nullptr) {
if (quickBuildComponent == nullptr) {
return;
}
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
// Use the shrine
BaseUse(self, user);
}

View File

@ -1,5 +1,5 @@
#include "NjMonastryBossInstance.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "dZoneManager.h"
@ -221,9 +221,9 @@ void NjMonastryBossInstance::HandleLedgedFrakjawSpawned(Entity* self, Entity* le
}
void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* counterWeight) {
auto* rebuildComponent = counterWeight->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr) {
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
auto* quickBuildComponent = counterWeight->GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr) {
quickBuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
switch (state) {
case eRebuildState::BUILDING:

View File

@ -1,7 +1,7 @@
#include "ActMine.h"
#include "SkillComponent.h"
#include "DestroyableComponent.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
void ActMine::OnStartup(Entity* self) {
self->SetVar(u"RebuildComplete", false);
@ -10,7 +10,7 @@ void ActMine::OnStartup(Entity* self) {
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state == eRebuildState::COMPLETED) {
auto* rebuild = self->GetComponent<RebuildComponent>();
auto* rebuild = self->GetComponent<QuickBuildComponent>();
if (rebuild) {
auto* builder = rebuild->GetBuilder();
self->SetVar(u"Builder", builder->GetObjectID());

View File

@ -1,6 +1,6 @@
#include "ActParadoxPipeFix.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "GameMessages.h"
#include "MissionComponent.h"
#include "eEndBehavior.h"
@ -19,9 +19,9 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
continue;
}
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
auto* quickBuildComponent = object->GetComponent<QuickBuildComponent>();
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
if (quickBuildComponent->GetState() == eRebuildState::COMPLETED) {
indexCount++;
}
}

View File

@ -2,7 +2,7 @@
#include "GeneralUtils.h"
#include "dZoneManager.h"
#include "Spawner.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
void FvBrickPuzzleServer::OnStartup(Entity* self) {
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
@ -59,9 +59,9 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
if (timerName == "reset") {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::OPEN) {
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eRebuildState::OPEN) {
self->Smash(self->GetObjectID(), eKillType::SILENT);
}
}

View File

@ -3,7 +3,7 @@
#include "Item.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "RebuildComponent.h"
#include "QuickBuildComponent.h"
#include "SoundTriggerComponent.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
@ -93,9 +93,9 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
}
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr)
rebuildComponent->ResetRebuild(false);
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
if (quickBuildComponent != nullptr)
quickBuildComponent->ResetRebuild(false);
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);