Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Ext/Techno/Body.Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void TechnoExt::OnEarlyUpdate()
{
this->UpdateShield();
this->UpdateAttachEffects();
this->UpdatePassengerTurretWeapon();
this->EatPassengers();
this->ApplySpawnLimitRange();
this->ApplyMindControlRangeLimit();
Expand Down Expand Up @@ -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<void(__thiscall*)(TechnoClass*, int)>(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;
Expand Down
1 change: 1 addition & 0 deletions src/Ext/Techno/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class TechnoExt : public RadioExt, public Detach::Listener<AirstrikeClass>

void ApplyInterceptor();
bool CheckDeathConditions(bool isInLimbo = false);
void UpdatePassengerTurretWeapon() const;
void EatPassengers();
void UpdateShield();
void ApplySpawnLimitRange();
Expand Down
6 changes: 6 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<true>(exINI, pSection, "IronCurtain.KillWarhead");
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ class TechnoTypeExt : public ObjectTypeExt
Nullable<bool> Passengers_SyncOwner;
Nullable<bool> Passengers_SyncOwner_RevertOnExit;

Valueable<bool> PassengerTurret;
Valueable<bool> PassengerTurretWeapon;

Nullable<bool> IronCurtain_KeptOnDeploy;
Nullable<IronCurtainEffect> IronCurtain_Effect;
Nullable<WarheadTypeClass*> IronCurtain_KillWarhead;
Expand Down Expand Up @@ -608,6 +611,9 @@ class TechnoTypeExt : public ObjectTypeExt
, Passengers_SyncOwner {}
, Passengers_SyncOwner_RevertOnExit {}

, PassengerTurret { false }
, PassengerTurretWeapon { false }

, IronCurtain_KeptOnDeploy {}
, IronCurtain_Effect {}
, IronCurtain_KillWarhead {}
Expand Down
Loading