fix(enemies): spiderlings can't be stunned, interrupted, knocked back or pulled

L_BASE_ENEMY_SPIDERLING was excluded, so the 7 spiderlings in Avant Gardens and 3 in Venture Explorer had none of the
immunities its onStartup pushes: stun immunity to attack, interrupt, move, turn, use item, equip and interact, and
status immunity to pull-to-point and knockback. BaseEnemySpiderling does the same. Check: stun and knock back a
spiderling: nothing happens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 09:11:18 -05:00
parent 33402425e4
commit c75205a0e2
4 changed files with 32 additions and 1 deletions

View File

@@ -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<ControllablePhysicsComponent>();
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<DestroyableComponent>();
if (destroyableComponent) {
destroyableComponent->SetStatusImmunity(eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true);
}
}

View File

@@ -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;
};

View File

@@ -1,6 +1,7 @@
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_GENERAL
"BaseEnemyMech.cpp"
"BaseEnemyApe.cpp"
"BaseEnemySpiderling.cpp"
"CountdownDestroyAI.cpp"
"GfApeSmashingQB.cpp"
"TreasureChestDragonServer.cpp"

View File

@@ -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<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",