feat: dragon instance script (#2012)

* feat: dragon instance script

* Update FvDragonInstanceServer.h

* feat: implement ronin script

* Update CountdownDestroyAI.cpp

* default initialize

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove unused handlers

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* use float

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fixes

* Update ScriptComponent.h

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
David Markowitz
2026-06-22 17:16:21 -07:00
committed by GitHub
parent 62f58f5307
commit 5745742c91
15 changed files with 145 additions and 3 deletions

View File

@@ -18,7 +18,13 @@ set(DSCRIPTS_SOURCES_AI_FV
"FvMaelstromGeyser.cpp"
"TriggerGas.cpp")
add_subdirectory(Dragon_Instance)
foreach(file ${DSCRIPTS_SOURCES_AI_FV_DRAGON_INSTANCE})
set(DSCRIPTS_SOURCES_AI_FV ${DSCRIPTS_SOURCES_AI_FV} "Dragon_Instance/${file}")
endforeach()
add_library(dScriptsAiFV OBJECT ${DSCRIPTS_SOURCES_AI_FV})
target_include_directories(dScriptsAiFV PUBLIC ".")
target_include_directories(dScriptsAiFV PUBLIC "." "Dragon_Instance")
target_precompile_headers(dScriptsAiFV REUSE_FROM dScriptsBase)

View File

@@ -0,0 +1,3 @@
set(DSCRIPTS_SOURCES_AI_FV_DRAGON_INSTANCE
"FvDragonInstanceServer.cpp"
PARENT_SCOPE)

View File

@@ -0,0 +1,14 @@
#include "FvDragonInstanceServer.h"
#include "Entity.h"
#include "DestroyableComponent.h"
void FvDragonInstanceServer::OnPlayerLoaded(Entity* self, Entity* player) {
auto* const destComp = player->GetComponent<DestroyableComponent>();
if (destComp) {
destComp->SetHealth(destComp->GetMaxHealth());
destComp->SetArmor(destComp->GetMaxArmor());
destComp->SetImagination(destComp->GetMaxImagination());
Game::entityManager->SerializeEntity(player);
}
}

View File

@@ -0,0 +1,7 @@
#pragma once
#include "CppScripts.h"
class FvDragonInstanceServer : public CppScripts::Script {
public:
void OnPlayerLoaded(Entity* self, Entity* player) override;
};