mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-07 05:13:44 +00:00
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:
21
dScripts/02_server/Enemy/General/BaseEnemySpiderling.cpp
Normal file
21
dScripts/02_server/Enemy/General/BaseEnemySpiderling.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
8
dScripts/02_server/Enemy/General/BaseEnemySpiderling.h
Normal file
8
dScripts/02_server/Enemy/General/BaseEnemySpiderling.h
Normal 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;
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
set(DSCRIPTS_SOURCES_02_SERVER_ENEMY_GENERAL
|
||||
"BaseEnemyMech.cpp"
|
||||
"BaseEnemyApe.cpp"
|
||||
"BaseEnemySpiderling.cpp"
|
||||
"CountdownDestroyAI.cpp"
|
||||
"GfApeSmashingQB.cpp"
|
||||
"TreasureChestDragonServer.cpp"
|
||||
|
||||
Reference in New Issue
Block a user