breakout the component types into a scoped enum (#1002)

* breakout the component types into a scoped enum

tested that things are the same as they were before

* fix missed rename

* fix brick-by-brick name to be crafting
because that's what it is
This commit is contained in:
Aaron Kimbrell
2023-03-04 01:16:37 -06:00
committed by GitHub
parent 2837f68f44
commit e524b86e12
106 changed files with 598 additions and 430 deletions

View File

@@ -13,6 +13,7 @@
#include "GameMessages.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
#include <vector>
@@ -27,9 +28,9 @@ void BossSpiderQueenEnemyServer::OnStartup(Entity* self) {
//self:SetStatusImmunity{ StateChangeType = "PUSH", bImmuneToPullToPoint = true, bImmuneToKnockback = true, bImmuneToInterrupt = true }
//Get our components:
destroyable = static_cast<DestroyableComponent*>(self->GetComponent(COMPONENT_TYPE_DESTROYABLE));
controllable = static_cast<ControllablePhysicsComponent*>(self->GetComponent(COMPONENT_TYPE_CONTROLLABLE_PHYSICS));
combat = static_cast<BaseCombatAIComponent*>(self->GetComponent(COMPONENT_TYPE_BASE_COMBAT_AI));
destroyable = static_cast<DestroyableComponent*>(self->GetComponent(eReplicaComponentType::DESTROYABLE));
controllable = static_cast<ControllablePhysicsComponent*>(self->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
combat = static_cast<BaseCombatAIComponent*>(self->GetComponent(eReplicaComponentType::BASE_COMBAT_AI));
if (!destroyable || !controllable) return;
@@ -397,7 +398,7 @@ void BossSpiderQueenEnemyServer::RapidFireShooterManager(Entity* self) {
void BossSpiderQueenEnemyServer::RunRapidFireShooter(Entity* self) {
/*
const auto targets = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_CHARACTER);
const auto targets = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::CHARACTER);
*/
const auto targets = self->GetTargetsInPhantom();

View File

@@ -6,6 +6,7 @@
#include "EntityInfo.h"
#include "GeneralUtils.h"
#include "DestroyableComponent.h"
#include "eReplicaComponentType.h"
void BaseEnemyMech::OnStartup(Entity* self) {
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
@@ -15,7 +16,7 @@ void BaseEnemyMech::OnStartup(Entity* self) {
}
void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
ControllablePhysicsComponent* controlPhys = static_cast<ControllablePhysicsComponent*>(self->GetComponent(COMPONENT_TYPE_CONTROLLABLE_PHYSICS));
ControllablePhysicsComponent* controlPhys = static_cast<ControllablePhysicsComponent*>(self->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
if (!controlPhys) return;
NiPoint3 newLoc = { controlPhys->GetPosition().x, dpWorld::Instance().GetNavMesh()->GetHeightAtPoint(controlPhys->GetPosition()), controlPhys->GetPosition().z };

View File

@@ -3,6 +3,7 @@
#include "GameMessages.h"
#include "Character.h"
#include "EntityManager.h"
#include "eReplicaComponentType.h"
void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
//Tell the client to spawn the baby spiderling:
@@ -19,7 +20,7 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
character->SetPlayerFlag(74, true);
//Remove the maelstrom cube:
auto inv = static_cast<InventoryComponent*>(user->GetComponent(COMPONENT_TYPE_INVENTORY));
auto inv = static_cast<InventoryComponent*>(user->GetComponent(eReplicaComponentType::INVENTORY));
if (inv) {
inv->RemoveItem(14553, 1);

View File

@@ -5,10 +5,11 @@
#include "EntityManager.h"
#include "AgMonumentLaserServer.h"
#include "EntityManager.h"
#include "eReplicaComponentType.h"
void AgLaserSensorServer::OnStartup(Entity* self) {
PhantomPhysicsComponent* physComp = static_cast<PhantomPhysicsComponent*>(self->GetComponent(COMPONENT_TYPE_PHANTOM_PHYSICS));
PhantomPhysicsComponent* physComp = static_cast<PhantomPhysicsComponent*>(self->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
physComp->SetPhysicsEffectActive(true);
physComp->SetEffectType(2); // repulse (prolly should make definitions of these are in Entity.cpp)
physComp->SetDirectionalMultiplier(static_cast<float>(m_RepelForce));
@@ -25,7 +26,7 @@ void AgLaserSensorServer::OnCollisionPhantom(Entity* self, Entity* target) {
Entity* laser = nullptr;
for (auto script : EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_SCRIPT)) {
for (auto script : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SCRIPT)) {
AgMonumentLaserServer* hasLaser = (AgMonumentLaserServer*)script;

View File

@@ -4,6 +4,7 @@
#include "MissionComponent.h"
#include "Item.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionID != mailMission) return;
@@ -11,7 +12,7 @@ void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int
if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"switch", 0, 0, LWOOBJID_EMPTY, "", target->GetSystemAddress());
auto* inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY));
auto* inv = static_cast<InventoryComponent*>(target->GetComponent(eReplicaComponentType::INVENTORY));
// If we are ready to complete our missions, we take the kit from you:
if (inv && missionState == eMissionState::READY_TO_COMPLETE) {
@@ -22,7 +23,7 @@ void NpcNjAssistantServer::OnMissionDialogueOK(Entity* self, Entity* target, int
}
}
} else if (missionState == eMissionState::AVAILABLE) {
auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(COMPONENT_TYPE_MISSION));
auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(eReplicaComponentType::MISSION));
missionComponent->CompleteMission(mailAchievement, true);
}
}

View File

@@ -3,6 +3,7 @@
#include "Item.h"
#include "eMissionState.h"
#include "Character.h"
#include "eReplicaComponentType.h"
/*
--------------------------------------------------------------
@@ -21,7 +22,7 @@ void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int mis
if (missionID != defaultMission && missionID != 313) return;
if (missionState == eMissionState::COMPLETE || missionState == eMissionState::READY_TO_COMPLETE) {
auto inv = static_cast<InventoryComponent*>(target->GetComponent(COMPONENT_TYPE_INVENTORY));
auto inv = static_cast<InventoryComponent*>(target->GetComponent(eReplicaComponentType::INVENTORY));
if (!inv) return;
//remove the inventory items

View File

@@ -1,11 +1,12 @@
#include "FvCandle.h"
#include "MissionComponent.h"
#include "RenderComponent.h"
#include "eReplicaComponentType.h"
std::vector<int32_t> FvCandle::m_Missions = { 850, 1431, 1529, 1566, 1603 };
void FvCandle::OnStartup(Entity* self) {
auto* render = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (render == nullptr)
return;
@@ -22,7 +23,7 @@ void FvCandle::BlowOutCandle(Entity* self, Entity* blower) {
if (self->GetBoolean(u"AmHit"))
return;
auto* render = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (render == nullptr)
return;
@@ -46,7 +47,7 @@ void FvCandle::BlowOutCandle(Entity* self, Entity* blower) {
void FvCandle::OnTimerDone(Entity* self, std::string timerName) {
self->SetBoolean(u"AmHit", false);
auto* render = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (render == nullptr)
return;

View File

@@ -4,6 +4,7 @@
#include "MissionComponent.h"
#include "RenderComponent.h"
#include "eMissionTaskType.h"
#include "eReplicaComponentType.h"
void GfTikiTorch::OnStartup(Entity* self) {
LightTorch(self);
@@ -42,7 +43,7 @@ void GfTikiTorch::OnTimerDone(Entity* self, std::string timerName) {
}
void GfTikiTorch::LightTorch(Entity* self) {
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (renderComponent == nullptr)
return;

View File

@@ -2,11 +2,12 @@
#include "InventoryComponent.h"
#include "GameMessages.h"
#include "Character.h"
#include "eReplicaComponentType.h"
//2021-05-03 - max - added script, omitted some parts related to inheritance in lua which we don't need
void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
auto* inv = static_cast<InventoryComponent*>(user->GetComponent(COMPONENT_TYPE_INVENTORY));
auto* inv = static_cast<InventoryComponent*>(user->GetComponent(eReplicaComponentType::INVENTORY));
//make sure the user has the required amount of infected bricks
if (inv && inv->GetLotCount(6194) >= bricksToTake) {

View File

@@ -4,6 +4,7 @@
#include "GameMessages.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void TouchMissionUpdateServer::OnStartup(Entity* self) {
self->SetProximityRadius(20, "touchCheck"); // Those does not have a collider for some reason?
@@ -16,7 +17,7 @@ void TouchMissionUpdateServer::OnCollisionPhantom(Entity* self, Entity* target)
return;
}
auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(COMPONENT_TYPE_MISSION));
auto* missionComponent = static_cast<MissionComponent*>(target->GetComponent(eReplicaComponentType::MISSION));
if (missionComponent == nullptr) {
return;

View File

@@ -3,6 +3,7 @@
#include "EntityManager.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
#include "eReplicaComponentType.h"
//----------------------------------------------
//--Initiate egg hatching on call
@@ -14,7 +15,7 @@ void EnemySpiderSpawner::OnFireEventServerSide(Entity* self, Entity* sender, std
GameMessages::SendPlayFXEffect(self->GetObjectID(), 2856, u"maelstrom", "test", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
// Make indestructible
auto dest = static_cast<DestroyableComponent*>(self->GetComponent(COMPONENT_TYPE_DESTROYABLE));
auto dest = static_cast<DestroyableComponent*>(self->GetComponent(eReplicaComponentType::DESTROYABLE));
if (dest) {
dest->SetFaction(-1);
}

View File

@@ -7,6 +7,7 @@
#include "RenderComponent.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void ZoneAgProperty::SetGameVariables(Entity* self) {
self->SetVar<std::string>(GuardGroup, "Guard");
@@ -256,7 +257,7 @@ void ZoneAgProperty::BaseTimerDone(Entity* self, const std::string& timerName) {
DeactivateSpawner(self->GetVar<std::string>(SpiderScreamSpawner));
DestroySpawner(self->GetVar<std::string>(SpiderScreamSpawner));
for (auto* player : EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_CHARACTER)) {
for (auto* player : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::CHARACTER)) {
GameMessages::SendStop2DAmbientSound(player, true, GUIDMaelstrom);
GameMessages::SendPlay2DAmbientSound(player, GUIDPeaceful);
}

View File

@@ -1,12 +1,13 @@
#include "SsModularBuildServer.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void SsModularBuildServer::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) {
int missionNum = 1732;
if (bCompleted) {
MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(eReplicaComponentType::MISSION));
Mission* rocketMission = mission->GetMission(missionNum);
if (rocketMission->GetMissionState() == eMissionState::ACTIVE) {

View File

@@ -5,6 +5,7 @@
#include "GameMessages.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void NtFactionSpyServer::OnStartup(Entity* self) {
SetVariables(self);
@@ -13,7 +14,7 @@ void NtFactionSpyServer::OnStartup(Entity* self) {
auto* proximityMonitor = self->GetComponent<ProximityMonitorComponent>();
if (proximityMonitor == nullptr) {
proximityMonitor = new ProximityMonitorComponent(self, -1, -1);
self->AddComponent(COMPONENT_TYPE_PROXIMITY_MONITOR, proximityMonitor);
self->AddComponent(eReplicaComponentType::PROXIMITY_MONITOR, proximityMonitor);
}
proximityMonitor->SetProximityRadius(self->GetVar<float_t>(m_SpyProximityVariable), m_ProximityName);

View File

@@ -9,6 +9,7 @@
#include "CppScripts.h"
#include "Component.h"
#include <string>
#include "eReplicaComponentType.h"
class Entity;
@@ -18,7 +19,7 @@ class Entity;
*/
class ScriptComponent : public Component {
public:
static const uint32_t ComponentType = COMPONENT_TYPE_SCRIPT;
static const eReplicaComponentType ComponentType = eReplicaComponentType::SCRIPT;
ScriptComponent(Entity* parent, std::string scriptName, bool serialized, bool client = false);
~ScriptComponent() override;

View File

@@ -4,6 +4,7 @@
#include "GameMessages.h"
#include "PhantomPhysicsComponent.h"
#include "RenderComponent.h"
#include "eReplicaComponentType.h"
void AgFans::OnStartup(Entity* self) {
self->SetVar<bool>(u"alive", true);
@@ -11,7 +12,7 @@ void AgFans::OnStartup(Entity* self) {
ToggleFX(self, false);
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (renderComponent == nullptr) {
return;
@@ -24,7 +25,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
std::string fanGroup = self->GetGroups()[0];
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (renderComponent == nullptr) {
return;
@@ -39,7 +40,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
self->SetVar<bool>(u"on", false);
for (Entity* volume : fanVolumes) {
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(COMPONENT_TYPE_PHANTOM_PHYSICS));
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
if (!volumePhys) continue;
volumePhys->SetPhysicsEffectActive(false);
EntityManager::Instance()->SerializeEntity(volume);
@@ -55,7 +56,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
self->SetVar<bool>(u"on", true);
for (Entity* volume : fanVolumes) {
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(COMPONENT_TYPE_PHANTOM_PHYSICS));
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
if (!volumePhys) continue;
volumePhys->SetPhysicsEffectActive(true);
EntityManager::Instance()->SerializeEntity(volume);

View File

@@ -4,12 +4,13 @@
#include "GameMessages.h"
#include "EntityInfo.h"
#include "DestroyableComponent.h"
#include "eReplicaComponentType.h"
void AgImagSmashable::OnDie(Entity* self, Entity* killer) {
bool maxImagGreaterThanZero = false;
if (killer) {
DestroyableComponent* dest = static_cast<DestroyableComponent*>(killer->GetComponent(COMPONENT_TYPE_DESTROYABLE));
DestroyableComponent* dest = static_cast<DestroyableComponent*>(killer->GetComponent(eReplicaComponentType::DESTROYABLE));
if (dest) {
maxImagGreaterThanZero = dest->GetMaxImagination() > 0;
}

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "EntityManager.h"
#include "SkillComponent.h"
#include "eReplicaComponentType.h"
void AgJetEffectServer::OnUse(Entity* self, Entity* user) {
if (inUse) {
@@ -86,12 +87,12 @@ void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
auto* mortar = entities[selected];
Game::logger->Log("AgJetEffectServer", "Mortar (%i) (&d)", mortar->GetLOT(), mortar->HasComponent(COMPONENT_TYPE_SKILL));
Game::logger->Log("AgJetEffectServer", "Mortar (%i) (&d)", mortar->GetLOT(), mortar->HasComponent(eReplicaComponentType::SKILL));
mortar->SetOwnerOverride(builder);
SkillComponent* skillComponent;
if (!mortar->TryGetComponent(COMPONENT_TYPE_SKILL, skillComponent)) {
if (!mortar->TryGetComponent(eReplicaComponentType::SKILL, skillComponent)) {
return;
}

View File

@@ -1,5 +1,6 @@
#include "AgStromlingProperty.h"
#include "MovementAIComponent.h"
#include "eReplicaComponentType.h"
void AgStromlingProperty::OnStartup(Entity* self) {
auto movementInfo = MovementAIInfo{
@@ -12,5 +13,5 @@ void AgStromlingProperty::OnStartup(Entity* self) {
};
auto* movementAIComponent = new MovementAIComponent(self, movementInfo);
self->AddComponent(COMPONENT_TYPE_MOVEMENT_AI, movementAIComponent);
self->AddComponent(eReplicaComponentType::MOVEMENT_AI, movementAIComponent);
}

View File

@@ -4,13 +4,14 @@
#include "MissionComponent.h"
#include "RenderComponent.h"
#include "EntityManager.h"
#include "eReplicaComponentType.h"
void GfCampfire::OnStartup(Entity* self) {
self->SetI32(u"counter", static_cast<int32_t>(0));
self->SetProximityRadius(2.0f, "placeholder");
self->SetBoolean(u"isBurning", true);
auto* render = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
if (render == nullptr)
return;
@@ -20,7 +21,7 @@ void GfCampfire::OnStartup(Entity* self) {
void GfCampfire::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
int32_t param3) {
if (args == "physicsReady") {
auto* render = static_cast<RenderComponent*>(self->GetComponent(COMPONENT_TYPE_RENDER));
auto* render = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
render->PlayEffect(295, u"running", "Burn");
}

View File

@@ -14,6 +14,7 @@
#include "Loot.h"
#include "InventoryComponent.h"
#include "eMissionTaskType.h"
#include "eReplicaComponentType.h"
void SGCannon::OnStartup(Entity* self) {
Game::logger->Log("SGCannon", "OnStartup");
@@ -295,7 +296,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
if (true) {
auto* movementAI = new MovementAIComponent(enemy, {});
enemy->AddComponent(COMPONENT_TYPE_MOVEMENT_AI, movementAI);
enemy->AddComponent(eReplicaComponentType::MOVEMENT_AI, movementAI);
movementAI->SetSpeed(toSpawn.initialSpeed);
movementAI->SetCurrentSpeed(toSpawn.initialSpeed);

View File

@@ -2,12 +2,13 @@
#include "DestroyableComponent.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void NpcNpSpacemanBob::OnMissionDialogueOK(Entity* self, Entity* target, int missionID, eMissionState missionState) {
if (missionState == eMissionState::READY_TO_COMPLETE && missionID == 173) {
DestroyableComponent* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(COMPONENT_TYPE_DESTROYABLE));
DestroyableComponent* destroyable = static_cast<DestroyableComponent*>(target->GetComponent(eReplicaComponentType::DESTROYABLE));
destroyable->SetImagination(6);
MissionComponent* mission = static_cast<MissionComponent*>(target->GetComponent(COMPONENT_TYPE_MISSION));
MissionComponent* mission = static_cast<MissionComponent*>(target->GetComponent(eReplicaComponentType::MISSION));
mission->CompleteMission(664);
}

View File

@@ -2,6 +2,7 @@
#include "GameMessages.h"
#include "MissionComponent.h"
#include "Character.h"
#include "eReplicaComponentType.h"
void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, Entity* player, int reward) {
if (missionID != 474) return;
@@ -44,7 +45,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
player->GetCharacter()->SetPlayerFlag(flagID, true);
}
MissionComponent* mis = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
MissionComponent* mis = static_cast<MissionComponent*>(player->GetComponent(eReplicaComponentType::MISSION));
for (int mission : factionMissions) {
mis->AcceptMission(mission);

View File

@@ -1,10 +1,11 @@
#include "NsModularBuild.h"
#include "MissionComponent.h"
#include "eMissionState.h"
#include "eReplicaComponentType.h"
void NsModularBuild::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) {
if (bCompleted) {
MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(COMPONENT_TYPE_MISSION));
MissionComponent* mission = static_cast<MissionComponent*>(player->GetComponent(eReplicaComponentType::MISSION));
if (mission->GetMissionState(m_MissionNum) == eMissionState::ACTIVE) {
for (LOT mod : modules) {

View File

@@ -4,6 +4,7 @@
#include "SkillComponent.h"
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "eReplicaComponentType.h"
void SpecialImaginePowerupSpawner::OnStartup(Entity* self) {
self->SetProximityRadius(1.5f, "powerupEnter");
@@ -26,7 +27,7 @@ void SpecialImaginePowerupSpawner::OnProximityUpdate(Entity* self, Entity* enter
GameMessages::SendPlayFXEffect(self, -1, u"pickup", "", LWOOBJID_EMPTY, 1, 1, true);
SkillComponent* skillComponent;
if (!self->TryGetComponent(COMPONENT_TYPE_SKILL, skillComponent)) {
if (!self->TryGetComponent(eReplicaComponentType::SKILL, skillComponent)) {
return;
}
@@ -35,7 +36,7 @@ void SpecialImaginePowerupSpawner::OnProximityUpdate(Entity* self, Entity* enter
skillComponent->CalculateBehavior(13, 20, source);
DestroyableComponent* destroyableComponent;
if (!self->TryGetComponent(COMPONENT_TYPE_DESTROYABLE, destroyableComponent)) {
if (!self->TryGetComponent(eReplicaComponentType::DESTROYABLE, destroyableComponent)) {
return;
}