mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43: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:
@@ -2,6 +2,7 @@ add_subdirectory(Hatchlings)
|
|||||||
|
|
||||||
set(DSCRIPTS_SOURCES_02_SERVER_OBJECTS
|
set(DSCRIPTS_SOURCES_02_SERVER_OBJECTS
|
||||||
"AgSurvivalBuffStation.cpp"
|
"AgSurvivalBuffStation.cpp"
|
||||||
|
"ImmovableTurret.cpp"
|
||||||
"StinkyFishTarget.cpp")
|
"StinkyFishTarget.cpp")
|
||||||
|
|
||||||
foreach(file ${DSCRIPTS_SOURCES_02_SERVER_OBJECTS_HATCHLINGS})
|
foreach(file ${DSCRIPTS_SOURCES_02_SERVER_OBJECTS_HATCHLINGS})
|
||||||
|
|||||||
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
8
dScripts/02_server/Objects/ImmovableTurret.h
Normal file
8
dScripts/02_server/Objects/ImmovableTurret.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "CppScripts.h"
|
||||||
|
|
||||||
|
// L_TURRET: turret enemies can't be stunned, interrupted, knocked back or pulled
|
||||||
|
class ImmovableTurret : public CppScripts::Script {
|
||||||
|
public:
|
||||||
|
void OnStartup(Entity* self) override;
|
||||||
|
};
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
#include "NsConcertInstrument.h"
|
#include "NsConcertInstrument.h"
|
||||||
#include "NsJohnnyMissionServer.h"
|
#include "NsJohnnyMissionServer.h"
|
||||||
#include "StinkyFishTarget.h"
|
#include "StinkyFishTarget.h"
|
||||||
|
#include "ImmovableTurret.h"
|
||||||
#include "ZoneNsProperty.h"
|
#include "ZoneNsProperty.h"
|
||||||
#include "ZoneNsMedProperty.h"
|
#include "ZoneNsMedProperty.h"
|
||||||
#include "NsTokenConsoleServer.h"
|
#include "NsTokenConsoleServer.h"
|
||||||
@@ -434,6 +435,7 @@ namespace {
|
|||||||
{"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return new NsConcertInstrument();}},
|
{"scripts\\ai\\NS\\L_NS_CONCERT_INSTRUMENT_QB.lua", []() {return new NsConcertInstrument();}},
|
||||||
{"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return new NsJohnnyMissionServer();}},
|
{"scripts\\ai\\NS\\L_NS_JONNY_FLAG_MISSION_SERVER.lua", []() {return new NsJohnnyMissionServer();}},
|
||||||
{"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return new StinkyFishTarget();}},
|
{"scripts\\02_server\\Objects\\L_STINKY_FISH_TARGET.lua", []() {return new StinkyFishTarget();}},
|
||||||
|
{"scripts\\02_server\\Objects\\L_TURRET.lua", []() {return new ImmovableTurret();}},
|
||||||
{"scripts\\02_server\\Objects\\Hatchlings\\L_HATCHLING_PETS.lua", []() {return new HatchlingPets();}},
|
{"scripts\\02_server\\Objects\\Hatchlings\\L_HATCHLING_PETS.lua", []() {return new HatchlingPets();}},
|
||||||
{"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return new ZoneNsProperty();}},
|
{"scripts\\zone\\PROPERTY\\NS\\L_ZONE_NS_PROPERTY.lua", []() {return new ZoneNsProperty();}},
|
||||||
{"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return new ZoneNsMedProperty();}},
|
{"scripts\\02_server\\Map\\Property\\NS_Med\\L_ZONE_NS_MED_PROPERTY.lua", []() {return new ZoneNsMedProperty();}},
|
||||||
|
|||||||
Reference in New Issue
Block a user