mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-07 05:13:44 +00:00
feat(scripts): turret enemies are immovable as L_TURRET makes them
L_TURRET (LOTs 12286 and 13093, e.g. the Crux Prime auto turrets) had no script, so these turrets could be stunned, knocked back and pulled. They now push the same immunities the live script does. Check: stun and knock back a Crux Prime auto turret: nothing happens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
16
dScripts/02_server/Objects/ImmovableTurret.cpp
Normal file
16
dScripts/02_server/Objects/ImmovableTurret.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "ImmovableTurret.h"
|
||||
|
||||
#include "ControllablePhysicsComponent.h"
|
||||
#include "DestroyableComponent.h"
|
||||
#include "Entity.h"
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void ImmovableTurret::OnStartup(Entity* self) {
|
||||
// SetStunImmunity (attack, interrupt) and SetStatusImmunity (pull to point, knockback); DLU keeps interrupt with the status ones
|
||||
if (auto* controllablePhysics = self->GetComponent<ControllablePhysicsComponent>()) {
|
||||
controllablePhysics->SetStunImmunity(eStateChangeType::PUSH, self->GetObjectID(), true, false, false, false, false, false, false);
|
||||
}
|
||||
if (auto* destroyable = self->GetComponent<DestroyableComponent>()) {
|
||||
destroyable->SetStatusImmunity(eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user