mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
chore: rename rebuild to quickbuild (#1364)
* rename rebuild to quickbuild * fix includes
This commit is contained in:
parent
fddf99946f
commit
15954413ae
15
dCommon/dEnums/eQuickBuildState.h
Normal file
15
dCommon/dEnums/eQuickBuildState.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef __EQUICKBUILDSTATE__H__
|
||||||
|
#define __EQUICKBUILDSTATE__H__
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
enum class eQuickBuildState : uint32_t {
|
||||||
|
OPEN,
|
||||||
|
COMPLETED = 2,
|
||||||
|
RESETTING = 4,
|
||||||
|
BUILDING,
|
||||||
|
INCOMPLETE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //!__EQUICKBUILDSTATE__H__
|
@ -1,15 +0,0 @@
|
|||||||
#ifndef __EREBUILDSTATE__H__
|
|
||||||
#define __EREBUILDSTATE__H__
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
enum class eRebuildState : uint32_t {
|
|
||||||
OPEN,
|
|
||||||
COMPLETED = 2,
|
|
||||||
RESETTING = 4,
|
|
||||||
BUILDING,
|
|
||||||
INCOMPLETE
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //!__EREBUILDSTATE__H__
|
|
@ -47,7 +47,7 @@
|
|||||||
#include "MovingPlatformComponent.h"
|
#include "MovingPlatformComponent.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "MissionOfferComponent.h"
|
#include "MissionOfferComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "BuildBorderComponent.h"
|
#include "BuildBorderComponent.h"
|
||||||
#include "MovementAIComponent.h"
|
#include "MovementAIComponent.h"
|
||||||
#include "VendorComponent.h"
|
#include "VendorComponent.h"
|
||||||
@ -327,11 +327,11 @@ void Entity::Initialize() {
|
|||||||
* Multiple components require the destructible component.
|
* Multiple components require the destructible component.
|
||||||
*/
|
*/
|
||||||
int buffComponentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::BUFF);
|
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 = -1;
|
int componentID = -1;
|
||||||
if (collectibleComponentID > 0) componentID = collectibleComponentID;
|
if (collectibleComponentID > 0) componentID = collectibleComponentID;
|
||||||
if (rebuildComponentID > 0) componentID = rebuildComponentID;
|
if (quickBuildComponentID > 0) componentID = quickBuildComponentID;
|
||||||
if (buffComponentID > 0) componentID = buffComponentID;
|
if (buffComponentID > 0) componentID = buffComponentID;
|
||||||
|
|
||||||
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
|
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
|
||||||
@ -521,50 +521,50 @@ void Entity::Initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (int componentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::QUICK_BUILD) > 0) {
|
if (int componentID = compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::QUICK_BUILD) > 0) {
|
||||||
auto* rebuildComponent = AddComponent<RebuildComponent>();
|
auto* quickBuildComponent = AddComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
CDRebuildComponentTable* rebCompTable = CDClientManager::Instance().GetTable<CDRebuildComponentTable>();
|
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) {
|
if (rebCompData.size() > 0) {
|
||||||
rebuildComponent->SetResetTime(rebCompData[0].reset_time);
|
quickBuildComponent->SetResetTime(rebCompData[0].reset_time);
|
||||||
rebuildComponent->SetCompleteTime(rebCompData[0].complete_time);
|
quickBuildComponent->SetCompleteTime(rebCompData[0].complete_time);
|
||||||
rebuildComponent->SetTakeImagination(rebCompData[0].take_imagination);
|
quickBuildComponent->SetTakeImagination(rebCompData[0].take_imagination);
|
||||||
rebuildComponent->SetInterruptible(rebCompData[0].interruptible);
|
quickBuildComponent->SetInterruptible(rebCompData[0].interruptible);
|
||||||
rebuildComponent->SetSelfActivator(rebCompData[0].self_activator);
|
quickBuildComponent->SetSelfActivator(rebCompData[0].self_activator);
|
||||||
rebuildComponent->SetActivityId(rebCompData[0].activityID);
|
quickBuildComponent->SetActivityId(rebCompData[0].activityID);
|
||||||
rebuildComponent->SetPostImaginationCost(rebCompData[0].post_imagination_cost);
|
quickBuildComponent->SetPostImaginationCost(rebCompData[0].post_imagination_cost);
|
||||||
rebuildComponent->SetTimeBeforeSmash(rebCompData[0].time_before_smash);
|
quickBuildComponent->SetTimeBeforeSmash(rebCompData[0].time_before_smash);
|
||||||
|
|
||||||
const auto rebuildResetTime = GetVar<float>(u"rebuild_reset_time");
|
const auto rebuildResetTime = GetVar<float>(u"rebuild_reset_time");
|
||||||
|
|
||||||
if (rebuildResetTime != 0.0f) {
|
if (rebuildResetTime != 0.0f) {
|
||||||
rebuildComponent->SetResetTime(rebuildResetTime);
|
quickBuildComponent->SetResetTime(rebuildResetTime);
|
||||||
|
|
||||||
// Known bug with moving platform in FV that casues it to build at the end instead of the start.
|
// Known bug with moving platform in FV that casues it to build at the end instead of the start.
|
||||||
// This extends the smash time so players can ride up the lift.
|
// This extends the smash time so players can ride up the lift.
|
||||||
if (m_TemplateID == 9483) {
|
if (m_TemplateID == 9483) {
|
||||||
rebuildComponent->SetResetTime(rebuildComponent->GetResetTime() + 25);
|
quickBuildComponent->SetResetTime(quickBuildComponent->GetResetTime() + 25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto activityID = GetVar<int32_t>(u"activityID");
|
const auto activityID = GetVar<int32_t>(u"activityID");
|
||||||
|
|
||||||
if (activityID > 0) {
|
if (activityID > 0) {
|
||||||
rebuildComponent->SetActivityId(activityID);
|
quickBuildComponent->SetActivityId(activityID);
|
||||||
Loot::CacheMatrix(activityID);
|
Loot::CacheMatrix(activityID);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto timeBeforeSmash = GetVar<float>(u"tmeSmsh");
|
const auto timeBeforeSmash = GetVar<float>(u"tmeSmsh");
|
||||||
|
|
||||||
if (timeBeforeSmash > 0) {
|
if (timeBeforeSmash > 0) {
|
||||||
rebuildComponent->SetTimeBeforeSmash(timeBeforeSmash);
|
quickBuildComponent->SetTimeBeforeSmash(timeBeforeSmash);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto compTime = GetVar<float>(u"compTime");
|
const auto compTime = GetVar<float>(u"compTime");
|
||||||
|
|
||||||
if (compTime > 0) {
|
if (compTime > 0) {
|
||||||
rebuildComponent->SetCompleteTime(compTime);
|
quickBuildComponent->SetCompleteTime(compTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1125,14 +1125,14 @@ void Entity::WriteComponents(RakNet::BitStream* outBitStream, eReplicaPacketType
|
|||||||
baseCombatAiComponent->Serialize(outBitStream, bIsInitialUpdate);
|
baseCombatAiComponent->Serialize(outBitStream, bIsInitialUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
RebuildComponent* rebuildComponent;
|
QuickBuildComponent* quickBuildComponent;
|
||||||
if (TryGetComponent(eReplicaComponentType::QUICK_BUILD, rebuildComponent)) {
|
if (TryGetComponent(eReplicaComponentType::QUICK_BUILD, quickBuildComponent)) {
|
||||||
DestroyableComponent* destroyableComponent;
|
DestroyableComponent* destroyableComponent;
|
||||||
if (TryGetComponent(eReplicaComponentType::DESTROYABLE, destroyableComponent) && !destroyableSerialized) {
|
if (TryGetComponent(eReplicaComponentType::DESTROYABLE, destroyableComponent) && !destroyableSerialized) {
|
||||||
destroyableComponent->Serialize(outBitStream, bIsInitialUpdate);
|
destroyableComponent->Serialize(outBitStream, bIsInitialUpdate);
|
||||||
}
|
}
|
||||||
destroyableSerialized = true;
|
destroyableSerialized = true;
|
||||||
rebuildComponent->Serialize(outBitStream, bIsInitialUpdate);
|
quickBuildComponent->Serialize(outBitStream, bIsInitialUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
MovingPlatformComponent* movingPlatformComponent;
|
MovingPlatformComponent* movingPlatformComponent;
|
||||||
@ -1588,10 +1588,10 @@ void Entity::AddCollisionPhantomCallback(const std::function<void(Entity* target
|
|||||||
m_PhantomCollisionCallbacks.push_back(callback);
|
m_PhantomCollisionCallbacks.push_back(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Entity::AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const {
|
void Entity::AddQuickBuildCompleteCallback(const std::function<void(Entity* user)>& callback) const {
|
||||||
auto* rebuildComponent = GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = GetComponent<QuickBuildComponent>();
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
rebuildComponent->AddRebuildCompleteCallback(callback);
|
quickBuildComponent->AddQuickBuildCompleteCallback(callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ public:
|
|||||||
|
|
||||||
void Smash(const LWOOBJID source = LWOOBJID_EMPTY, const eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"");
|
void Smash(const LWOOBJID source = LWOOBJID_EMPTY, const eKillType killType = eKillType::VIOLENT, const std::u16string& deathType = u"");
|
||||||
void Kill(Entity* murderer = nullptr, const eKillType killType = eKillType::SILENT);
|
void Kill(Entity* murderer = nullptr, const eKillType killType = eKillType::SILENT);
|
||||||
void AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) const;
|
void AddQuickBuildCompleteCallback(const std::function<void(Entity* user)>& callback) const;
|
||||||
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback);
|
void AddCollisionPhantomCallback(const std::function<void(Entity* target)>& callback);
|
||||||
void AddDieCallback(const std::function<void()>& callback);
|
void AddDieCallback(const std::function<void()>& callback);
|
||||||
void Resurrect();
|
void Resurrect();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "BehaviorBranchContext.h"
|
#include "BehaviorBranchContext.h"
|
||||||
#include "BehaviorContext.h"
|
#include "BehaviorContext.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "EchoSyncSkill.h"
|
#include "EchoSyncSkill.h"
|
||||||
#include "PhantomPhysicsComponent.h"
|
#include "PhantomPhysicsComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
#include "TeamManager.h"
|
#include "TeamManager.h"
|
||||||
#include "eConnectionType.h"
|
#include "eConnectionType.h"
|
||||||
@ -412,8 +412,8 @@ bool BehaviorContext::CheckTargetingRequirements(const Entity* target) const {
|
|||||||
if (!target) return false;
|
if (!target) return false;
|
||||||
|
|
||||||
// ignore quickbuilds that aren't completed
|
// ignore quickbuilds that aren't completed
|
||||||
auto* targetQuickbuildComponent = target->GetComponent<RebuildComponent>();
|
auto* targetQuickbuildComponent = target->GetComponent<QuickBuildComponent>();
|
||||||
if (targetQuickbuildComponent && targetQuickbuildComponent->GetState() != eRebuildState::COMPLETED) return false;
|
if (targetQuickbuildComponent && targetQuickbuildComponent->GetState() != eQuickBuildState::COMPLETED) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "EntityInfo.h"
|
#include "EntityInfo.h"
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
@ -53,10 +53,10 @@ void SpawnBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStrea
|
|||||||
entity->SetOwnerOverride(context->originator);
|
entity->SetOwnerOverride(context->originator);
|
||||||
|
|
||||||
// Unset the flag to reposition the player, this makes it harder to glitch out of the map
|
// 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) {
|
if (quickBuildComponent != nullptr) {
|
||||||
rebuildComponent->SetRepositionPlayer(false);
|
quickBuildComponent->SetRepositionPlayer(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Game::entityManager->ConstructEntity(entity);
|
Game::entityManager->ConstructEntity(entity);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "BehaviorContext.h"
|
#include "BehaviorContext.h"
|
||||||
#include "BaseCombatAIComponent.h"
|
#include "BaseCombatAIComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "Metrics.hpp"
|
#include "Metrics.hpp"
|
||||||
#include "CDComponentsRegistryTable.h"
|
#include "CDComponentsRegistryTable.h"
|
||||||
@ -243,12 +243,12 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
|||||||
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
||||||
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
||||||
|
|
||||||
auto* rebuild = m_Parent->GetComponent<RebuildComponent>();
|
auto* rebuild = m_Parent->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuild != nullptr) {
|
if (rebuild != nullptr) {
|
||||||
const auto state = rebuild->GetState();
|
const auto state = rebuild->GetState();
|
||||||
|
|
||||||
if (state != eRebuildState::COMPLETED) {
|
if (state != eQuickBuildState::COMPLETED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -559,12 +559,12 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* quickbuild = entity->GetComponent<RebuildComponent>();
|
auto* quickbuild = entity->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (quickbuild != nullptr) {
|
if (quickbuild != nullptr) {
|
||||||
const auto state = quickbuild->GetState();
|
const auto state = quickbuild->GetState();
|
||||||
|
|
||||||
if (state != eRebuildState::COMPLETED) {
|
if (state != eQuickBuildState::COMPLETED) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ set(DGAME_DCOMPONENTS_SOURCES "ActivityComponent.cpp"
|
|||||||
"ProximityMonitorComponent.cpp"
|
"ProximityMonitorComponent.cpp"
|
||||||
"RacingControlComponent.cpp"
|
"RacingControlComponent.cpp"
|
||||||
"RailActivatorComponent.cpp"
|
"RailActivatorComponent.cpp"
|
||||||
"RebuildComponent.cpp"
|
"QuickBuildComponent.cpp"
|
||||||
"RenderComponent.cpp"
|
"RenderComponent.cpp"
|
||||||
"RigidbodyPhantomPhysicsComponent.cpp"
|
"RigidbodyPhantomPhysicsComponent.cpp"
|
||||||
"MultiZoneEntranceComponent.cpp"
|
"MultiZoneEntranceComponent.cpp"
|
||||||
|
@ -498,7 +498,7 @@ void CharacterComponent::TrackArmorDelta(int32_t armor) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharacterComponent::TrackRebuildComplete() {
|
void CharacterComponent::TrackQuickBuildComplete() {
|
||||||
UpdatePlayerStatistic(QuickBuildsCompleted);
|
UpdatePlayerStatistic(QuickBuildsCompleted);
|
||||||
|
|
||||||
const auto mapID = Game::zoneManager->GetZoneID().GetMapID();
|
const auto mapID = Game::zoneManager->GetZoneID().GetMapID();
|
||||||
|
@ -233,7 +233,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Handles completing a rebuild by updating the statistics
|
* Handles completing a rebuild by updating the statistics
|
||||||
*/
|
*/
|
||||||
void TrackRebuildComplete();
|
void TrackQuickBuildComplete();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracks a player completing the race, also updates stats
|
* Tracks a player completing the race, also updates stats
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "CDClientManager.h"
|
#include "CDClientManager.h"
|
||||||
#include "CDDestructibleComponentTable.h"
|
#include "CDDestructibleComponentTable.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "CppScripts.h"
|
#include "CppScripts.h"
|
||||||
#include "Loot.h"
|
#include "Loot.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
@ -85,11 +85,11 @@ void DestroyableComponent::Reinitialize(LOT templateID) {
|
|||||||
|
|
||||||
int32_t buffComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::BUFF);
|
int32_t buffComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::BUFF);
|
||||||
int32_t collectibleComponentID = compRegistryTable->GetByIDAndType(templateID, eReplicaComponentType::COLLECTIBLE);
|
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;
|
int32_t componentID = 0;
|
||||||
if (collectibleComponentID > 0) componentID = collectibleComponentID;
|
if (collectibleComponentID > 0) componentID = collectibleComponentID;
|
||||||
if (rebuildComponentID > 0) componentID = rebuildComponentID;
|
if (quickBuildComponentID > 0) componentID = quickBuildComponentID;
|
||||||
if (buffComponentID > 0) componentID = buffComponentID;
|
if (buffComponentID > 0) componentID = buffComponentID;
|
||||||
|
|
||||||
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
|
CDDestructibleComponentTable* destCompTable = CDClientManager::Instance().GetTable<CDDestructibleComponentTable>();
|
||||||
|
@ -117,11 +117,11 @@ void MovingPlatformComponent::Serialize(RakNet::BitStream* outBitStream, bool bI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovingPlatformComponent::OnRebuildInitilized() {
|
void MovingPlatformComponent::OnQuickBuildInitilized() {
|
||||||
StopPathing();
|
StopPathing();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovingPlatformComponent::OnCompleteRebuild() {
|
void MovingPlatformComponent::OnCompleteQuickBuild() {
|
||||||
if (m_NoAutoStart)
|
if (m_NoAutoStart)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -116,12 +116,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Stops all pathing, called when an entity starts a quick build associated with this platform
|
* Stops all pathing, called when an entity starts a quick build associated with this platform
|
||||||
*/
|
*/
|
||||||
void OnRebuildInitilized();
|
void OnQuickBuildInitilized();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the pathing, called when an entity completed a quick build associated with this platform
|
* Starts the pathing, called when an entity completed a quick build associated with this platform
|
||||||
*/
|
*/
|
||||||
void OnCompleteRebuild();
|
void OnCompleteQuickBuild();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the movement state for the moving platform
|
* Updates the movement state for the moving platform
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "CppScripts.h"
|
#include "CppScripts.h"
|
||||||
|
|
||||||
RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
|
QuickBuildComponent::QuickBuildComponent(Entity* entity) : Component(entity) {
|
||||||
std::u16string checkPreconditions = entity->GetVar<std::u16string>(u"CheckPrecondition");
|
std::u16string checkPreconditions = entity->GetVar<std::u16string>(u"CheckPrecondition");
|
||||||
|
|
||||||
if (!checkPreconditions.empty()) {
|
if (!checkPreconditions.empty()) {
|
||||||
@ -46,18 +46,18 @@ RebuildComponent::RebuildComponent(Entity* entity) : Component(entity) {
|
|||||||
SpawnActivator();
|
SpawnActivator();
|
||||||
}
|
}
|
||||||
|
|
||||||
RebuildComponent::~RebuildComponent() {
|
QuickBuildComponent::~QuickBuildComponent() {
|
||||||
delete m_Precondition;
|
delete m_Precondition;
|
||||||
|
|
||||||
Entity* builder = GetBuilder();
|
Entity* builder = GetBuilder();
|
||||||
if (builder) {
|
if (builder) {
|
||||||
CancelRebuild(builder, eQuickBuildFailReason::BUILD_ENDED, true);
|
CancelQuickBuild(builder, eQuickBuildFailReason::BUILD_ENDED, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
DespawnActivator();
|
DespawnActivator();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) {
|
void QuickBuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) {
|
||||||
if (m_Parent->GetComponent(eReplicaComponentType::DESTROYABLE) == nullptr) {
|
if (m_Parent->GetComponent(eReplicaComponentType::DESTROYABLE) == nullptr) {
|
||||||
if (bIsInitialUpdate) {
|
if (bIsInitialUpdate) {
|
||||||
outBitStream->Write(false);
|
outBitStream->Write(false);
|
||||||
@ -70,7 +70,7 @@ void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitia
|
|||||||
// If build state is completed and we've already serialized once in the completed state,
|
// If build state is completed and we've already serialized once in the completed state,
|
||||||
// don't serializing this component anymore as this will cause the build to jump again.
|
// don't serializing this component anymore as this will cause the build to jump again.
|
||||||
// If state changes, serialization will begin again.
|
// If state changes, serialization will begin again.
|
||||||
if (!m_StateDirty && m_State == eRebuildState::COMPLETED) {
|
if (!m_StateDirty && m_State == eQuickBuildState::COMPLETED) {
|
||||||
outBitStream->Write0();
|
outBitStream->Write0();
|
||||||
outBitStream->Write0();
|
outBitStream->Write0();
|
||||||
return;
|
return;
|
||||||
@ -110,7 +110,7 @@ void RebuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitia
|
|||||||
m_StateDirty = false;
|
m_StateDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::Update(float deltaTime) {
|
void QuickBuildComponent::Update(float deltaTime) {
|
||||||
m_Activator = GetActivator();
|
m_Activator = GetActivator();
|
||||||
|
|
||||||
// Serialize the quickbuild every so often, fixes the odd bug where the quickbuild is not buildable
|
// Serialize the quickbuild every so often, fixes the odd bug where the quickbuild is not buildable
|
||||||
@ -124,7 +124,7 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
switch (m_State) {
|
switch (m_State) {
|
||||||
case eRebuildState::OPEN: {
|
case eQuickBuildState::OPEN: {
|
||||||
SpawnActivator();
|
SpawnActivator();
|
||||||
m_TimeBeforeDrain = 0;
|
m_TimeBeforeDrain = 0;
|
||||||
|
|
||||||
@ -147,14 +147,14 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
|
|
||||||
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
||||||
|
|
||||||
ResetRebuild(false);
|
ResetQuickBuild(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eRebuildState::COMPLETED: {
|
case eQuickBuildState::COMPLETED: {
|
||||||
m_Timer += deltaTime;
|
m_Timer += deltaTime;
|
||||||
|
|
||||||
// For reset times < 0 this has to be handled manually
|
// For reset times < 0 this has to be handled manually
|
||||||
@ -171,17 +171,17 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
|
|
||||||
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
||||||
|
|
||||||
ResetRebuild(false);
|
ResetQuickBuild(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eRebuildState::BUILDING:
|
case eQuickBuildState::BUILDING:
|
||||||
{
|
{
|
||||||
Entity* builder = GetBuilder();
|
Entity* builder = GetBuilder();
|
||||||
|
|
||||||
if (!builder) {
|
if (!builder) {
|
||||||
ResetRebuild(false);
|
ResetQuickBuild(false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -205,18 +205,18 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
Game::entityManager->SerializeEntity(builder);
|
Game::entityManager->SerializeEntity(builder);
|
||||||
|
|
||||||
if (newImagination <= 0 && imaginationCostRemaining > 0) {
|
if (newImagination <= 0 && imaginationCostRemaining > 0) {
|
||||||
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
|
CancelQuickBuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Timer >= m_CompleteTime && m_DrainedImagination >= m_TakeImagination) {
|
if (m_Timer >= m_CompleteTime && m_DrainedImagination >= m_TakeImagination) {
|
||||||
CompleteRebuild(builder);
|
CompleteQuickBuild(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eRebuildState::INCOMPLETE: {
|
case eQuickBuildState::INCOMPLETE: {
|
||||||
m_TimerIncomplete += deltaTime;
|
m_TimerIncomplete += deltaTime;
|
||||||
|
|
||||||
// For reset times < 0 this has to be handled manually
|
// For reset times < 0 this has to be handled manually
|
||||||
@ -232,17 +232,17 @@ void RebuildComponent::Update(float deltaTime) {
|
|||||||
|
|
||||||
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
GameMessages::SendDieNoImplCode(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
|
||||||
|
|
||||||
ResetRebuild(false);
|
ResetQuickBuild(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eRebuildState::RESETTING: break;
|
case eQuickBuildState::RESETTING: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::OnUse(Entity* originator) {
|
void QuickBuildComponent::OnUse(Entity* originator) {
|
||||||
if (GetBuilder() != nullptr || m_State == eRebuildState::COMPLETED) {
|
if (GetBuilder() != nullptr || m_State == eQuickBuildState::COMPLETED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,10 +250,10 @@ void RebuildComponent::OnUse(Entity* originator) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StartRebuild(originator);
|
StartQuickBuild(originator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SpawnActivator() {
|
void QuickBuildComponent::SpawnActivator() {
|
||||||
if (!m_SelfActivator || m_ActivatorPosition != NiPoint3::ZERO) {
|
if (!m_SelfActivator || m_ActivatorPosition != NiPoint3::ZERO) {
|
||||||
if (!m_Activator) {
|
if (!m_Activator) {
|
||||||
EntityInfo info;
|
EntityInfo info;
|
||||||
@ -273,7 +273,7 @@ void RebuildComponent::SpawnActivator() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::DespawnActivator() {
|
void QuickBuildComponent::DespawnActivator() {
|
||||||
if (m_Activator) {
|
if (m_Activator) {
|
||||||
Game::entityManager->DestructEntity(m_Activator);
|
Game::entityManager->DestructEntity(m_Activator);
|
||||||
|
|
||||||
@ -285,73 +285,73 @@ void RebuildComponent::DespawnActivator() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity* RebuildComponent::GetActivator() {
|
Entity* QuickBuildComponent::GetActivator() {
|
||||||
return Game::entityManager->GetEntity(m_ActivatorId);
|
return Game::entityManager->GetEntity(m_ActivatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
NiPoint3 RebuildComponent::GetActivatorPosition() {
|
NiPoint3 QuickBuildComponent::GetActivatorPosition() {
|
||||||
return m_ActivatorPosition;
|
return m_ActivatorPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RebuildComponent::GetResetTime() {
|
float QuickBuildComponent::GetResetTime() {
|
||||||
return m_ResetTime;
|
return m_ResetTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RebuildComponent::GetCompleteTime() {
|
float QuickBuildComponent::GetCompleteTime() {
|
||||||
return m_CompleteTime;
|
return m_CompleteTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RebuildComponent::GetTakeImagination() {
|
int QuickBuildComponent::GetTakeImagination() {
|
||||||
return m_TakeImagination;
|
return m_TakeImagination;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RebuildComponent::GetInterruptible() {
|
bool QuickBuildComponent::GetInterruptible() {
|
||||||
return m_Interruptible;
|
return m_Interruptible;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RebuildComponent::GetSelfActivator() {
|
bool QuickBuildComponent::GetSelfActivator() {
|
||||||
return m_SelfActivator;
|
return m_SelfActivator;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int> RebuildComponent::GetCustomModules() {
|
std::vector<int> QuickBuildComponent::GetCustomModules() {
|
||||||
return m_CustomModules;
|
return m_CustomModules;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RebuildComponent::GetActivityId() {
|
int QuickBuildComponent::GetActivityId() {
|
||||||
return m_ActivityId;
|
return m_ActivityId;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RebuildComponent::GetPostImaginationCost() {
|
int QuickBuildComponent::GetPostImaginationCost() {
|
||||||
return m_PostImaginationCost;
|
return m_PostImaginationCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
float RebuildComponent::GetTimeBeforeSmash() {
|
float QuickBuildComponent::GetTimeBeforeSmash() {
|
||||||
return m_TimeBeforeSmash;
|
return m_TimeBeforeSmash;
|
||||||
}
|
}
|
||||||
|
|
||||||
eRebuildState RebuildComponent::GetState() {
|
eQuickBuildState QuickBuildComponent::GetState() {
|
||||||
return m_State;
|
return m_State;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity* RebuildComponent::GetBuilder() const {
|
Entity* QuickBuildComponent::GetBuilder() const {
|
||||||
auto* builder = Game::entityManager->GetEntity(m_Builder);
|
auto* builder = Game::entityManager->GetEntity(m_Builder);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RebuildComponent::GetRepositionPlayer() const {
|
bool QuickBuildComponent::GetRepositionPlayer() const {
|
||||||
return m_RepositionPlayer;
|
return m_RepositionPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetActivatorPosition(NiPoint3 value) {
|
void QuickBuildComponent::SetActivatorPosition(NiPoint3 value) {
|
||||||
m_ActivatorPosition = value;
|
m_ActivatorPosition = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetResetTime(float value) {
|
void QuickBuildComponent::SetResetTime(float value) {
|
||||||
m_ResetTime = value;
|
m_ResetTime = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetCompleteTime(float value) {
|
void QuickBuildComponent::SetCompleteTime(float value) {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
m_CompleteTime = 4.5f;
|
m_CompleteTime = 4.5f;
|
||||||
} else {
|
} else {
|
||||||
@ -359,31 +359,31 @@ void RebuildComponent::SetCompleteTime(float value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetTakeImagination(int value) {
|
void QuickBuildComponent::SetTakeImagination(int value) {
|
||||||
m_TakeImagination = value;
|
m_TakeImagination = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetInterruptible(bool value) {
|
void QuickBuildComponent::SetInterruptible(bool value) {
|
||||||
m_Interruptible = value;
|
m_Interruptible = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetSelfActivator(bool value) {
|
void QuickBuildComponent::SetSelfActivator(bool value) {
|
||||||
m_SelfActivator = value;
|
m_SelfActivator = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetCustomModules(std::vector<int> value) {
|
void QuickBuildComponent::SetCustomModules(std::vector<int> value) {
|
||||||
m_CustomModules = value;
|
m_CustomModules = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetActivityId(int value) {
|
void QuickBuildComponent::SetActivityId(int value) {
|
||||||
m_ActivityId = value;
|
m_ActivityId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetPostImaginationCost(int value) {
|
void QuickBuildComponent::SetPostImaginationCost(int value) {
|
||||||
m_PostImaginationCost = value;
|
m_PostImaginationCost = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetTimeBeforeSmash(float value) {
|
void QuickBuildComponent::SetTimeBeforeSmash(float value) {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
m_TimeBeforeSmash = 10.0f;
|
m_TimeBeforeSmash = 10.0f;
|
||||||
} else {
|
} else {
|
||||||
@ -391,12 +391,12 @@ void RebuildComponent::SetTimeBeforeSmash(float value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::SetRepositionPlayer(bool value) {
|
void QuickBuildComponent::SetRepositionPlayer(bool value) {
|
||||||
m_RepositionPlayer = value;
|
m_RepositionPlayer = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::StartRebuild(Entity* user) {
|
void QuickBuildComponent::StartQuickBuild(Entity* user) {
|
||||||
if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) {
|
if (m_State == eQuickBuildState::OPEN || m_State == eQuickBuildState::COMPLETED || m_State == eQuickBuildState::INCOMPLETE) {
|
||||||
m_Builder = user->GetObjectID();
|
m_Builder = user->GetObjectID();
|
||||||
|
|
||||||
auto* character = user->GetComponent<CharacterComponent>();
|
auto* character = user->GetComponent<CharacterComponent>();
|
||||||
@ -404,31 +404,31 @@ void RebuildComponent::StartRebuild(Entity* user) {
|
|||||||
|
|
||||||
Game::entityManager->SerializeEntity(user);
|
Game::entityManager->SerializeEntity(user);
|
||||||
|
|
||||||
GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::BUILDING, user->GetObjectID());
|
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::BUILDING, user->GetObjectID());
|
||||||
GameMessages::SendEnableRebuild(m_Parent, true, false, false, eQuickBuildFailReason::NOT_GIVEN, 0.0f, user->GetObjectID());
|
GameMessages::SendEnableQuickBuild(m_Parent, true, false, false, eQuickBuildFailReason::NOT_GIVEN, 0.0f, user->GetObjectID());
|
||||||
|
|
||||||
m_State = eRebuildState::BUILDING;
|
m_State = eQuickBuildState::BUILDING;
|
||||||
m_StateDirty = true;
|
m_StateDirty = true;
|
||||||
Game::entityManager->SerializeEntity(m_Parent);
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
|
|
||||||
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
||||||
if (movingPlatform != nullptr) {
|
if (movingPlatform != nullptr) {
|
||||||
movingPlatform->OnRebuildInitilized();
|
movingPlatform->OnQuickBuildInitilized();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* script : CppScripts::GetEntityScripts(m_Parent)) {
|
for (auto* script : CppScripts::GetEntityScripts(m_Parent)) {
|
||||||
script->OnRebuildStart(m_Parent, user);
|
script->OnQuickBuildStart(m_Parent, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts and possible subscribers
|
// Notify scripts and possible subscribers
|
||||||
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
||||||
script->OnRebuildNotifyState(m_Parent, m_State);
|
script->OnQuickBuildNotifyState(m_Parent, m_State);
|
||||||
for (const auto& cb : m_RebuildStateCallbacks)
|
for (const auto& cb : m_QuickBuildStateCallbacks)
|
||||||
cb(m_State);
|
cb(m_State);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::CompleteRebuild(Entity* user) {
|
void QuickBuildComponent::CompleteQuickBuild(Entity* user) {
|
||||||
if (user == nullptr) {
|
if (user == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -436,7 +436,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||||
characterComponent->TrackRebuildComplete();
|
characterComponent->TrackQuickBuildComplete();
|
||||||
} else {
|
} else {
|
||||||
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
LOG("Some user tried to finish the rebuild but they didn't have a character somehow.");
|
||||||
return;
|
return;
|
||||||
@ -444,13 +444,13 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
|
|
||||||
Game::entityManager->SerializeEntity(user);
|
Game::entityManager->SerializeEntity(user);
|
||||||
|
|
||||||
GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::COMPLETED, user->GetObjectID());
|
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::COMPLETED, user->GetObjectID());
|
||||||
GameMessages::SendPlayFXEffect(m_Parent, 507, u"create", "BrickFadeUpVisCompleteEffect", LWOOBJID_EMPTY, 0.4f, 1.0f, true);
|
GameMessages::SendPlayFXEffect(m_Parent, 507, u"create", "BrickFadeUpVisCompleteEffect", LWOOBJID_EMPTY, 0.4f, 1.0f, true);
|
||||||
GameMessages::SendEnableRebuild(m_Parent, false, false, true, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, user->GetObjectID());
|
GameMessages::SendEnableQuickBuild(m_Parent, false, false, true, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, user->GetObjectID());
|
||||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||||
|
|
||||||
|
|
||||||
m_State = eRebuildState::COMPLETED;
|
m_State = eQuickBuildState::COMPLETED;
|
||||||
m_StateDirty = true;
|
m_StateDirty = true;
|
||||||
m_Timer = 0.0f;
|
m_Timer = 0.0f;
|
||||||
m_DrainedImagination = 0;
|
m_DrainedImagination = 0;
|
||||||
@ -490,21 +490,21 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
|
|
||||||
// Notify scripts
|
// Notify scripts
|
||||||
for (auto* script : CppScripts::GetEntityScripts(m_Parent)) {
|
for (auto* script : CppScripts::GetEntityScripts(m_Parent)) {
|
||||||
script->OnRebuildComplete(m_Parent, user);
|
script->OnQuickBuildComplete(m_Parent, user);
|
||||||
script->OnRebuildNotifyState(m_Parent, m_State);
|
script->OnQuickBuildNotifyState(m_Parent, m_State);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify subscribers
|
// Notify subscribers
|
||||||
for (const auto& callback : m_RebuildStateCallbacks)
|
for (const auto& callback : m_QuickBuildStateCallbacks)
|
||||||
callback(m_State);
|
callback(m_State);
|
||||||
for (const auto& callback : m_RebuildCompleteCallbacks)
|
for (const auto& callback : m_QuickBuildCompleteCallbacks)
|
||||||
callback(user);
|
callback(user);
|
||||||
|
|
||||||
m_Parent->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
m_Parent->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
||||||
|
|
||||||
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
auto* movingPlatform = m_Parent->GetComponent<MovingPlatformComponent>();
|
||||||
if (movingPlatform != nullptr) {
|
if (movingPlatform != nullptr) {
|
||||||
movingPlatform->OnCompleteRebuild();
|
movingPlatform->OnCompleteQuickBuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set flag
|
// Set flag
|
||||||
@ -520,20 +520,20 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
|||||||
RenderComponent::PlayAnimation(user, u"rebuild-celebrate", 1.09f);
|
RenderComponent::PlayAnimation(user, u"rebuild-celebrate", 1.09f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::ResetRebuild(bool failed) {
|
void QuickBuildComponent::ResetQuickBuild(bool failed) {
|
||||||
Entity* builder = GetBuilder();
|
Entity* builder = GetBuilder();
|
||||||
|
|
||||||
if (m_State == eRebuildState::BUILDING && builder) {
|
if (m_State == eQuickBuildState::BUILDING && builder) {
|
||||||
GameMessages::SendEnableRebuild(m_Parent, false, false, failed, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, builder->GetObjectID());
|
GameMessages::SendEnableQuickBuild(m_Parent, false, false, failed, eQuickBuildFailReason::NOT_GIVEN, m_ResetTime, builder->GetObjectID());
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
RenderComponent::PlayAnimation(builder, u"rebuild-fail");
|
RenderComponent::PlayAnimation(builder, u"rebuild-fail");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::RESETTING, LWOOBJID_EMPTY);
|
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::RESETTING, LWOOBJID_EMPTY);
|
||||||
|
|
||||||
m_State = eRebuildState::RESETTING;
|
m_State = eQuickBuildState::RESETTING;
|
||||||
m_StateDirty = true;
|
m_StateDirty = true;
|
||||||
m_Timer = 0.0f;
|
m_Timer = 0.0f;
|
||||||
m_TimerIncomplete = 0.0f;
|
m_TimerIncomplete = 0.0f;
|
||||||
@ -544,8 +544,8 @@ void RebuildComponent::ResetRebuild(bool failed) {
|
|||||||
|
|
||||||
// Notify scripts and possible subscribers
|
// Notify scripts and possible subscribers
|
||||||
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
||||||
script->OnRebuildNotifyState(m_Parent, m_State);
|
script->OnQuickBuildNotifyState(m_Parent, m_State);
|
||||||
for (const auto& cb : m_RebuildStateCallbacks)
|
for (const auto& cb : m_QuickBuildStateCallbacks)
|
||||||
cb(m_State);
|
cb(m_State);
|
||||||
|
|
||||||
m_Parent->ScheduleKillAfterUpdate();
|
m_Parent->ScheduleKillAfterUpdate();
|
||||||
@ -555,29 +555,29 @@ void RebuildComponent::ResetRebuild(bool failed) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failReason, bool skipChecks) {
|
void QuickBuildComponent::CancelQuickBuild(Entity* entity, eQuickBuildFailReason failReason, bool skipChecks) {
|
||||||
if (m_State != eRebuildState::COMPLETED || skipChecks) {
|
if (m_State != eQuickBuildState::COMPLETED || skipChecks) {
|
||||||
|
|
||||||
m_Builder = LWOOBJID_EMPTY;
|
m_Builder = LWOOBJID_EMPTY;
|
||||||
|
|
||||||
const auto entityID = entity != nullptr ? entity->GetObjectID() : LWOOBJID_EMPTY;
|
const auto entityID = entity != nullptr ? entity->GetObjectID() : LWOOBJID_EMPTY;
|
||||||
|
|
||||||
// Notify the client that a state has changed
|
// Notify the client that a state has changed
|
||||||
GameMessages::SendRebuildNotifyState(m_Parent, m_State, eRebuildState::INCOMPLETE, entityID);
|
GameMessages::SendQuickBuildNotifyState(m_Parent, m_State, eQuickBuildState::INCOMPLETE, entityID);
|
||||||
GameMessages::SendEnableRebuild(m_Parent, false, true, false, failReason, m_Timer, entityID);
|
GameMessages::SendEnableQuickBuild(m_Parent, false, true, false, failReason, m_Timer, entityID);
|
||||||
|
|
||||||
// Now terminate any interaction with the rebuild
|
// Now terminate any interaction with the rebuild
|
||||||
GameMessages::SendTerminateInteraction(entityID, eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
GameMessages::SendTerminateInteraction(entityID, eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||||
GameMessages::SendTerminateInteraction(m_Parent->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
GameMessages::SendTerminateInteraction(m_Parent->GetObjectID(), eTerminateType::FROM_INTERACTION, m_Parent->GetObjectID());
|
||||||
|
|
||||||
// Now update the component itself
|
// Now update the component itself
|
||||||
m_State = eRebuildState::INCOMPLETE;
|
m_State = eQuickBuildState::INCOMPLETE;
|
||||||
m_StateDirty = true;
|
m_StateDirty = true;
|
||||||
|
|
||||||
// Notify scripts and possible subscribers
|
// Notify scripts and possible subscribers
|
||||||
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
for (auto* script : CppScripts::GetEntityScripts(m_Parent))
|
||||||
script->OnRebuildNotifyState(m_Parent, m_State);
|
script->OnQuickBuildNotifyState(m_Parent, m_State);
|
||||||
for (const auto& cb : m_RebuildStateCallbacks)
|
for (const auto& cb : m_QuickBuildStateCallbacks)
|
||||||
cb(m_State);
|
cb(m_State);
|
||||||
|
|
||||||
Game::entityManager->SerializeEntity(m_Parent);
|
Game::entityManager->SerializeEntity(m_Parent);
|
||||||
@ -594,10 +594,10 @@ void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failR
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback) {
|
void QuickBuildComponent::AddQuickBuildCompleteCallback(const std::function<void(Entity* user)>& callback) {
|
||||||
m_RebuildCompleteCallbacks.push_back(callback);
|
m_QuickBuildCompleteCallbacks.push_back(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RebuildComponent::AddRebuildStateCallback(const std::function<void(eRebuildState state)>& callback) {
|
void QuickBuildComponent::AddQuickBuildStateCallback(const std::function<void(eQuickBuildState state)>& callback) {
|
||||||
m_RebuildStateCallbacks.push_back(callback);
|
m_QuickBuildStateCallbacks.push_back(callback);
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef REBUILDCOMPONENT_H
|
#ifndef QUICKBUILDCOMPONENT_H
|
||||||
#define REBUILDCOMPONENT_H
|
#define QUICKBUILDCOMPONENT_H
|
||||||
|
|
||||||
#include <BitStream.h>
|
#include <BitStream.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -10,7 +10,7 @@
|
|||||||
#include "Preconditions.h"
|
#include "Preconditions.h"
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
class Entity;
|
class Entity;
|
||||||
enum class eQuickBuildFailReason : uint32_t;
|
enum class eQuickBuildFailReason : uint32_t;
|
||||||
@ -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
|
* 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.
|
* that quick builds are also scripted activities so this shared some logic with the ScriptedActivityComponent.
|
||||||
*/
|
*/
|
||||||
class RebuildComponent : public Component {
|
class QuickBuildComponent : public Component {
|
||||||
public:
|
public:
|
||||||
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
|
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::QUICK_BUILD;
|
||||||
|
|
||||||
RebuildComponent(Entity* entity);
|
QuickBuildComponent(Entity* entity);
|
||||||
~RebuildComponent() override;
|
~QuickBuildComponent() override;
|
||||||
|
|
||||||
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override;
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate) override;
|
||||||
void Update(float deltaTime) override;
|
void Update(float deltaTime) override;
|
||||||
@ -37,78 +37,78 @@ public:
|
|||||||
void OnUse(Entity* originator) override;
|
void OnUse(Entity* originator) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spawns the activator that can be used to initiate the rebuild
|
* Spawns the activator that can be used to initiate the quickbuild
|
||||||
*/
|
*/
|
||||||
void SpawnActivator();
|
void SpawnActivator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Despawns the activiator that can be used to initiate the rebuild
|
* Despawns the activiator that can be used to initiate the quickbuild
|
||||||
*/
|
*/
|
||||||
void DespawnActivator();
|
void DespawnActivator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the entity that acts as the activator for this rebuild
|
* Returns the entity that acts as the activator for this quickbuild
|
||||||
* @return the entity that acts as the activator for this rebuild
|
* @return the entity that acts as the activator for this quickbuild
|
||||||
*/
|
*/
|
||||||
Entity* GetActivator();
|
Entity* GetActivator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the spawn position of the activator for this rebuild, if any
|
* Returns the spawn position of the activator for this quickbuild, if any
|
||||||
* @return the spawn position of the activator for this rebuild, if any
|
* @return the spawn position of the activator for this quickbuild, if any
|
||||||
*/
|
*/
|
||||||
NiPoint3 GetActivatorPosition();
|
NiPoint3 GetActivatorPosition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the spawn position for the activator of this rebuild
|
* Sets the spawn position for the activator of this quickbuild
|
||||||
* @param value the spawn position to set for the activator
|
* @param value the spawn position to set for the activator
|
||||||
*/
|
*/
|
||||||
void SetActivatorPosition(NiPoint3 value);
|
void SetActivatorPosition(NiPoint3 value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the time it takes for the rebuild to reset after being built
|
* Returns the time it takes for the quickbuild to reset after being built
|
||||||
* @return the time it takes for the rebuild to reset after being built
|
* @return the time it takes for the quickbuild to reset after being built
|
||||||
*/
|
*/
|
||||||
float GetResetTime();
|
float GetResetTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the time it takes for the rebuild to reset after being built
|
* Sets the time it takes for the quickbuild to reset after being built
|
||||||
* @param value the reset time to set
|
* @param value the reset time to set
|
||||||
*/
|
*/
|
||||||
void SetResetTime(float value);
|
void SetResetTime(float value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the time it takes to complete the rebuild
|
* Returns the time it takes to complete the quickbuild
|
||||||
* @return the time it takes to complete the rebuild
|
* @return the time it takes to complete the quickbuild
|
||||||
*/
|
*/
|
||||||
float GetCompleteTime();
|
float GetCompleteTime();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the time it takes to complete the rebuild
|
* Sets the time it takes to complete the quickbuild
|
||||||
* @param value the completion time to set
|
* @param value the completion time to set
|
||||||
*/
|
*/
|
||||||
void SetCompleteTime(float value);
|
void SetCompleteTime(float value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the imagination that's taken when completing the rebuild
|
* Returns the imagination that's taken when completing the quickbuild
|
||||||
* @return the imagination that's taken when completing the rebuild
|
* @return the imagination that's taken when completing the quickbuild
|
||||||
*/
|
*/
|
||||||
int GetTakeImagination();
|
int GetTakeImagination();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the imagination that's taken when completing the rebuild
|
* Sets the imagination that's taken when completing the quickbuild
|
||||||
* @param value the imagination deduction to set
|
* @param value the imagination deduction to set
|
||||||
*/
|
*/
|
||||||
void SetTakeImagination(int value);
|
void SetTakeImagination(int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns if the rebuild can be interrupted, currently unused
|
* Returns if the quickbuild can be interrupted, currently unused
|
||||||
* @return if the rebuild can be interrupted
|
* @return if the quickbuild can be interrupted
|
||||||
*/
|
*/
|
||||||
bool GetInterruptible();
|
bool GetInterruptible();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not the rebuild can be interrupted, currently unused
|
* Sets whether or not the quickbuild can be interrupted, currently unused
|
||||||
* @param value true if the rebuild may be interrupted, false otherwise
|
* @param value true if the quickbuild may be interrupted, false otherwise
|
||||||
*/
|
*/
|
||||||
void SetInterruptible(bool value);
|
void SetInterruptible(bool value);
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not this entity contains a built-in activator. If set to false this will spawn activators on
|
* Sets whether or not this entity contains a built-in activator. If set to false this will spawn activators on
|
||||||
* each new rebuild.
|
* each new quickbuild.
|
||||||
* @param value whether or not this entity contains a built-in activator
|
* @param value whether or not this entity contains a built-in activator
|
||||||
*/
|
*/
|
||||||
void SetSelfActivator(bool value);
|
void SetSelfActivator(bool value);
|
||||||
@ -136,13 +136,13 @@ public:
|
|||||||
void SetCustomModules(std::vector<int> value);
|
void SetCustomModules(std::vector<int> value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the activity ID for participating in this rebuild
|
* Returns the activity ID for participating in this quickbuild
|
||||||
* @return the activity ID for participating in this rebuild
|
* @return the activity ID for participating in this quickbuild
|
||||||
*/
|
*/
|
||||||
int GetActivityId();
|
int GetActivityId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the activity ID for participating in this rebuild
|
* Sets the activity ID for participating in this quickbuild
|
||||||
* @param value the activity ID to set
|
* @param value the activity ID to set
|
||||||
*/
|
*/
|
||||||
void SetActivityId(int value);
|
void SetActivityId(int value);
|
||||||
@ -158,66 +158,66 @@ public:
|
|||||||
void SetPostImaginationCost(int value);
|
void SetPostImaginationCost(int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the time it takes for an incomplete rebuild to be smashed automatically
|
* Returns the time it takes for an incomplete quickbuild to be smashed automatically
|
||||||
* @return the time it takes for an incomplete rebuild to be smashed automatically
|
* @return the time it takes for an incomplete quickbuild to be smashed automatically
|
||||||
*/
|
*/
|
||||||
float GetTimeBeforeSmash();
|
float GetTimeBeforeSmash();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the time it takes for an incomplete rebuild to be smashed automatically
|
* Sets the time it takes for an incomplete quickbuild to be smashed automatically
|
||||||
* @param value the time to set
|
* @param value the time to set
|
||||||
*/
|
*/
|
||||||
void SetTimeBeforeSmash(float value);
|
void SetTimeBeforeSmash(float value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current rebuild state
|
* Returns the current quickbuild state
|
||||||
* @return the current rebuild state
|
* @return the current quickbuild state
|
||||||
*/
|
*/
|
||||||
eRebuildState GetState();
|
eQuickBuildState GetState();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the player that is currently building this rebuild
|
* Returns the player that is currently building this quickbuild
|
||||||
* @return the player that is currently building this rebuild
|
* @return the player that is currently building this quickbuild
|
||||||
*/
|
*/
|
||||||
Entity* GetBuilder() const;
|
Entity* GetBuilder() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the player is repositioned when initiating the rebuild
|
* Returns whether or not the player is repositioned when initiating the quickbuild
|
||||||
* @return whether or not the player is repositioned when initiating the rebuild
|
* @return whether or not the player is repositioned when initiating the quickbuild
|
||||||
*/
|
*/
|
||||||
bool GetRepositionPlayer() const;
|
bool GetRepositionPlayer() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not the player is repositioned when initiating the rebuild
|
* Sets whether or not the player is repositioned when initiating the quickbuild
|
||||||
* @param value whether or not the player is repositioned when initiating the rebuild
|
* @param value whether or not the player is repositioned when initiating the quickbuild
|
||||||
*/
|
*/
|
||||||
void SetRepositionPlayer(bool value);
|
void SetRepositionPlayer(bool value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a callback that is called when the rebuild is completed
|
* Adds a callback that is called when the quickbuild is completed
|
||||||
* @param callback the callback to add
|
* @param callback the callback to add
|
||||||
*/
|
*/
|
||||||
void AddRebuildCompleteCallback(const std::function<void(Entity* user)>& callback);
|
void AddQuickBuildCompleteCallback(const std::function<void(Entity* user)>& callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a callback when the rebuild state is updated
|
* Adds a callback when the quickbuild state is updated
|
||||||
* @param callback the callback to add
|
* @param callback the callback to add
|
||||||
*/
|
*/
|
||||||
void AddRebuildStateCallback(const std::function<void(eRebuildState state)>& callback);
|
void AddQuickBuildStateCallback(const std::function<void(eQuickBuildState state)>& callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the rebuild
|
* Resets the quickbuild
|
||||||
* @param failed whether or not the player failed to complete the rebuild, triggers an extra animation
|
* @param failed whether or not the player failed to complete the quickbuild, triggers an extra animation
|
||||||
*/
|
*/
|
||||||
void ResetRebuild(bool failed);
|
void ResetQuickBuild(bool failed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancels the rebuild if it wasn't completed
|
* Cancels the quickbuild if it wasn't completed
|
||||||
* @param builder the player that's currently building
|
* @param builder the player that's currently building
|
||||||
* @param failReason the reason the rebuild was cancelled
|
* @param failReason the reason the quickbuild was cancelled
|
||||||
* @param skipChecks whether or not to skip the check for the rebuild not being completed
|
* @param skipChecks whether or not to skip the check for the quickbuild not being completed
|
||||||
*/
|
*/
|
||||||
void CancelRebuild(Entity* builder, eQuickBuildFailReason failReason, bool skipChecks = false);
|
void CancelQuickBuild(Entity* builder, eQuickBuildFailReason failReason, bool skipChecks = false);
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Whether or not the quickbuild state has been changed since we last serialized it.
|
* Whether or not the quickbuild state has been changed since we last serialized it.
|
||||||
@ -225,37 +225,37 @@ private:
|
|||||||
bool m_StateDirty = true;
|
bool m_StateDirty = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The state the rebuild is currently in
|
* The state the quickbuild is currently in
|
||||||
*/
|
*/
|
||||||
eRebuildState m_State = eRebuildState::OPEN;
|
eQuickBuildState m_State = eQuickBuildState::OPEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time that has passed since initiating the rebuild
|
* The time that has passed since initiating the quickbuild
|
||||||
*/
|
*/
|
||||||
float m_Timer = 0;
|
float m_Timer = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time that has passed before completing the rebuild
|
* The time that has passed before completing the quickbuild
|
||||||
*/
|
*/
|
||||||
float m_TimerIncomplete = 0;
|
float m_TimerIncomplete = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The position that the rebuild activator is spawned at
|
* The position that the quickbuild activator is spawned at
|
||||||
*/
|
*/
|
||||||
NiPoint3 m_ActivatorPosition = NiPoint3::ZERO;
|
NiPoint3 m_ActivatorPosition = NiPoint3::ZERO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The entity that represents the rebuild activator
|
* The entity that represents the quickbuild activator
|
||||||
*/
|
*/
|
||||||
Entity* m_Activator = nullptr;
|
Entity* m_Activator = nullptr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the entity that represents the rebuild activator
|
* The ID of the entity that represents the quickbuild activator
|
||||||
*/
|
*/
|
||||||
LWOOBJID m_ActivatorId = LWOOBJID_EMPTY;
|
LWOOBJID m_ActivatorId = LWOOBJID_EMPTY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggers the blinking that indicates that the rebuild is resetting
|
* Triggers the blinking that indicates that the quickbuild is resetting
|
||||||
*/
|
*/
|
||||||
bool m_ShowResetEffect = false;
|
bool m_ShowResetEffect = false;
|
||||||
|
|
||||||
@ -265,27 +265,27 @@ private:
|
|||||||
float m_Taken = 0;
|
float m_Taken = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The callbacks that are called when the rebuild is completed
|
* The callbacks that are called when the quickbuild is completed
|
||||||
*/
|
*/
|
||||||
std::vector<std::function<void(Entity* user)>> m_RebuildCompleteCallbacks{};
|
std::vector<std::function<void(Entity* user)>> m_QuickBuildCompleteCallbacks{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The callbacks that are called when the rebuild state is updated
|
* The callbacks that are called when the quickbuild state is updated
|
||||||
*/
|
*/
|
||||||
std::vector<std::function<void(eRebuildState state)>> m_RebuildStateCallbacks{};
|
std::vector<std::function<void(eQuickBuildState state)>> m_QuickBuildStateCallbacks{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time it takes for the rebuild to reset after being completed
|
* The time it takes for the quickbuild to reset after being completed
|
||||||
*/
|
*/
|
||||||
float m_ResetTime = 0;
|
float m_ResetTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time it takes to complete the rebuild
|
* The time it takes to complete the quickbuild
|
||||||
*/
|
*/
|
||||||
float m_CompleteTime = 0;
|
float m_CompleteTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The imagination that's deducted when completing the rebuild
|
* The imagination that's deducted when completing the quickbuild
|
||||||
*/
|
*/
|
||||||
int m_TakeImagination = 0;
|
int m_TakeImagination = 0;
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ private:
|
|||||||
bool m_Interruptible = false;
|
bool m_Interruptible = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether or not this rebuild entity also has an activator attached. If not a new one will be spawned
|
* Whether or not this quickbuild entity also has an activator attached. If not a new one will be spawned
|
||||||
*/
|
*/
|
||||||
bool m_SelfActivator = false;
|
bool m_SelfActivator = false;
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ private:
|
|||||||
std::vector<int> m_CustomModules{};
|
std::vector<int> m_CustomModules{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The activity ID that players partake in when doing this rebuild
|
* The activity ID that players partake in when doing this quickbuild
|
||||||
*/
|
*/
|
||||||
int m_ActivityId = 0;
|
int m_ActivityId = 0;
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ private:
|
|||||||
int m_PostImaginationCost = 0;
|
int m_PostImaginationCost = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time it takes for the rebuild to reset when it's not completed yet
|
* The time it takes for the quickbuild to reset when it's not completed yet
|
||||||
*/
|
*/
|
||||||
float m_TimeBeforeSmash = 0;
|
float m_TimeBeforeSmash = 0;
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ private:
|
|||||||
float m_TimeBeforeDrain = 0;
|
float m_TimeBeforeDrain = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The amount of imagination that was drained when building this rebuild
|
* The amount of imagination that was drained when building this quickbuild
|
||||||
*/
|
*/
|
||||||
int m_DrainedImagination = 0;
|
int m_DrainedImagination = 0;
|
||||||
|
|
||||||
@ -340,26 +340,26 @@ private:
|
|||||||
float m_SoftTimer = 0;
|
float m_SoftTimer = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the entity that's currently building the rebuild
|
* The ID of the entity that's currently building the quickbuild
|
||||||
*/
|
*/
|
||||||
LWOOBJID m_Builder = LWOOBJID_EMPTY;
|
LWOOBJID m_Builder = LWOOBJID_EMPTY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preconditions to be met before being able to start the rebuild
|
* Preconditions to be met before being able to start the quickbuild
|
||||||
*/
|
*/
|
||||||
PreconditionExpression* m_Precondition = nullptr;
|
PreconditionExpression* m_Precondition = nullptr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the rebuild for a certain entity
|
* Starts the quickbuild for a certain entity
|
||||||
* @param user the entity to start the rebuild
|
* @param user the entity to start the quickbuild
|
||||||
*/
|
*/
|
||||||
void StartRebuild(Entity* user);
|
void StartQuickBuild(Entity* user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completes the rebuild for an entity, dropping loot and despawning the activator
|
* Completes the quickbuild for an entity, dropping loot and despawning the activator
|
||||||
* @param user the entity that completed the rebuild
|
* @param user the entity that completed the quickbuild
|
||||||
*/
|
*/
|
||||||
void CompleteRebuild(Entity* user);
|
void CompleteQuickBuild(Entity* user);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // REBUILDCOMPONENT_H
|
#endif // QUICKBUILDCOMPONENT_H
|
@ -4,7 +4,7 @@
|
|||||||
#include "CDRailActivatorComponent.h"
|
#include "CDRailActivatorComponent.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "RenderComponent.h"
|
#include "RenderComponent.h"
|
||||||
@ -43,13 +43,13 @@ RailActivatorComponent::RailActivatorComponent(Entity* parent, int32_t component
|
|||||||
RailActivatorComponent::~RailActivatorComponent() = default;
|
RailActivatorComponent::~RailActivatorComponent() = default;
|
||||||
|
|
||||||
void RailActivatorComponent::OnUse(Entity* originator) {
|
void RailActivatorComponent::OnUse(Entity* originator) {
|
||||||
auto* rebuildComponent = m_Parent->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = m_Parent->GetComponent<QuickBuildComponent>();
|
||||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED)
|
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() != eQuickBuildState::COMPLETED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
// Don't want it to be destroyed while a player is using it
|
// 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());
|
m_EntitiesOnRail.push_back(originator->GetObjectID());
|
||||||
@ -116,11 +116,11 @@ void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
|
|||||||
true, true, true, true, true, true, true
|
true, true, true, true, true, true, true
|
||||||
);
|
);
|
||||||
|
|
||||||
auto* rebuildComponent = m_Parent->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = m_Parent->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
// Set back reset time
|
// 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()) {
|
if (std::find(m_EntitiesOnRail.begin(), m_EntitiesOnRail.end(), originator->GetObjectID()) != m_EntitiesOnRail.end()) {
|
||||||
|
@ -10,7 +10,7 @@ SwitchComponent::SwitchComponent(Entity* parent) : Component(parent) {
|
|||||||
|
|
||||||
m_ResetTime = m_Parent->GetVarAs<int32_t>(u"switch_reset_time");
|
m_ResetTime = m_Parent->GetVarAs<int32_t>(u"switch_reset_time");
|
||||||
|
|
||||||
m_Rebuild = m_Parent->GetComponent<RebuildComponent>();
|
m_QuickBuild = m_Parent->GetComponent<QuickBuildComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitchComponent::~SwitchComponent() {
|
SwitchComponent::~SwitchComponent() {
|
||||||
@ -39,8 +39,8 @@ bool SwitchComponent::GetActive() const {
|
|||||||
|
|
||||||
void SwitchComponent::EntityEnter(Entity* entity) {
|
void SwitchComponent::EntityEnter(Entity* entity) {
|
||||||
if (!m_Active) {
|
if (!m_Active) {
|
||||||
if (m_Rebuild) {
|
if (m_QuickBuild) {
|
||||||
if (m_Rebuild->GetState() != eRebuildState::COMPLETED) return;
|
if (m_QuickBuild->GetState() != eQuickBuildState::COMPLETED) return;
|
||||||
}
|
}
|
||||||
m_Active = true;
|
m_Active = true;
|
||||||
if (!m_Parent) return;
|
if (!m_Parent) return;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "BouncerComponent.h"
|
#include "BouncerComponent.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
@ -75,7 +75,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Attached rebuild component.
|
* Attached rebuild component.
|
||||||
*/
|
*/
|
||||||
RebuildComponent* m_Rebuild;
|
QuickBuildComponent* m_QuickBuild;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the switch is on or off.
|
* If the switch is on or off.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "PhantomPhysicsComponent.h"
|
#include "PhantomPhysicsComponent.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
#include "eEndBehavior.h"
|
#include "eEndBehavior.h"
|
||||||
|
|
||||||
@ -205,12 +205,12 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
||||||
auto* rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = targetEntity->GetComponent<QuickBuildComponent>();
|
||||||
if (!rebuildComponent) {
|
if (!quickBuildComponent) {
|
||||||
LOG_DEBUG("Rebuild component not found!");
|
LOG_DEBUG("Rebuild component not found!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rebuildComponent->ResetRebuild(args == "1");
|
quickBuildComponent->ResetQuickBuild(args == "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TriggerComponent::HandleMoveObject(Entity* targetEntity, std::vector<std::string> argArray){
|
void TriggerComponent::HandleMoveObject(Entity* targetEntity, std::vector<std::string> argArray){
|
||||||
|
@ -422,7 +422,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case eGameMessageType::REBUILD_CANCEL:
|
case eGameMessageType::REBUILD_CANCEL:
|
||||||
GameMessages::HandleRebuildCancel(inStream, entity);
|
GameMessages::HandleQuickBuildCancel(inStream, entity);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eGameMessageType::MATCH_REQUEST:
|
case eGameMessageType::MATCH_REQUEST:
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "ScriptComponent.h"
|
#include "ScriptComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "VendorComponent.h"
|
#include "VendorComponent.h"
|
||||||
#include "InventoryComponent.h"
|
#include "InventoryComponent.h"
|
||||||
#include "RocketLaunchpadControlComponent.h"
|
#include "RocketLaunchpadControlComponent.h"
|
||||||
@ -767,7 +767,7 @@ void GameMessages::SendSetCurrency(Entity* entity, int64_t currency, int lootTyp
|
|||||||
SEND_PACKET;
|
SEND_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::SendRebuildNotifyState(Entity* entity, eRebuildState prevState, eRebuildState state, const LWOOBJID& playerID) {
|
void GameMessages::SendQuickBuildNotifyState(Entity* entity, eQuickBuildState prevState, eQuickBuildState state, const LWOOBJID& playerID) {
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
@ -781,7 +781,7 @@ void GameMessages::SendRebuildNotifyState(Entity* entity, eRebuildState prevStat
|
|||||||
SEND_PACKET_BROADCAST;
|
SEND_PACKET_BROADCAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID) {
|
void GameMessages::SendEnableQuickBuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID) {
|
||||||
CBITSTREAM;
|
CBITSTREAM;
|
||||||
CMSGHEADER;
|
CMSGHEADER;
|
||||||
|
|
||||||
@ -4946,17 +4946,17 @@ void GameMessages::HandleRequestPlatformResync(RakNet::BitStream* inStream, Enti
|
|||||||
GameMessages::SendPlatformResync(entity, sysAddr);
|
GameMessages::SendPlatformResync(entity, sysAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandleRebuildCancel(RakNet::BitStream* inStream, Entity* entity) {
|
void GameMessages::HandleQuickBuildCancel(RakNet::BitStream* inStream, Entity* entity) {
|
||||||
bool bEarlyRelease;
|
bool bEarlyRelease;
|
||||||
LWOOBJID userID;
|
LWOOBJID userID;
|
||||||
|
|
||||||
inStream->Read(bEarlyRelease);
|
inStream->Read(bEarlyRelease);
|
||||||
inStream->Read(userID);
|
inStream->Read(userID);
|
||||||
|
|
||||||
RebuildComponent* rebComp = static_cast<RebuildComponent*>(entity->GetComponent(eReplicaComponentType::QUICK_BUILD));
|
auto* quickBuildComponent = static_cast<QuickBuildComponent*>(entity->GetComponent(eReplicaComponentType::QUICK_BUILD));;
|
||||||
if (!rebComp) return;
|
if (!quickBuildComponent) return;
|
||||||
|
|
||||||
rebComp->CancelRebuild(Game::entityManager->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY);
|
quickBuildComponent->CancelQuickBuild(Game::entityManager->GetEntity(userID), eQuickBuildFailReason::CANCELED_EARLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
void GameMessages::HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
|
||||||
|
@ -35,7 +35,7 @@ enum class eStateChangeType : uint32_t;
|
|||||||
enum class ePetTamingNotifyType : uint32_t;
|
enum class ePetTamingNotifyType : uint32_t;
|
||||||
enum class eUseItemResponse : uint32_t;
|
enum class eUseItemResponse : uint32_t;
|
||||||
enum class eQuickBuildFailReason : uint32_t;
|
enum class eQuickBuildFailReason : uint32_t;
|
||||||
enum class eRebuildState : uint32_t;
|
enum class eQuickBuildState : uint32_t;
|
||||||
enum class BehaviorSlot : int32_t;
|
enum class BehaviorSlot : int32_t;
|
||||||
|
|
||||||
namespace GameMessages {
|
namespace GameMessages {
|
||||||
@ -100,8 +100,8 @@ namespace GameMessages {
|
|||||||
void SendBroadcastTextToChatbox(Entity* entity, const SystemAddress& sysAddr, const std::u16string& attrs, const std::u16string& wsText);
|
void SendBroadcastTextToChatbox(Entity* entity, const SystemAddress& sysAddr, const std::u16string& attrs, const std::u16string& wsText);
|
||||||
void SendSetCurrency(Entity* entity, int64_t currency, int lootType, const LWOOBJID& sourceID, const LOT& sourceLOT, int sourceTradeID, bool overrideCurrent, eLootSourceType sourceType);
|
void SendSetCurrency(Entity* entity, int64_t currency, int lootType, const LWOOBJID& sourceID, const LOT& sourceLOT, int sourceTradeID, bool overrideCurrent, eLootSourceType sourceType);
|
||||||
|
|
||||||
void SendRebuildNotifyState(Entity* entity, eRebuildState prevState, eRebuildState state, const LWOOBJID& playerID);
|
void SendQuickBuildNotifyState(Entity* entity, eQuickBuildState prevState, eQuickBuildState state, const LWOOBJID& playerID);
|
||||||
void SendEnableRebuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID);
|
void SendEnableQuickBuild(Entity* entity, bool enable, bool fail, bool success, eQuickBuildFailReason failReason, float duration, const LWOOBJID& playerID);
|
||||||
void AddActivityOwner(Entity* entity, LWOOBJID& ownerID);
|
void AddActivityOwner(Entity* entity, LWOOBJID& ownerID);
|
||||||
void SendTerminateInteraction(const LWOOBJID& objectID, eTerminateType type, const LWOOBJID& terminator);
|
void SendTerminateInteraction(const LWOOBJID& objectID, eTerminateType type, const LWOOBJID& terminator);
|
||||||
|
|
||||||
@ -602,7 +602,7 @@ namespace GameMessages {
|
|||||||
void HandleSetGhostReffrenceOverride(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
void HandleSetGhostReffrenceOverride(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||||
void HandleFireEventServerSide(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
void HandleFireEventServerSide(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||||
void HandleRequestPlatformResync(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
void HandleRequestPlatformResync(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||||
void HandleRebuildCancel(RakNet::BitStream* inStream, Entity* entity);
|
void HandleQuickBuildCancel(RakNet::BitStream* inStream, Entity* entity);
|
||||||
void HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
void HandleRequestUse(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||||
void HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity);
|
void HandlePlayEmote(RakNet::BitStream* inStream, Entity* entity);
|
||||||
void HandleModularBuildConvertModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
void HandleModularBuildConvertModel(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
|
||||||
|
@ -14,7 +14,7 @@ void GfApeSmashingQB::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GfApeSmashingQB::OnRebuildComplete(Entity* self, Entity* target) {
|
void GfApeSmashingQB::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto* ape = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
auto* ape = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"ape"));
|
||||||
if (ape != nullptr) {
|
if (ape != nullptr) {
|
||||||
ape->OnFireEventServerSide(target, "rebuildDone");
|
ape->OnFireEventServerSide(target, "rebuildDone");
|
||||||
|
@ -4,5 +4,5 @@
|
|||||||
class GfApeSmashingQB : public CppScripts::Script {
|
class GfApeSmashingQB : public CppScripts::Script {
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "AgBugsprayer.h"
|
#include "AgBugsprayer.h"
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
|
|
||||||
void AgBugsprayer::OnRebuildComplete(Entity* self, Entity* target) {
|
void AgBugsprayer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
self->AddTimer("castSkill", 1);
|
self->AddTimer("castSkill", 1);
|
||||||
self->SetOwnerOverride(target->GetObjectID());
|
self->SetOwnerOverride(target->GetObjectID());
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class AgBugsprayer : public CppScripts::Script
|
class AgBugsprayer : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ void AmBridge::OnStartup(Entity* self) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
|
void AmBridge::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
||||||
|
|
||||||
if (consoles.empty()) {
|
if (consoles.empty()) {
|
||||||
|
@ -5,6 +5,6 @@ class AmBridge : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "AmDropshipComputer.h"
|
#include "AmDropshipComputer.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "InventoryComponent.h"
|
#include "InventoryComponent.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "eMissionState.h"
|
#include "eMissionState.h"
|
||||||
@ -10,9 +10,9 @@ void AmDropshipComputer::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AmDropshipComputer::OnUse(Entity* self, Entity* user) {
|
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() != eQuickBuildState::COMPLETED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,13 +70,13 @@ void AmDropshipComputer::OnDie(Entity* self, Entity* killer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AmDropshipComputer::OnTimerDone(Entity* self, std::string timerName) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timerName == "reset" && rebuildComponent->GetState() == eRebuildState::OPEN) {
|
if (timerName == "reset" && quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "BaseCombatAIComponent.h"
|
#include "BaseCombatAIComponent.h"
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
#include "EntityInfo.h"
|
#include "EntityInfo.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
|
|
||||||
void AmShieldGeneratorQuickbuild::OnStartup(Entity* self) {
|
void AmShieldGeneratorQuickbuild::OnStartup(Entity* self) {
|
||||||
@ -100,7 +100,7 @@ void AmShieldGeneratorQuickbuild::OnTimerDone(Entity* self, std::string timerNam
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmShieldGeneratorQuickbuild::OnRebuildComplete(Entity* self, Entity* target) {
|
void AmShieldGeneratorQuickbuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
StartShield(self);
|
StartShield(self);
|
||||||
|
|
||||||
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
auto enemiesInProximity = self->GetVar<std::vector<LWOOBJID>>(u"Enemies");
|
||||||
@ -174,9 +174,9 @@ void AmShieldGeneratorQuickbuild::BuffPlayers(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AmShieldGeneratorQuickbuild::EnemyEnteredShield(Entity* self, Entity* intruder) {
|
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() != eQuickBuildState::COMPLETED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ public:
|
|||||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||||
void OnDie(Entity* self, Entity* killer) override;
|
void OnDie(Entity* self, Entity* killer) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
|
|
||||||
void StartShield(Entity* self);
|
void StartShield(Entity* self);
|
||||||
void BuffPlayers(Entity* self);
|
void BuffPlayers(Entity* self);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "ImgBrickConsoleQB.h"
|
#include "ImgBrickConsoleQB.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
@ -19,18 +19,18 @@ void ImgBrickConsoleQB::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
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() == eQuickBuildState::COMPLETED) {
|
||||||
if (!self->GetNetworkVar<bool>(u"used")) {
|
if (!self->GetNetworkVar<bool>(u"used")) {
|
||||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||||
|
|
||||||
auto bothBuilt = false;
|
auto bothBuilt = false;
|
||||||
|
|
||||||
for (auto* console : consoles) {
|
for (auto* console : consoles) {
|
||||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
if (consoleQuickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ void ImgBrickConsoleQB::SmashCanister(Entity* self) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
void ImgBrickConsoleQB::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto energyFX = 0;
|
auto energyFX = 0;
|
||||||
|
|
||||||
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
||||||
@ -145,9 +145,9 @@ void ImgBrickConsoleQB::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console");
|
||||||
|
|
||||||
for (auto* console : consoles) {
|
for (auto* console : consoles) {
|
||||||
auto* consoleRebuildComponent = console->GetComponent<RebuildComponent>();
|
auto* consoleQuickBuildComponent = console->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (consoleRebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
if (consoleQuickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,9 +166,9 @@ void ImgBrickConsoleQB::OnDie(Entity* self, Entity* killer) {
|
|||||||
|
|
||||||
self->SetVar(u"Died", true);
|
self->SetVar(u"Died", true);
|
||||||
|
|
||||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||||
auto offFX = 0;
|
auto offFX = 0;
|
||||||
|
|
||||||
const auto location = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"console"));
|
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) {
|
void ImgBrickConsoleQB::OnTimerDone(Entity* self, std::string timerName) {
|
||||||
if (timerName == "reset") {
|
if (timerName == "reset") {
|
||||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent->GetState() == eRebuildState::OPEN) {
|
if (quickBuildComponent->GetState() == eQuickBuildState::OPEN) {
|
||||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||||
}
|
}
|
||||||
} else if (timerName == "Die") {
|
} else if (timerName == "Die") {
|
||||||
|
@ -8,7 +8,7 @@ public:
|
|||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
void SpawnBrick(Entity* self);
|
void SpawnBrick(Entity* self);
|
||||||
void SmashCanister(Entity* self);
|
void SmashCanister(Entity* self);
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnDie(Entity* self, Entity* killer) override;
|
void OnDie(Entity* self, Entity* killer) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ void MastTeleport::OnStartup(Entity* self) {
|
|||||||
self->SetNetworkVar<std::string>(u"hookPreconditions", "154;44", UNASSIGNED_SYSTEM_ADDRESS);
|
self->SetNetworkVar<std::string>(u"hookPreconditions", "154;44", UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MastTeleport::OnRebuildComplete(Entity* self, Entity* target) {
|
void MastTeleport::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
if (Preconditions::Check(target, 154) && Preconditions::Check(target, 44)) {
|
if (Preconditions::Check(target, 154) && Preconditions::Check(target, 44)) {
|
||||||
self->SetVar<LWOOBJID>(u"userID", target->GetObjectID());
|
self->SetVar<LWOOBJID>(u"userID", target->GetObjectID());
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
class MastTeleport : public CppScripts::Script {
|
class MastTeleport : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#include "NjRailActivatorsServer.h"
|
#include "NjRailActivatorsServer.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
|
|
||||||
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
|
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
|
||||||
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
|
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
|
// 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() == eQuickBuildState::COMPLETED) {
|
||||||
auto* character = user->GetCharacter();
|
auto* character = user->GetCharacter();
|
||||||
if (character != nullptr) {
|
if (character != nullptr) {
|
||||||
character->SetPlayerFlag(flag, true);
|
character->SetPlayerFlag(flag, true);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "NjRailPostServer.h"
|
#include "NjRailPostServer.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
|
|
||||||
void NjRailPostServer::OnStartup(Entity* self) {
|
void NjRailPostServer::OnStartup(Entity* self) {
|
||||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
|
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -18,8 +18,8 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void NjRailPostServer::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
auto* relatedRail = GetRelatedRail(self);
|
auto* relatedRail = GetRelatedRail(self);
|
||||||
if (relatedRail == nullptr)
|
if (relatedRail == nullptr)
|
||||||
return;
|
return;
|
||||||
@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
self->SetNetworkVar(NetworkNotActiveVariable, false);
|
self->SetNetworkVar(NetworkNotActiveVariable, false);
|
||||||
} else if (state == eRebuildState::RESETTING) {
|
} else if (state == eQuickBuildState::RESETTING) {
|
||||||
auto* relatedRail = GetRelatedRail(self);
|
auto* relatedRail = GetRelatedRail(self);
|
||||||
if (relatedRail == nullptr)
|
if (relatedRail == nullptr)
|
||||||
return;
|
return;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class NjRailPostServer : public CppScripts::Script {
|
class NjRailPostServer : public CppScripts::Script {
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
private:
|
private:
|
||||||
Entity* GetRelatedRail(Entity* self);
|
Entity* GetRelatedRail(Entity* self);
|
||||||
const std::u16string NetworkNotActiveVariable = u"NetworkNotActive";
|
const std::u16string NetworkNotActiveVariable = u"NetworkNotActive";
|
||||||
|
@ -11,7 +11,7 @@ void PropertyDevice::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
|
void PropertyDevice::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto propertyOwnerID = self->GetNetworkVar<std::string>(m_PropertyOwnerVariable);
|
auto propertyOwnerID = self->GetNetworkVar<std::string>(m_PropertyOwnerVariable);
|
||||||
if (propertyOwnerID == std::to_string(LWOOBJID_EMPTY))
|
if (propertyOwnerID == std::to_string(LWOOBJID_EMPTY))
|
||||||
return;
|
return;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
class PropertyDevice : public CppScripts::Script {
|
class PropertyDevice : public CppScripts::Script {
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
const std::u16string m_PropertyOwnerVariable = u"PropertyOwnerID";
|
const std::u16string m_PropertyOwnerVariable = u"PropertyOwnerID";
|
||||||
const uint32_t m_PropertyMissionID = 1291;
|
const uint32_t m_PropertyMissionID = 1291;
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "PropertyPlatform.h"
|
#include "PropertyPlatform.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "MovingPlatformComponent.h"
|
#include "MovingPlatformComponent.h"
|
||||||
|
|
||||||
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||||
// if (movingPlatform != nullptr) {
|
// if (movingPlatform != nullptr) {
|
||||||
// movingPlatform->StopPathing();
|
// movingPlatform->StopPathing();
|
||||||
@ -14,8 +14,8 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
|
void PropertyPlatform::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() == eQuickBuildState::COMPLETED) {
|
||||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||||
// if (movingPlatform != nullptr) {
|
// if (movingPlatform != nullptr) {
|
||||||
// movingPlatform->GotoWaypoint(1);
|
// movingPlatform->GotoWaypoint(1);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class PropertyPlatform : public CppScripts::Script {
|
class PropertyPlatform : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
private:
|
private:
|
||||||
float_t movementDelay = 10.0f;
|
float_t movementDelay = 10.0f;
|
||||||
float_t effectDelay = 5.0f;
|
float_t effectDelay = 5.0f;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "CDObjectSkillsTable.h"
|
#include "CDObjectSkillsTable.h"
|
||||||
#include "CDSkillBehaviorTable.h"
|
#include "CDSkillBehaviorTable.h"
|
||||||
|
|
||||||
void QbEnemyStunner::OnRebuildComplete(Entity* self, Entity* target) {
|
void QbEnemyStunner::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||||
|
|
||||||
if (destroyable != nullptr) {
|
if (destroyable != nullptr) {
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
class QbEnemyStunner : public CppScripts::Script
|
class QbEnemyStunner : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "eTerminateType.h"
|
#include "eTerminateType.h"
|
||||||
#include "ePlayerFlag.h"
|
#include "ePlayerFlag.h"
|
||||||
|
|
||||||
@ -12,13 +12,13 @@ void NsTokenConsoleServer::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent == nullptr) {
|
if (quickBuildComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rebuildComponent->GetState() != eRebuildState::COMPLETED) {
|
if (quickBuildComponent->GetState() != eQuickBuildState::COMPLETED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
|
|
||||||
void NTPipeVisibilityServer::OnRebuildComplete(Entity* self, Entity* target) {
|
void NTPipeVisibilityServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
const auto flag = self->GetVar<int32_t>(u"flag");
|
const auto flag = self->GetVar<int32_t>(u"flag");
|
||||||
if (flag == 0) return;
|
if (flag == 0) return;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
class NTPipeVisibilityServer : public CppScripts::Script {
|
class NTPipeVisibilityServer : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //!__NTPIPEVISIBILITYSERVER__H__
|
#endif //!__NTPIPEVISIBILITYSERVER__H__
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
#include "ePlayerFlag.h"
|
#include "ePlayerFlag.h"
|
||||||
|
|
||||||
void NTImagimeterVisibility::OnRebuildComplete(Entity* self, Entity* target) {
|
void NTImagimeterVisibility::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto* character = target->GetCharacter();
|
auto* character = target->GetCharacter();
|
||||||
if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true);
|
if (character) character->SetPlayerFlag(ePlayerFlag::NT_PLINTH_REBUILD, true);
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
|
|
||||||
class NTImagimeterVisibility : public CppScripts::Script {
|
class NTImagimeterVisibility : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
|
|
||||||
void CatapultBouncerServer::OnRebuildComplete(Entity* self, Entity* target) {
|
void CatapultBouncerServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"Built", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"Built", 0, 0, LWOOBJID_EMPTY, "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
|
||||||
self->SetNetworkVar<bool>(u"Built", true);
|
self->SetNetworkVar<bool>(u"Built", true);
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
|
|
||||||
class CatapultBouncerServer : public CppScripts::Script {
|
class CatapultBouncerServer : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "CavePrisonCage.h"
|
#include "CavePrisonCage.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
@ -45,8 +45,8 @@ void CavePrisonCage::Setup(Entity* self, Spawner* spawner) {
|
|||||||
Game::entityManager->ConstructEntity(entity);
|
Game::entityManager->ConstructEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CavePrisonCage::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void CavePrisonCage::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state != eRebuildState::RESETTING) {
|
if (state != eQuickBuildState::RESETTING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,14 +68,14 @@ void CavePrisonCage::SpawnCounterweight(Entity* self, Spawner* spawner) {
|
|||||||
|
|
||||||
self->SetVar<LWOOBJID>(u"Counterweight", counterweight->GetObjectID());
|
self->SetVar<LWOOBJID>(u"Counterweight", counterweight->GetObjectID());
|
||||||
|
|
||||||
auto* rebuildComponent = counterweight->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = counterweight->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
rebuildComponent->AddRebuildStateCallback([this, self](eRebuildState state) {
|
quickBuildComponent->AddQuickBuildStateCallback([this, self](eQuickBuildState state) {
|
||||||
OnRebuildNotifyState(self, state);
|
OnQuickBuildNotifyState(self, state);
|
||||||
});
|
});
|
||||||
|
|
||||||
rebuildComponent->AddRebuildCompleteCallback([this, self](Entity* user) {
|
quickBuildComponent->AddQuickBuildCompleteCallback([this, self](Entity* user) {
|
||||||
// The counterweight is a simple mover, which is not implemented, so we'll just set it's position
|
// The counterweight is a simple mover, which is not implemented, so we'll just set it's position
|
||||||
auto* counterweight = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
auto* counterweight = Game::entityManager->GetEntity(self->GetVar<LWOOBJID>(u"Counterweight"));
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class CavePrisonCage : public CppScripts::Script {
|
|||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void Setup(Entity* self, Spawner* spawner);
|
void Setup(Entity* self, Spawner* spawner);
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void SpawnCounterweight(Entity* self, Spawner* spawner);
|
void SpawnCounterweight(Entity* self, Spawner* spawner);
|
||||||
void GetButton(Entity* self);
|
void GetButton(Entity* self);
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
#include "ImaginationShrineServer.h"
|
#include "ImaginationShrineServer.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
|
|
||||||
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
void ImaginationShrineServer::OnUse(Entity* self, Entity* user) {
|
||||||
// If the rebuild component is complete, use the shrine
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||||
// Use the shrine
|
// Use the shrine
|
||||||
BaseUse(self, user);
|
BaseUse(self, user);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ void RainOfArrows::OnStartup(Entity* self) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RainOfArrows::OnRebuildComplete(Entity* self, Entity* target) {
|
void RainOfArrows::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto myPos = self->GetPosition();
|
auto myPos = self->GetPosition();
|
||||||
auto myRot = self->GetRotation();
|
auto myRot = self->GetRotation();
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class RainOfArrows : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "NjMonastryBossInstance.h"
|
#include "NjMonastryBossInstance.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
@ -221,26 +221,26 @@ void NjMonastryBossInstance::HandleLedgedFrakjawSpawned(Entity* self, Entity* le
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* counterWeight) {
|
void NjMonastryBossInstance::HandleCounterWeightSpawned(Entity* self, Entity* counterWeight) {
|
||||||
auto* rebuildComponent = counterWeight->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = counterWeight->GetComponent<QuickBuildComponent>();
|
||||||
if (rebuildComponent != nullptr) {
|
if (quickBuildComponent != nullptr) {
|
||||||
rebuildComponent->AddRebuildStateCallback([this, self, counterWeight](eRebuildState state) {
|
quickBuildComponent->AddQuickBuildStateCallback([this, self, counterWeight](eQuickBuildState state) {
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case eRebuildState::BUILDING:
|
case eQuickBuildState::BUILDING:
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), PlayCinematicNotification,
|
||||||
0, 0, counterWeight->GetObjectID(),
|
0, 0, counterWeight->GetObjectID(),
|
||||||
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
|
BaseCounterweightQB + std::to_string(self->GetVar<uint32_t>(WaveNumberVariable)),
|
||||||
UNASSIGNED_SYSTEM_ADDRESS);
|
UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
return;
|
return;
|
||||||
case eRebuildState::INCOMPLETE:
|
case eQuickBuildState::INCOMPLETE:
|
||||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
|
GameMessages::SendNotifyClientObject(self->GetObjectID(), EndCinematicNotification,
|
||||||
0, 0, LWOOBJID_EMPTY, "",
|
0, 0, LWOOBJID_EMPTY, "",
|
||||||
UNASSIGNED_SYSTEM_ADDRESS);
|
UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
return;
|
return;
|
||||||
case eRebuildState::RESETTING:
|
case eQuickBuildState::RESETTING:
|
||||||
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
|
ActivityTimerStart(self, SpawnCounterWeightTimer, 0.0f, 0.0f);
|
||||||
return;
|
return;
|
||||||
case eRebuildState::COMPLETED: {
|
case eQuickBuildState::COMPLETED: {
|
||||||
// TODO: Move the platform?
|
// TODO: Move the platform?
|
||||||
|
|
||||||
// The counterweight is actually a moving platform and we should listen to the last waypoint event here
|
// The counterweight is actually a moving platform and we should listen to the last waypoint event here
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
#include "TeamManager.h"
|
#include "TeamManager.h"
|
||||||
|
|
||||||
void AgSurvivalBuffStation::OnRebuildComplete(Entity* self, Entity* target) {
|
void AgSurvivalBuffStation::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||||
// We set the faction to 1 so that the buff station sees players as friendly targets to buff
|
// We set the faction to 1 so that the buff station sees players as friendly targets to buff
|
||||||
if (destroyableComponent != nullptr) destroyableComponent->SetFaction(1);
|
if (destroyableComponent != nullptr) destroyableComponent->SetFaction(1);
|
||||||
|
@ -10,7 +10,7 @@ public:
|
|||||||
* @param self The Entity that called this script.
|
* @param self The Entity that called this script.
|
||||||
* @param target The target of the self that called this script.
|
* @param target The target of the self that called this script.
|
||||||
*/
|
*/
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@ class Entity;
|
|||||||
class NiPoint3;
|
class NiPoint3;
|
||||||
enum class eMissionState : int32_t;
|
enum class eMissionState : int32_t;
|
||||||
enum class ePetTamingNotifyType : uint32_t;
|
enum class ePetTamingNotifyType : uint32_t;
|
||||||
enum class eRebuildState : uint32_t;
|
enum class eQuickBuildState : uint32_t;
|
||||||
|
|
||||||
namespace CppScripts {
|
namespace CppScripts {
|
||||||
/**
|
/**
|
||||||
@ -154,23 +154,23 @@ namespace CppScripts {
|
|||||||
/**
|
/**
|
||||||
* Invoked when a player has started building this quickbuild.
|
* Invoked when a player has started building this quickbuild.
|
||||||
*
|
*
|
||||||
* Equivalent to 'function onRebuildStart(self, msg)'
|
* Equivalent to 'function onQuickBuildStart(self, msg)'
|
||||||
*/
|
*/
|
||||||
virtual void OnRebuildStart(Entity* self, Entity* target) {};
|
virtual void OnQuickBuildStart(Entity* self, Entity* target) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when this quickbuild has changed state.
|
* Invoked when this quickbuild has changed state.
|
||||||
*
|
*
|
||||||
* Equivalent to 'function onRebuildNotifyState(self, msg)'
|
* Equivalent to 'function onQuickBuildNotifyState(self, msg)'
|
||||||
*/
|
*/
|
||||||
virtual void OnRebuildNotifyState(Entity* self, eRebuildState state) {};
|
virtual void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when this quickbuild has been completed.
|
* Invoked when this quickbuild has been completed.
|
||||||
*
|
*
|
||||||
* Equivalent to 'function onRebuildComplete(self, msg)'
|
* Equivalent to 'function OnQuickBuildComplete(self, msg)'
|
||||||
*/
|
*/
|
||||||
virtual void OnRebuildComplete(Entity* self, Entity* target) {};
|
virtual void OnQuickBuildComplete(Entity* self, Entity* target) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when self has received either a hit or heal.
|
* Invoked when self has received either a hit or heal.
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
#include "ActMine.h"
|
#include "ActMine.h"
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
|
|
||||||
void ActMine::OnStartup(Entity* self) {
|
void ActMine::OnStartup(Entity* self) {
|
||||||
self->SetVar(u"RebuildComplete", false);
|
self->SetVar(u"QuickBuildComplete", false);
|
||||||
self->SetProximityRadius(MINE_RADIUS, "mineRadius");
|
self->SetProximityRadius(MINE_RADIUS, "mineRadius");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void ActMine::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
auto* rebuild = self->GetComponent<RebuildComponent>();
|
auto* rebuild = self->GetComponent<QuickBuildComponent>();
|
||||||
if (rebuild) {
|
if (rebuild) {
|
||||||
auto* builder = rebuild->GetBuilder();
|
auto* builder = rebuild->GetBuilder();
|
||||||
self->SetVar(u"Builder", builder->GetObjectID());
|
self->SetVar(u"Builder", builder->GetObjectID());
|
||||||
}
|
}
|
||||||
|
|
||||||
self->SetVar(u"RebuildComplete", true);
|
self->SetVar(u"QuickBuildComplete", true);
|
||||||
self->SetVar(u"NumWarnings", 0);
|
self->SetVar(u"NumWarnings", 0);
|
||||||
self->AddToGroup("reset");
|
self->AddToGroup("reset");
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ void ActMine::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
|||||||
void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
void ActMine::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||||
auto* detroyable = self->GetComponent<DestroyableComponent>();
|
auto* detroyable = self->GetComponent<DestroyableComponent>();
|
||||||
if (!detroyable) return;
|
if (!detroyable) return;
|
||||||
if (status == "ENTER" && self->GetVar<bool>(u"RebuildComplete") == true && detroyable->IsEnemy(entering)) {
|
if (status == "ENTER" && self->GetVar<bool>(u"QuickBuildComplete") == true && detroyable->IsEnemy(entering)) {
|
||||||
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
|
GameMessages::SendPlayFXEffect(self->GetObjectID(), 242, u"orange", "sirenlight_B");
|
||||||
self->AddTimer("Tick", TICK_TIME);
|
self->AddTimer("Tick", TICK_TIME);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class ActMine : public CppScripts::Script {
|
class ActMine : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
private:
|
private:
|
||||||
|
@ -20,7 +20,7 @@ void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
|
|||||||
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
self->AddTimer("CineDone", 7.5f + 5.0f); // 7.5f is time the cinematic takes to play
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgJetEffectServer::OnRebuildComplete(Entity* self, Entity* target) {
|
void AgJetEffectServer::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
if (self->GetLOT() != 6209) return;
|
if (self->GetLOT() != 6209) return;
|
||||||
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
|
auto entities = Game::entityManager->GetEntitiesInGroup("Jet_FX");
|
||||||
if (entities.empty()) return;
|
if (entities.empty()) return;
|
||||||
|
@ -6,7 +6,7 @@ class AgJetEffectServer final : public CppScripts::Script
|
|||||||
public:
|
public:
|
||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
|
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
|
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
private:
|
private:
|
||||||
|
@ -7,7 +7,7 @@ void AgQbElevator::OnStartup(Entity* self) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//when the QB is finished being built by a player
|
//when the QB is finished being built by a player
|
||||||
void AgQbElevator::OnRebuildComplete(Entity* self, Entity* target) {
|
void AgQbElevator::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
self->SetProximityRadius(proxRadius, "elevatorProx");
|
self->SetProximityRadius(proxRadius, "elevatorProx");
|
||||||
self->SetI64(u"qbPlayer", target->GetObjectID());
|
self->SetI64(u"qbPlayer", target->GetObjectID());
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class AgQbElevator : public CppScripts::Script {
|
class AgQbElevator : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
void OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "AgQbWall.h"
|
#include "AgQbWall.h"
|
||||||
|
|
||||||
void AgQbWall::OnRebuildComplete(Entity* self, Entity* player) {
|
void AgQbWall::OnQuickBuildComplete(Entity* self, Entity* player) {
|
||||||
self->SetVar(u"player", player->GetObjectID());
|
self->SetVar(u"player", player->GetObjectID());
|
||||||
auto targetWallSpawners = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner"));
|
auto targetWallSpawners = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner"));
|
||||||
if (targetWallSpawners != "") {
|
if (targetWallSpawners != "") {
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
|
|
||||||
class AgQbWall : public CppScripts::Script {
|
class AgQbWall : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* player) override;
|
void OnQuickBuildComplete(Entity* self, Entity* player) override;
|
||||||
};
|
};
|
||||||
|
@ -12,6 +12,6 @@ void AgTurret::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AgTurret::OnRebuildStart(Entity* self, Entity* user) {
|
void AgTurret::OnQuickBuildStart(Entity* self, Entity* user) {
|
||||||
GameMessages::SendLockNodeRotation(self, "base");
|
GameMessages::SendLockNodeRotation(self, "base");
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@
|
|||||||
class AgTurret : public CppScripts::Script {
|
class AgTurret : public CppScripts::Script {
|
||||||
void OnStartup(Entity* self);
|
void OnStartup(Entity* self);
|
||||||
void OnTimerDone(Entity* self, std::string timerName);
|
void OnTimerDone(Entity* self, std::string timerName);
|
||||||
void OnRebuildStart(Entity* self, Entity* user);
|
void OnQuickBuildStart(Entity* self, Entity* user);
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "ActNinjaTurret.h"
|
#include "ActNinjaTurret.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
void ActNinjaTurret::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void ActNinjaTurret::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
self->SetVar(u"AmBuilt", true);
|
self->SetVar(u"AmBuilt", true);
|
||||||
} else if (state == eRebuildState::RESETTING) {
|
} else if (state == eQuickBuildState::RESETTING) {
|
||||||
self->SetVar(u"AmBuilt", false);
|
self->SetVar(u"AmBuilt", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class ActNinjaTurret : public CppScripts::Script
|
class ActNinjaTurret : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||||
int32_t param3) override;
|
int32_t param3) override;
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "ActParadoxPipeFix.h"
|
#include "ActParadoxPipeFix.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "eEndBehavior.h"
|
#include "eEndBehavior.h"
|
||||||
|
|
||||||
void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
void ActParadoxPipeFix::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
const auto myGroup = "AllPipes";
|
const auto myGroup = "AllPipes";
|
||||||
|
|
||||||
const auto groupObjs = Game::entityManager->GetEntitiesInGroup(myGroup);
|
const auto groupObjs = Game::entityManager->GetEntitiesInGroup(myGroup);
|
||||||
@ -19,9 +19,9 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* rebuildComponent = object->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = object->GetComponent<QuickBuildComponent>();
|
||||||
|
|
||||||
if (rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
if (quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||||
indexCount++;
|
indexCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -51,8 +51,8 @@ void ActParadoxPipeFix::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActParadoxPipeFix::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void ActParadoxPipeFix::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::RESETTING) {
|
if (state == eQuickBuildState::RESETTING) {
|
||||||
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
const auto refinery = Game::entityManager->GetEntitiesInGroup("Paradox");
|
||||||
|
|
||||||
if (!refinery.empty()) {
|
if (!refinery.empty()) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
class ActParadoxPipeFix : public CppScripts::Script
|
class ActParadoxPipeFix : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "GeneralUtils.h"
|
#include "GeneralUtils.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "Spawner.h"
|
#include "Spawner.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
|
|
||||||
void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
||||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
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) {
|
void FvBrickPuzzleServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||||
if (timerName == "reset") {
|
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() == eQuickBuildState::OPEN) {
|
||||||
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
self->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "eTerminateType.h"
|
#include "eTerminateType.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
void FvConsoleLeftQuickbuild::OnStartup(Entity* self) {
|
||||||
self->SetVar(u"IAmBuilt", false);
|
self->SetVar(u"IAmBuilt", false);
|
||||||
self->SetVar(u"AmActive", false);
|
self->SetVar(u"AmActive", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void FvConsoleLeftQuickbuild::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
self->SetVar(u"IAmBuilt", true);
|
self->SetVar(u"IAmBuilt", true);
|
||||||
|
|
||||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||||
@ -18,7 +18,7 @@ void FvConsoleLeftQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState s
|
|||||||
if (!objects.empty()) {
|
if (!objects.empty()) {
|
||||||
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
objects[0]->NotifyObject(self, "ConsoleLeftUp");
|
||||||
}
|
}
|
||||||
} else if (state == eRebuildState::RESETTING) {
|
} else if (state == eQuickBuildState::RESETTING) {
|
||||||
self->SetVar(u"IAmBuilt", false);
|
self->SetVar(u"IAmBuilt", false);
|
||||||
self->SetVar(u"AmActive", false);
|
self->SetVar(u"AmActive", false);
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@ class FvConsoleLeftQuickbuild : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
};
|
};
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "eTerminateType.h"
|
#include "eTerminateType.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
void FvConsoleRightQuickbuild::OnStartup(Entity* self) {
|
||||||
self->SetVar(u"IAmBuilt", false);
|
self->SetVar(u"IAmBuilt", false);
|
||||||
self->SetVar(u"AmActive", false);
|
self->SetVar(u"AmActive", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void FvConsoleRightQuickbuild::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
self->SetVar(u"IAmBuilt", true);
|
self->SetVar(u"IAmBuilt", true);
|
||||||
|
|
||||||
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
const auto objects = Game::entityManager->GetEntitiesInGroup("Facility");
|
||||||
@ -18,7 +18,7 @@ void FvConsoleRightQuickbuild::OnRebuildNotifyState(Entity* self, eRebuildState
|
|||||||
if (!objects.empty()) {
|
if (!objects.empty()) {
|
||||||
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
objects[0]->NotifyObject(self, "ConsoleRightUp");
|
||||||
}
|
}
|
||||||
} else if (state == eRebuildState::RESETTING) {
|
} else if (state == eQuickBuildState::RESETTING) {
|
||||||
self->SetVar(u"IAmBuilt", false);
|
self->SetVar(u"IAmBuilt", false);
|
||||||
self->SetVar(u"AmActive", false);
|
self->SetVar(u"AmActive", false);
|
||||||
|
|
||||||
|
@ -5,6 +5,6 @@ class FvConsoleRightQuickbuild : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void OnUse(Entity* self, Entity* user) override;
|
void OnUse(Entity* self, Entity* user) override;
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RenderComponent.h"
|
#include "RenderComponent.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
void FvDragonSmashingGolemQb::OnStartup(Entity* self) {
|
||||||
self->AddTimer("GolemBreakTimer", 10.5f);
|
self->AddTimer("GolemBreakTimer", 10.5f);
|
||||||
@ -15,8 +15,8 @@ void FvDragonSmashingGolemQb::OnTimerDone(Entity* self, std::string timerName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FvDragonSmashingGolemQb::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void FvDragonSmashingGolemQb::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::COMPLETED) {
|
if (state == eQuickBuildState::COMPLETED) {
|
||||||
RenderComponent::PlayAnimation(self, u"dragonsmash");
|
RenderComponent::PlayAnimation(self, u"dragonsmash");
|
||||||
|
|
||||||
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
const auto dragonId = self->GetVar<LWOOBJID>(u"Dragon");
|
||||||
|
@ -6,5 +6,5 @@ class FvDragonSmashingGolemQb : public CppScripts::Script
|
|||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
};
|
};
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "SkillComponent.h"
|
#include "SkillComponent.h"
|
||||||
|
|
||||||
void GfArchway::OnRebuildComplete(Entity* self, Entity* target) {
|
void GfArchway::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto* skillComponent = target->GetComponent<SkillComponent>();
|
auto* skillComponent = target->GetComponent<SkillComponent>();
|
||||||
if (skillComponent) skillComponent->CalculateBehavior(SHIELDING_SKILL, SHIELDING_BEHAVIOR, target->GetObjectID(), true);
|
if (skillComponent) skillComponent->CalculateBehavior(SHIELDING_SKILL, SHIELDING_BEHAVIOR, target->GetObjectID(), true);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
class GfArchway : public CppScripts::Script {
|
class GfArchway : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
private:
|
private:
|
||||||
const uint32_t SHIELDING_SKILL = 863;
|
const uint32_t SHIELDING_SKILL = 863;
|
||||||
const uint32_t SHIELDING_BEHAVIOR = 3788;
|
const uint32_t SHIELDING_BEHAVIOR = 3788;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "GfJailWalls.h"
|
#include "GfJailWalls.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "GeneralUtils.h"
|
#include "GeneralUtils.h"
|
||||||
#include "eRebuildState.h"
|
#include "eQuickBuildState.h"
|
||||||
|
|
||||||
void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
void GfJailWalls::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||||
|
|
||||||
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
for (auto* spawner : Game::zoneManager->GetSpawnersByName("Jail0" + wall)) {
|
||||||
@ -15,8 +15,8 @@ void GfJailWalls::OnRebuildComplete(Entity* self, Entity* target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GfJailWalls::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void GfJailWalls::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state != eRebuildState::RESETTING) return;
|
if (state != eQuickBuildState::RESETTING) return;
|
||||||
|
|
||||||
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
const auto wall = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Wall"));
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
class GfJailWalls final : public CppScripts::Script
|
class GfJailWalls final : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "eMissionState.h"
|
#include "eMissionState.h"
|
||||||
|
|
||||||
void PetDigBuild::OnRebuildComplete(Entity* self, Entity* target) {
|
void PetDigBuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
auto flagNumber = self->GetVar<std::u16string>(u"flagNum");
|
auto flagNumber = self->GetVar<std::u16string>(u"flagNum");
|
||||||
|
|
||||||
EntityInfo info{};
|
EntityInfo info{};
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
class PetDigBuild : public CppScripts::Script
|
class PetDigBuild : public CppScripts::Script
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnRebuildComplete(Entity* self, Entity* target);
|
void OnQuickBuildComplete(Entity* self, Entity* target);
|
||||||
void OnDie(Entity* self, Entity* killer);
|
void OnDie(Entity* self, Entity* killer);
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "RebuildComponent.h"
|
#include "QuickBuildComponent.h"
|
||||||
#include "SoundTriggerComponent.h"
|
#include "SoundTriggerComponent.h"
|
||||||
#include "InventoryComponent.h"
|
#include "InventoryComponent.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
@ -20,13 +20,13 @@ void NsConcertInstrument::OnStartup(Entity* self) {
|
|||||||
self->SetVar<LWOOBJID>(u"oldItemRight", LWOOBJID_EMPTY);
|
self->SetVar<LWOOBJID>(u"oldItemRight", LWOOBJID_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
void NsConcertInstrument::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||||
if (state == eRebuildState::RESETTING || state == eRebuildState::OPEN) {
|
if (state == eQuickBuildState::RESETTING || state == eQuickBuildState::OPEN) {
|
||||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NsConcertInstrument::OnRebuildComplete(Entity* self, Entity* target) {
|
void NsConcertInstrument::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
if (!target->GetIsDead()) {
|
if (!target->GetIsDead()) {
|
||||||
self->SetVar<LWOOBJID>(u"activePlayer", target->GetObjectID());
|
self->SetVar<LWOOBJID>(u"activePlayer", target->GetObjectID());
|
||||||
|
|
||||||
@ -93,9 +93,9 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
|
|||||||
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
activePlayer->GetObjectID(), "", UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||||
if (rebuildComponent != nullptr)
|
if (quickBuildComponent != nullptr)
|
||||||
rebuildComponent->ResetRebuild(false);
|
quickBuildComponent->ResetQuickBuild(false);
|
||||||
|
|
||||||
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
||||||
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
|
||||||
|
@ -11,10 +11,10 @@ enum InstrumentLot {
|
|||||||
class NsConcertInstrument : public CppScripts::Script {
|
class NsConcertInstrument : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||||
int32_t param3) override;
|
int32_t param3) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string name) override;
|
void OnTimerDone(Entity* self, std::string name) override;
|
||||||
private:
|
private:
|
||||||
static void StartPlayingInstrument(Entity* self, Entity* player);
|
static void StartPlayingInstrument(Entity* self, Entity* player);
|
||||||
|
@ -80,7 +80,7 @@ void NsConcertQuickBuild::OnDie(Entity* self, Entity* killer) {
|
|||||||
finishedQuickBuilds.erase(position);
|
finishedQuickBuilds.erase(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NsConcertQuickBuild::OnRebuildComplete(Entity* self, Entity* target) {
|
void NsConcertQuickBuild::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
const auto groupNumber = self->GetVar<int32_t>(u"groupNumber");
|
const auto groupNumber = self->GetVar<int32_t>(u"groupNumber");
|
||||||
finishedQuickBuilds.push_back(self->GetObjectID());
|
finishedQuickBuilds.push_back(self->GetObjectID());
|
||||||
self->SetNetworkVar<float>(u"startEffect", -1.0f);
|
self->SetNetworkVar<float>(u"startEffect", -1.0f);
|
||||||
|
@ -9,7 +9,7 @@ struct QuickBuildSet {
|
|||||||
class NsConcertQuickBuild : public CppScripts::Script {
|
class NsConcertQuickBuild : public CppScripts::Script {
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnDie(Entity* self, Entity* killer) override;
|
void OnDie(Entity* self, Entity* killer) override;
|
||||||
private:
|
private:
|
||||||
static std::vector<LWOOBJID> finishedQuickBuilds;
|
static std::vector<LWOOBJID> finishedQuickBuilds;
|
||||||
|
@ -6,7 +6,7 @@ void NsQbImaginationStatue::OnStartup(Entity* self) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NsQbImaginationStatue::OnRebuildComplete(Entity* self, Entity* target) {
|
void NsQbImaginationStatue::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||||
if (target == nullptr) return;
|
if (target == nullptr) return;
|
||||||
|
|
||||||
self->SetVar(u"Player", target->GetObjectID());
|
self->SetVar(u"Player", target->GetObjectID());
|
||||||
|
@ -5,7 +5,7 @@ class NsQbImaginationStatue : public CppScripts::Script
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void OnStartup(Entity* self) override;
|
void OnStartup(Entity* self) override;
|
||||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||||
void SpawnLoot(Entity* self);
|
void SpawnLoot(Entity* self);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user