diff --git a/dScripts/02_server/Enemy/General/BaseEnemySpiderling.cpp b/dScripts/02_server/Enemy/General/BaseEnemySpiderling.cpp new file mode 100644 index 000000000..9549b6bf7 --- /dev/null +++ b/dScripts/02_server/Enemy/General/BaseEnemySpiderling.cpp @@ -0,0 +1,21 @@ +#include "BaseEnemySpiderling.h" + +#include "ControllablePhysicsComponent.h" +#include "DestroyableComponent.h" +#include "Entity.h" +#include "eStateChangeType.h" + +void BaseEnemySpiderling::OnStartup(Entity* self) { + // SetStunImmunity: attack, interrupt, move, turn, use item, equip, interact + auto* controllablePhysicsComponent = self->GetComponent(); + if (controllablePhysicsComponent) { + controllablePhysicsComponent->SetStunImmunity(eStateChangeType::PUSH, self->GetObjectID(), + true, true, true, false, true, true, true); // attack, equip, interact, jump, move, turn, use item + } + + // SetStatusImmunity: pull to point and knockback; the interrupt immunity of SetStunImmunity lives here in DLU + auto* destroyableComponent = self->GetComponent(); + if (destroyableComponent) { + destroyableComponent->SetStatusImmunity(eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true); + } +} diff --git a/dScripts/02_server/Enemy/General/BaseEnemySpiderling.h b/dScripts/02_server/Enemy/General/BaseEnemySpiderling.h new file mode 100644 index 000000000..92b161d2e --- /dev/null +++ b/dScripts/02_server/Enemy/General/BaseEnemySpiderling.h @@ -0,0 +1,8 @@ +#pragma once +#include "CppScripts.h" + +// L_BASE_ENEMY_SPIDERLING: spiderlings can't be stunned, interrupted, knocked back or pulled +class BaseEnemySpiderling : public CppScripts::Script { +public: + void OnStartup(Entity* self) override; +}; diff --git a/dScripts/02_server/Enemy/General/CMakeLists.txt b/dScripts/02_server/Enemy/General/CMakeLists.txt index c685d290e..455a2396b 100644 --- a/dScripts/02_server/Enemy/General/CMakeLists.txt +++ b/dScripts/02_server/Enemy/General/CMakeLists.txt @@ -1,6 +1,7 @@ set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_GENERAL "BaseEnemyMech.cpp" "BaseEnemyApe.cpp" + "BaseEnemySpiderling.cpp" "CountdownDestroyAI.cpp" "GfApeSmashingQB.cpp" "TreasureChestDragonServer.cpp" diff --git a/dScripts/CppScripts.cpp b/dScripts/CppScripts.cpp index c14d94674..93f138cc1 100644 --- a/dScripts/CppScripts.cpp +++ b/dScripts/CppScripts.cpp @@ -117,6 +117,7 @@ #include "PetDigBuild.h" #include "SpawnLionServer.h" #include "BaseEnemyApe.h" +#include "BaseEnemySpiderling.h" #include "GfApeSmashingQB.h" #include "ZoneGfProperty.h" #include "GfArchway.h" @@ -466,6 +467,7 @@ namespace { {"scripts\\ai\\GF\\L_GF_PET_DIG_BUILD.lua", []() {return new PetDigBuild();}}, {"scripts\\02_server\\Map\\GF\\L_SPAWN_LION_SERVER.lua", []() {return new SpawnLionServer();}}, {"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_APE.lua", []() {return new BaseEnemyApe();}}, + {"scripts\\02_server\\Enemy\\General\\L_BASE_ENEMY_SPIDERLING.lua", []() {return new BaseEnemySpiderling();}}, {"scripts\\02_server\\Enemy\\General\\L_GF_APE_SMASHING_QB.lua", []() {return new GfApeSmashingQB();}}, {"scripts\\zone\\PROPERTY\\GF\\L_ZONE_GF_PROPERTY.lua", []() {return new ZoneGfProperty();}}, {"scripts\\ai\\GF\\L_GF_ARCHWAY.lua", []() {return new GfArchway();}}, @@ -735,7 +737,6 @@ namespace { std::set 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",