feat: dragon instance script

This commit is contained in:
David Markowitz
2026-06-20 22:11:35 -07:00
parent ccc029424c
commit bfd0f1ff35
5 changed files with 33 additions and 1 deletions

View File

@@ -135,6 +135,7 @@
#include "FvMaelstromCavalry.h"
#include "FvHorsemenTrigger.h"
#include "FvFlyingCreviceDragon.h"
#include "FvDragonInstanceServer.h"
#include "FvMaelstromDragon.h"
#include "FvDragonSmashingGolemQb.h"
#include "TreasureChestDragonServer.h"
@@ -490,6 +491,7 @@ namespace {
{"scripts\\ai\\FV\\L_ACT_NINJA_TURRET_1.lua", []() {return new ActNinjaTurret();}},
{"scripts\\02_server\\Map\\FV\\L_FV_HORSEMEN_TRIGGER.lua", []() {return new FvHorsemenTrigger();}},
{"scripts\\ai\\FV\\L_FV_FLYING_CREVICE_DRAGON.lua", []() {return new FvFlyingCreviceDragon();}},
{"scripts\\ai\\FV\\Dragon_Instance\\L_FV_DRAGON_INSTANCE_SERVER.lua", []() {return new FvDragonInstanceServer();}},
{"scripts\\02_server\\Enemy\\FV\\L_FV_MAELSTROM_DRAGON.lua", []() {return new FvMaelstromDragon();}},
{"scripts\\ai\\FV\\L_FV_DRAGON_SMASHING_GOLEM_QB.lua", []() {return new FvDragonSmashingGolemQb();}},
{"scripts\\02_server\\Enemy\\General\\L_TREASURE_CHEST_DRAGON_SERVER.lua", []() {return new TreasureChestDragonServer();}},

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,13 @@
#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());
}
}

View File

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