Merge branch 'main' into npc-pathing

This commit is contained in:
Aaron Kimbre
2023-04-10 22:19:41 -05:00
612 changed files with 12044 additions and 7169 deletions

View File

@@ -11,6 +11,10 @@
#include "MovementAIComponent.h"
#include "../dWorldServer/ObjectIDManager.h"
#include "MissionComponent.h"
#include "Loot.h"
#include "InventoryComponent.h"
#include "eMissionTaskType.h"
#include "eReplicaComponentType.h"
void SGCannon::OnStartup(Entity* self) {
Game::logger->Log("SGCannon", "OnStartup");
@@ -75,7 +79,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
auto* player = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(PlayerIDVariable));
if (player != nullptr) {
Game::logger->Log("SGCannon", "Player is ready");
/*GameMessages::SendSetStunned(player->GetObjectID(), PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
/*GameMessages::SendSetStunned(player->GetObjectID(), eStateChangeType::PUSH, player->GetSystemAddress(), LWOOBJID_EMPTY,
true, true, true, true, true, true, true);*/
Game::logger->Log("SGCannon", "Sending ActivityEnter");
@@ -290,7 +294,6 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
if (enemy) {
EntityManager::Instance()->ConstructEntity(enemy);
auto* movementAI = enemy->GetComponent<MovementAIComponent>();
if (!movementAI) return;
movementAI->SetSpeed(toSpawn.initialSpeed);
@@ -541,9 +544,9 @@ void SGCannon::StopGame(Entity* self, bool cancel) {
auto* missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent != nullptr) {
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MINIGAME, self->GetVar<uint32_t>(TotalScoreVariable), self->GetObjectID(), "performact_score");
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_MINIGAME, self->GetVar<uint32_t>(MaxStreakVariable), self->GetObjectID(), "performact_streak");
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_ACTIVITY, m_CannonLot, 0, "", self->GetVar<uint32_t>(TotalScoreVariable));
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, self->GetVar<uint32_t>(TotalScoreVariable), self->GetObjectID(), "performact_score");
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, self->GetVar<uint32_t>(MaxStreakVariable), self->GetObjectID(), "performact_streak");
missionComponent->Progress(eMissionTaskType::ACTIVITY, m_CannonLot, 0, "", self->GetVar<uint32_t>(TotalScoreVariable));
}
LootGenerator::Instance().GiveActivityLoot(player, self, GetGameID(self), self->GetVar<uint32_t>(TotalScoreVariable));
@@ -653,7 +656,7 @@ void SGCannon::RegisterHit(Entity* self, Entity* target, const std::string& time
auto missionComponent = player->GetComponent<MissionComponent>();
if (missionComponent == nullptr) return;
missionComponent->Progress(MissionTaskType::MISSION_TASK_TYPE_SMASH, spawnInfo.lot, self->GetObjectID());
missionComponent->Progress(eMissionTaskType::SMASH, spawnInfo.lot, self->GetObjectID());
}
void SGCannon::UpdateStreak(Entity* self) {
@@ -711,7 +714,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
Game::logger->Log("SGCannon", "Player has %d equipped items", equippedItems.size());
auto skillID = constants.cannonSkill;
auto coolDown = constants.cannonRefireRate;
auto cooldown = constants.cannonRefireRate;
auto* selfInventoryComponent = self->GetComponent<InventoryComponent>();
@@ -727,7 +730,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
// TODO: Equip items
skillID = constants.cannonSuperChargeSkill;
coolDown = 400;
cooldown = 400;
} else {
selfInventoryComponent->UpdateSlot("greeble_r", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
selfInventoryComponent->UpdateSlot("greeble_l", { ObjectIDManager::GenerateRandomObjectID(), 0, 0, 0 });
@@ -750,7 +753,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
}
}
}
cooldown = 800;
self->SetVar<uint32_t>(NumberOfChargesVariable, 0);
}
@@ -766,7 +769,7 @@ void SGCannon::ToggleSuperCharge(Entity* self, bool enable) {
properties.cannonFOV = 58.6f;
properties.cannonVelocity = 129.0;
properties.cannonRefireRate = 800;
properties.cannonRefireRate = cooldown;
properties.cannonMinDistance = 30;
properties.cannonTimeout = -1;