From 42471739545f680fd295508d5478878d95f1b698 Mon Sep 17 00:00:00 2001 From: NetsuNegi39 Date: Mon, 24 Aug 2026 22:09:49 +0800 Subject: [PATCH] impl --- src/Ext/Techno/Body.Update.cpp | 23 +++++++++++++++++++++++ src/Ext/Techno/Body.h | 1 + src/Ext/TechnoType/Body.cpp | 6 ++++++ src/Ext/TechnoType/Body.h | 6 ++++++ 4 files changed, 36 insertions(+) diff --git a/src/Ext/Techno/Body.Update.cpp b/src/Ext/Techno/Body.Update.cpp index 93e6931649..0aadef06be 100644 --- a/src/Ext/Techno/Body.Update.cpp +++ b/src/Ext/Techno/Body.Update.cpp @@ -16,6 +16,7 @@ void TechnoExt::OnEarlyUpdate() { this->UpdateShield(); this->UpdateAttachEffects(); + this->UpdatePassengerTurretWeapon(); this->EatPassengers(); this->ApplySpawnLimitRange(); this->ApplyMindControlRangeLimit(); @@ -232,6 +233,28 @@ bool TechnoExt::CheckDeathConditions(bool isInLimbo) return false; } +void TechnoExt::UpdatePassengerTurretWeapon() const +{ + const auto pTypeExt = this->TypeExtData; + + if (!pTypeExt->PassengerTurret) + return; + + const auto pThis = this->OwnerObject(); + const int numPassengers = pThis->Passengers.NumPassengers; + + if (pTypeExt->PassengerTurretWeapon) + { + const auto TechnoClass_SetTurret = reinterpret_cast(0x70DC70); + TechnoClass_SetTurret(pThis, numPassengers); + } + else + { + const auto pType = pTypeExt->OwnerObject(); + pThis->CurrentTurretNumber = std::min(pType->TurretCount - 1, std::min(numPassengers, TechnoTypeClass::MaxWeapons - 1)); + } +} + void TechnoExt::EatPassengers() { auto const pTypeExt = this->TypeExtData; diff --git a/src/Ext/Techno/Body.h b/src/Ext/Techno/Body.h index 72c255a142..df12bfae0f 100644 --- a/src/Ext/Techno/Body.h +++ b/src/Ext/Techno/Body.h @@ -158,6 +158,7 @@ class TechnoExt : public RadioExt, public Detach::Listener void ApplyInterceptor(); bool CheckDeathConditions(bool isInLimbo = false); + void UpdatePassengerTurretWeapon() const; void EatPassengers(); void UpdateShield(); void ApplySpawnLimitRange(); diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 45dc1e6245..1578a19f21 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -947,6 +947,9 @@ void TechnoTypeExt::LoadFromINIFile(CCINIClass* const pINI) this->Passengers_SyncOwner.Read(exINI, pSection, "Passengers.SyncOwner"); this->Passengers_SyncOwner_RevertOnExit.Read(exINI, pSection, "Passengers.SyncOwner.RevertOnExit"); + this->PassengerTurret.Read(exINI, pSection, "PassengerTurret"); + this->PassengerTurretWeapon.Read(exINI, pSection, "PassengerTurretWeapon"); + this->IronCurtain_KeptOnDeploy.Read(exINI, pSection, "IronCurtain.KeptOnDeploy"); this->IronCurtain_Effect.Read(exINI, pSection, "IronCurtain.Effect"); this->IronCurtain_KillWarhead.Read(exINI, pSection, "IronCurtain.KillWarhead"); @@ -1584,6 +1587,9 @@ void TechnoTypeExt::Serialize(T& Stm) .Process(this->Passengers_SyncOwner) .Process(this->Passengers_SyncOwner_RevertOnExit) + .Process(this->PassengerTurret) + .Process(this->PassengerTurretWeapon) + .Process(this->IronCurtain_KeptOnDeploy) .Process(this->IronCurtain_Effect) .Process(this->IronCurtain_KillWarhead) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index 83d33cafd5..8ae59e11fe 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -199,6 +199,9 @@ class TechnoTypeExt : public ObjectTypeExt Nullable Passengers_SyncOwner; Nullable Passengers_SyncOwner_RevertOnExit; + Valueable PassengerTurret; + Valueable PassengerTurretWeapon; + Nullable IronCurtain_KeptOnDeploy; Nullable IronCurtain_Effect; Nullable IronCurtain_KillWarhead; @@ -608,6 +611,9 @@ class TechnoTypeExt : public ObjectTypeExt , Passengers_SyncOwner {} , Passengers_SyncOwner_RevertOnExit {} + , PassengerTurret { false } + , PassengerTurretWeapon { false } + , IronCurtain_KeptOnDeploy {} , IronCurtain_Effect {} , IronCurtain_KillWarhead {}