mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 14:58:27 +00:00
Merge branch 'main' into ub-fixes
This commit is contained in:
@@ -3,104 +3,107 @@
|
||||
#include "ScriptedActivityComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "LeaderboardManager.h"
|
||||
#include "dServer.h"
|
||||
#include "eMissionTaskType.h"
|
||||
#include "eMissionState.h"
|
||||
#include "MissionComponent.h"
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
||||
void NpcAgCourseStarter::OnStartup(Entity* self) {
|
||||
|
||||
}
|
||||
void NpcAgCourseStarter::OnStartup(Entity* self) {}
|
||||
|
||||
void NpcAgCourseStarter::OnUse(Entity* self, Entity* user) {
|
||||
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
auto* const scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
if (!scriptedActivityComponent) return;
|
||||
|
||||
if (scriptedActivityComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
const auto selfId = self->GetObjectID();
|
||||
const auto userId = user->GetObjectID();
|
||||
const auto& userSysAddr = user->GetSystemAddress();
|
||||
|
||||
if (scriptedActivityComponent->GetActivityPlayerData(user->GetObjectID()) != nullptr) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"exit", 0, 0, LWOOBJID_EMPTY, "", user->GetSystemAddress());
|
||||
if (scriptedActivityComponent->GetActivityPlayerData(userId) != nullptr) {
|
||||
GameMessages::SendNotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
|
||||
} else {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"start", 0, 0, LWOOBJID_EMPTY, "", user->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "", userSysAddr);
|
||||
}
|
||||
}
|
||||
|
||||
void NpcAgCourseStarter::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
||||
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
auto* const scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
if (!scriptedActivityComponent) return;
|
||||
|
||||
if (scriptedActivityComponent == nullptr) {
|
||||
return;
|
||||
}
|
||||
const auto selfId = self->GetObjectID();
|
||||
const auto senderId = sender->GetObjectID();
|
||||
const auto& senderSysAddr = sender->GetSystemAddress();
|
||||
|
||||
if (identifier == u"player_dialog_cancel_course" && button == 1) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
GameMessages::SendNotifyClientObject(selfId, u"cancel_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"cancel_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(sender->GetObjectID());
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
|
||||
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
} else if (identifier == u"player_dialog_start_course" && button == 1) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"start_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
|
||||
GameMessages::SendActivityStart(self->GetObjectID(), sender->GetSystemAddress());
|
||||
|
||||
auto* data = scriptedActivityComponent->AddActivityPlayerData(sender->GetObjectID());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"start_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
GameMessages::SendActivityStart(selfId, senderSysAddr);
|
||||
|
||||
auto* const data = scriptedActivityComponent->AddActivityPlayerData(senderId);
|
||||
if (data->values[1] != 0) return;
|
||||
|
||||
// Convert to 32 bit time (Note: could try and fix the 2038 problem here by using a different epoch maybe?)
|
||||
const time_t startTime = std::time(0) + 4; // Offset for starting timer
|
||||
data->values[1] = std::bit_cast<float>(static_cast<int32_t>(startTime));
|
||||
const auto raceStartTime = Game::server->GetUptime() + std::chrono::seconds(4); // Offset for starting timer
|
||||
const auto fRaceStartTime = std::chrono::duration<float, std::ratio<1>>(raceStartTime).count();
|
||||
data->values[1] = fRaceStartTime;
|
||||
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
} else if (identifier == u"FootRaceCancel") {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
|
||||
if (scriptedActivityComponent->GetActivityPlayerData(sender->GetObjectID()) != nullptr) {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"exit", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
if (scriptedActivityComponent->GetActivityPlayerData(senderId) != nullptr) {
|
||||
GameMessages::SendNotifyClientObject(selfId, u"exit", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
} else {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"start", 0, 0, LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"start", 0, 0, LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
}
|
||||
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(sender->GetObjectID());
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
|
||||
}
|
||||
}
|
||||
|
||||
void NpcAgCourseStarter::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
||||
auto* scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
if (scriptedActivityComponent == nullptr) return;
|
||||
auto* const scriptedActivityComponent = self->GetComponent<ScriptedActivityComponent>();
|
||||
if (!scriptedActivityComponent) return;
|
||||
|
||||
auto* data = scriptedActivityComponent->GetActivityPlayerData(sender->GetObjectID());
|
||||
if (data == nullptr) return;
|
||||
const auto selfId = self->GetObjectID();
|
||||
const auto senderId = sender->GetObjectID();
|
||||
const auto& senderSysAddr = sender->GetSystemAddress();
|
||||
|
||||
auto* const data = scriptedActivityComponent->GetActivityPlayerData(senderId);
|
||||
if (!data) return;
|
||||
|
||||
if (args == "course_cancel") {
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"cancel_timer", 0, 0,
|
||||
LWOOBJID_EMPTY, "", sender->GetSystemAddress());
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(sender->GetObjectID());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"cancel_timer", 0, 0,
|
||||
LWOOBJID_EMPTY, "", senderSysAddr);
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
|
||||
} else if (args == "course_finish") {
|
||||
const time_t endTime = std::time(0);
|
||||
const time_t startTime = std::bit_cast<int32_t>(data->values[1]);
|
||||
const time_t finish = endTime - startTime;
|
||||
data->values[2] = std::bit_cast<float>(static_cast<int32_t>(finish));
|
||||
|
||||
auto* missionComponent = sender->GetComponent<MissionComponent>();
|
||||
const auto raceEndTime = Game::server->GetUptime();
|
||||
const auto fRaceEndTime = std::chrono::duration<float, std::ratio<1>>(raceEndTime).count();
|
||||
const auto raceTimeElapsed = fRaceEndTime - data->values[1];
|
||||
data->values[2] = raceTimeElapsed;
|
||||
|
||||
auto* const missionComponent = sender->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) {
|
||||
missionComponent->ForceProgressTaskType(1884, 1, 1, false);
|
||||
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, -finish, self->GetObjectID(),
|
||||
missionComponent->Progress(eMissionTaskType::PERFORM_ACTIVITY, -raceTimeElapsed, selfId,
|
||||
"performact_time");
|
||||
}
|
||||
|
||||
Game::entityManager->SerializeEntity(self);
|
||||
LeaderboardManager::SaveScore(sender->GetObjectID(), scriptedActivityComponent->GetActivityID(), static_cast<float>(finish));
|
||||
LeaderboardManager::SaveScore(senderId, scriptedActivityComponent->GetActivityID(), raceTimeElapsed);
|
||||
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"ToggleLeaderBoard",
|
||||
scriptedActivityComponent->GetActivityID(), 0, sender->GetObjectID(),
|
||||
"", sender->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(self->GetObjectID(), u"stop_timer", 1, finish, LWOOBJID_EMPTY, "",
|
||||
sender->GetSystemAddress());
|
||||
GameMessages::SendNotifyClientObject(selfId, u"ToggleLeaderBoard",
|
||||
scriptedActivityComponent->GetActivityID(), 0, senderId,
|
||||
"", senderSysAddr);
|
||||
GameMessages::SendNotifyClientObject(selfId, u"stop_timer", 1, raceTimeElapsed, LWOOBJID_EMPTY, "",
|
||||
senderSysAddr);
|
||||
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(sender->GetObjectID());
|
||||
scriptedActivityComponent->RemoveActivityPlayerData(senderId);
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_MAP_GENERAL
|
||||
"BankInteractServer.cpp"
|
||||
"BaseInteractDropLootServer.cpp"
|
||||
"Binoculars.cpp"
|
||||
"EnemyClearThreat.cpp"
|
||||
"ExplodingAsset.cpp"
|
||||
"FrictionVolumeServer.cpp"
|
||||
"ForceVolumeServer.cpp"
|
||||
|
25
dScripts/02_server/Map/General/EnemyClearThreat.cpp
Normal file
25
dScripts/02_server/Map/General/EnemyClearThreat.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "EnemyClearThreat.h"
|
||||
|
||||
#include "BaseCombatAIComponent.h"
|
||||
#include "PhysicsComponent.h"
|
||||
|
||||
void EnemyClearThreat::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
|
||||
const auto colGroup = target->GetCollisionGroup();
|
||||
if (colGroup == 12) { // enemy
|
||||
auto* const baseCombatAiComponent = target->GetComponent<BaseCombatAIComponent>();
|
||||
if (!baseCombatAiComponent) return;
|
||||
|
||||
baseCombatAiComponent->ClearThreat();
|
||||
baseCombatAiComponent->ForceTether();
|
||||
} else if (colGroup == 10) { // player
|
||||
const auto enemies = Game::entityManager->GetEntitiesByComponent(eReplicaComponentType::BASE_COMBAT_AI);
|
||||
for (const auto& enemy : enemies) {
|
||||
auto* const baseCombatAiComponent = enemy->GetComponent<BaseCombatAIComponent>();
|
||||
if (!baseCombatAiComponent) continue;
|
||||
|
||||
baseCombatAiComponent->IgnoreThreat(target->GetObjectID(), 3.0f);
|
||||
}
|
||||
}
|
||||
}
|
11
dScripts/02_server/Map/General/EnemyClearThreat.h
Normal file
11
dScripts/02_server/Map/General/EnemyClearThreat.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef ENEMYCLEARTHREAT_H
|
||||
#define ENEMYCLEARTHREAT_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class EnemyClearThreat : public CppScripts::Script {
|
||||
public:
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
};
|
||||
|
||||
#endif //!ENEMYCLEARTHREAT_H
|
@@ -121,7 +121,7 @@ void ActivityManager::GetLeaderboardData(Entity* self, const LWOOBJID playerID,
|
||||
auto* sac = self->GetComponent<ScriptedActivityComponent>();
|
||||
uint32_t gameID = sac != nullptr ? sac->GetActivityID() : self->GetLOT();
|
||||
// Save the new score to the leaderboard and show the leaderboard to the player
|
||||
LeaderboardManager::SendLeaderboard(activityID, Leaderboard::InfoType::MyStanding, false, playerID, self->GetObjectID(), 0, numResults);
|
||||
LeaderboardManager::SendLeaderboard(activityID, Leaderboard::InfoType::MyStanding, false, playerID, self->GetObjectID());
|
||||
}
|
||||
|
||||
void ActivityManager::ActivityTimerStart(Entity* self, const std::string& timerName, const float_t updateInterval,
|
||||
|
@@ -327,6 +327,9 @@
|
||||
#include "VisToggleNotifierServer.h"
|
||||
#include "LupGenericInteract.h"
|
||||
#include "WblRobotCitizen.h"
|
||||
#include "EnemyClearThreat.h"
|
||||
#include "AgSpiderBossMessage.h"
|
||||
#include "GfRaceInstancer.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
@@ -686,8 +689,25 @@ namespace {
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenOrange.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenRed.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_RobotCitizenYellow.lua", []() {return new WblRobotCitizen();}},
|
||||
{"scripts\\02_server\\Map\\General\\L_ENEMY_CLEAR_THREAT.lua", []() {return new EnemyClearThreat();}},
|
||||
{"scripts\\ai\\AG\\L_AG_SPIDER_BOSS_MESSAGE.lua", []() {return new AgSpiderBossMessage();}},
|
||||
{"scripts\\ai\\GF\\L_GF_RACE_INSTANCER.lua", []() {return new GfRaceInstancer();}},
|
||||
|
||||
};
|
||||
|
||||
std::set<std::string> g_ExcludedScripts = {
|
||||
"scripts\\02_server\\Enemy\\General\\L_SUSPEND_LUA_AI.lua",
|
||||
"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_SPIDERLING.lua",
|
||||
"scripts\\ai\\AG\\L_AG_SENTINEL_GUARD.lua",
|
||||
"scripts\\ai\\FV\\L_ACT_NINJA_STUDENT.lua",
|
||||
"scripts\\ai\\WILD\\L_WILD_GF_FROG.lua",
|
||||
"scripts\\empty.lua",
|
||||
"scripts\\zone\\AG\\L_ZONE_AG.lua",
|
||||
"scripts\\zone\\NS\\L_ZONE_NS.lua",
|
||||
"scripts\\zone\\GF\\L_ZONE_GF.lua",
|
||||
"scripts\\ai\\AG\\CONCERT_STAGE.lua",
|
||||
"scripts\\ai\\NS\\L_NS_CAR_MODULAR_BUILD.lua", // In our implementation, this is done in GameMessages.cpp
|
||||
};
|
||||
};
|
||||
|
||||
CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::string& scriptName) {
|
||||
@@ -699,14 +719,8 @@ CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::strin
|
||||
const auto itrTernary = scriptLoader.find(scriptName);
|
||||
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
||||
|
||||
if (script == &InvalidToReturn) {
|
||||
if ((scriptName.length() > 0) && !((scriptName == "scripts\\02_server\\Enemy\\General\\L_SUSPEND_LUA_AI.lua") ||
|
||||
(scriptName == "scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_SPIDERLING.lua") ||
|
||||
(scriptName == "scripts\\ai\\FV\\L_ACT_NINJA_STUDENT.lua") ||
|
||||
(scriptName == "scripts\\ai\\WILD\\L_WILD_GF_FROG.lua") ||
|
||||
(scriptName == "scripts\\empty.lua") ||
|
||||
(scriptName == "scripts\\ai\\AG\\L_AG_SENTINEL_GUARD.lua")
|
||||
)) LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
||||
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||
LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
||||
}
|
||||
|
||||
g_Scripts[scriptName] = script;
|
||||
|
@@ -354,7 +354,7 @@ namespace CppScripts {
|
||||
* @param player the player to remove
|
||||
* @param canceled if it was done via the cancel button
|
||||
*/
|
||||
virtual void OnRequestActivityExit(Entity* sender, LWOOBJID player, bool canceled){};
|
||||
virtual void OnRequestActivityExit(Entity* sender, LWOOBJID player, bool canceled) {};
|
||||
};
|
||||
|
||||
Script* const GetScript(Entity* parent, const std::string& scriptName);
|
||||
|
80
dScripts/ai/AG/AgSpiderBossMessage.cpp
Normal file
80
dScripts/ai/AG/AgSpiderBossMessage.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
#include "AgSpiderBossMessage.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
#include "RenderComponent.h"
|
||||
|
||||
Box AgSpiderBossMessage::GetBox(Entity* self) const {
|
||||
return self->GetVar<Box>(u"box");
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::SetBox(Entity* self, const Box& box) const {
|
||||
self->SetVar(u"box", box);
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::MakeBox(Entity* self) const {
|
||||
auto box = GetBox(self);
|
||||
if (box.boxTarget == LWOOBJID_EMPTY || box.isDisplayed || box.boxSelf == LWOOBJID_EMPTY) return;
|
||||
|
||||
box.isDisplayed = true;
|
||||
SetBox(self, box);
|
||||
self->AddTimer("BoxTimer", box.boxTime);
|
||||
|
||||
const auto* const tgt = Game::entityManager->GetEntity(box.boxTarget);
|
||||
if (!tgt) return;
|
||||
GameMessages::DisplayTooltip tooltip;
|
||||
tooltip.target = tgt->GetObjectID();
|
||||
tooltip.show = true;
|
||||
tooltip.text = box.boxText;
|
||||
tooltip.time = box.boxTime * 1000; // to ms
|
||||
tooltip.Send(tgt->GetSystemAddress());
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target || !target->IsPlayer()) return;
|
||||
|
||||
auto box = GetBox(self);
|
||||
// knockback the target
|
||||
auto forward = target->GetRotation().GetForwardVector();
|
||||
box.boxTarget = target->GetObjectID();
|
||||
GameMessages::SendPlayFXEffect(target->GetObjectID(), 1378, u"create", "pushBack");
|
||||
RenderComponent::PlayAnimation(target, "knockback-recovery");
|
||||
forward.y += 15;
|
||||
forward.x *= 100;
|
||||
forward.z *= 100;
|
||||
GameMessages::SendKnockback(target->GetObjectID(), self->GetObjectID(), self->GetObjectID(), 0, forward);
|
||||
|
||||
if (box.isTouch || box.isDisplayed) return;
|
||||
box.boxSelf = self->GetObjectID();
|
||||
box.isTouch = true;
|
||||
box.boxText = u"%[SPIDER_CAVE_MESSAGE]";
|
||||
SetBox(self, box);
|
||||
self->AddTimer("EventTimer", 0.1f);
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::OnOffCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target) return;
|
||||
auto box = GetBox(self);
|
||||
box.isTouch = false;
|
||||
box.Reset();
|
||||
SetBox(self, box);
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "BoxTimer") {
|
||||
auto box = GetBox(self);
|
||||
box.isDisplayed = false;
|
||||
SetBox(self, box);
|
||||
ResetBox(self);
|
||||
} else if (timerName == "EventTimer") {
|
||||
auto box = GetBox(self);
|
||||
MakeBox(self);
|
||||
}
|
||||
}
|
||||
|
||||
void AgSpiderBossMessage::ResetBox(Entity* self) const {
|
||||
auto box = GetBox(self);
|
||||
box.Reset();
|
||||
SetBox(self, box);
|
||||
}
|
37
dScripts/ai/AG/AgSpiderBossMessage.h
Normal file
37
dScripts/ai/AG/AgSpiderBossMessage.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef AGSPIDERBOSSMESSAGE_H
|
||||
#define AGSPIDERBOSSMESSAGE_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
struct Box {
|
||||
LWOOBJID boxTarget{};
|
||||
bool isDisplayed{};
|
||||
bool isTouch{};
|
||||
bool isFirst{};
|
||||
LWOOBJID boxSelf{};
|
||||
std::u16string boxText{};
|
||||
int32_t boxTime{ 1 };
|
||||
|
||||
void Reset() {
|
||||
boxTarget = LWOOBJID_EMPTY;
|
||||
isDisplayed = false;
|
||||
isTouch = false;
|
||||
isFirst = false;
|
||||
boxSelf = LWOOBJID_EMPTY;
|
||||
boxText.clear();
|
||||
boxTime = 1;
|
||||
}
|
||||
};
|
||||
|
||||
class AgSpiderBossMessage : public CppScripts::Script {
|
||||
public:
|
||||
Box GetBox(Entity* self) const;
|
||||
void SetBox(Entity* self, const Box& box) const;
|
||||
void MakeBox(Entity* self) const;
|
||||
void OnCollisionPhantom(Entity* self, Entity* target) override;
|
||||
void OnOffCollisionPhantom(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void ResetBox(Entity* self) const;
|
||||
};
|
||||
|
||||
#endif //!AGSPIDERBOSSMESSAGE_H
|
@@ -1,6 +1,7 @@
|
||||
set(DSCRIPTS_SOURCES_AI_AG
|
||||
"AgShipPlayerDeathTrigger.cpp"
|
||||
"AgSpaceStuff.cpp"
|
||||
"AgSpiderBossMessage.cpp"
|
||||
"AgShipShake.cpp"
|
||||
"AgShipPlayerShockServer.cpp"
|
||||
"AgImagSmashable.cpp"
|
||||
|
@@ -1,4 +1,5 @@
|
||||
set(DSCRIPTS_SOURCES_AI_GF
|
||||
"GfRaceInstancer.cpp"
|
||||
"GfCampfire.cpp"
|
||||
"GfOrgan.cpp"
|
||||
"GfBanana.cpp"
|
||||
|
7
dScripts/ai/GF/GfRaceInstancer.cpp
Normal file
7
dScripts/ai/GF/GfRaceInstancer.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "GfRaceInstancer.h"
|
||||
|
||||
#include "Entity.h"
|
||||
|
||||
void GfRaceInstancer::OnStartup(Entity* self) {
|
||||
self->SetProximityRadius(self->HasVar(u"interaction_distance") ? self->GetVar<float>(u"interaction_distance") : 16.0f, "Interaction_Distance");
|
||||
}
|
11
dScripts/ai/GF/GfRaceInstancer.h
Normal file
11
dScripts/ai/GF/GfRaceInstancer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef GFRACEINSTANCER_H
|
||||
#define GFRACEINSTANCER_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class GfRaceInstancer : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!GFRACEINSTANCER_H
|
Reference in New Issue
Block a user