diff --git a/src/Ext/Techno/Body.cpp b/src/Ext/Techno/Body.cpp index 26cddf886c..3b7ef3771c 100644 --- a/src/Ext/Techno/Body.cpp +++ b/src/Ext/Techno/Body.cpp @@ -26,8 +26,7 @@ TechnoExt::ExtData::~ExtData() vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); } - if (whatAmI != AbstractType::AircraftType && whatAmI != AbstractType::BuildingType - && pType->Ammo > 0 && pTypeExt->ReloadInTransport) + if (pType->Ammo > 0 && pTypeExt->ReloadInTransport) { auto& vec = ScenarioExt::Global()->TransportReloaders; vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); diff --git a/src/Ext/Techno/Hooks.Transport.cpp b/src/Ext/Techno/Hooks.Transport.cpp index 8416ebf863..c282237fac 100644 --- a/src/Ext/Techno/Hooks.Transport.cpp +++ b/src/Ext/Techno/Hooks.Transport.cpp @@ -79,11 +79,8 @@ DEFINE_HOOK(0x71067B, TechnoClass_EnterTransport, 0x7) if (pTransTypeExt->Passengers_SyncOwner && pTransTypeExt->Passengers_SyncOwner_RevertOnExit) pExt->OriginalPassengerOwner = pPassenger->Owner; - if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building - && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) - { + if (pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) ScenarioExt::Global()->TransportReloaders.push_back(pExt); - } } return 0; @@ -102,8 +99,7 @@ DEFINE_HOOK(0x4DE722, FootClass_LeaveTransport, 0x6) auto const pTransTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData; // Remove from transport reloader list before switching house - if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building - && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) + if (pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) { auto& vec = ScenarioExt::Global()->TransportReloaders; vec.erase(std::remove(vec.begin(), vec.end(), pExt), vec.end()); diff --git a/src/Ext/Techno/Hooks.cpp b/src/Ext/Techno/Hooks.cpp index d0e8769e5f..aaf3577e36 100644 --- a/src/Ext/Techno/Hooks.cpp +++ b/src/Ext/Techno/Hooks.cpp @@ -796,13 +796,13 @@ DEFINE_HOOK(0x5F4032, ObjectClass_FallingDown_ToDead, 0x6) if (const auto pTechno = abstract_cast(pThis)) { - const auto pType = pTechno->GetTechnoType(); + const auto pTypeExt = TechnoExt::ExtMap.Find(pTechno)->TypeExtData; + const auto pType = pTypeExt->OwnerObject(); const auto pCell = pTechno->GetCell(); if (!pCell->IsClearToMove(pType->SpeedType, true, true, -1, pType->MovementZone, pCell->GetLevel(), pCell->ContainsBridge())) return 0; - const auto pTypeExt = TechnoTypeExt::ExtMap.Find(pType); double ratio = 0.0; if (pCell->LandType == LandType::Water && !pTechno->OnBridge) diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 7402cbfefb..4164454581 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -730,17 +730,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->LowSelectionPriority.Read(exINI, pSection, "LowSelectionPriority"); this->LowDeployPriority.Read(exINI, pSection, "LowDeployPriority"); - if (pThis->Gunner) - { - this->WeaponGroupAs.resize(pThis->WeaponCount); - - for (int idx = 0; idx < pThis->WeaponCount; ++idx) - { - _snprintf_s(tempBuffer, sizeof(tempBuffer), "WeaponGroupAs%d", idx + 1); - this->WeaponGroupAs[idx].Read(pINI, pSection, tempBuffer); - } - } - this->RadarJamHouses.Read(exINI, pSection, "RadarJamHouses"); this->RadarJamDelay.Read(exINI, pSection, "RadarJamDelay"); this->RadarJamAffect.Read(exINI, pSection, "RadarJamAffect"); @@ -758,8 +747,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Spawner_UseTurretFacing.Read(exINI, pSection, "Spawner.UseTurretFacing"); this->Harvester_Counted.Read(exINI, pSection, "Harvester.Counted"); - if (!this->Harvester_Counted.isset() && pThis->Enslaves) - this->Harvester_Counted = true; this->Promote_IncludeSpawns.Read(exINI, pSection, "Promote.IncludeSpawns"); this->ImmuneToCrit.Read(exINI, pSection, "ImmuneToCrit"); @@ -769,7 +756,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) if (this->InitialStrength.isset()) this->InitialStrength = Math::clamp(this->InitialStrength, 1, pThis->Strength); - this->ReloadInTransport.Read(exINI, pSection, "ReloadInTransport"); this->ForbidParallelAIQueues.Read(exINI, pSection, "ForbidParallelAIQueues"); this->IgnoreForBaseCenter.Read(exINI, pSection, "IgnoreForBaseCenter"); @@ -778,13 +764,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->ShieldType.Read(exINI, pSection, "ShieldType"); - this->HarvesterDumpAmount.Read(exINI, pSection, "HarvesterDumpAmount"); - this->Ammo_AddOnDeploy.Read(exINI, pSection, "Ammo.AddOnDeploy"); - this->Ammo_AutoDeployMinimumAmount.Read(exINI, pSection, "Ammo.AutoDeployMinimumAmount"); - this->Ammo_AutoDeployMaximumAmount.Read(exINI, pSection, "Ammo.AutoDeployMaximumAmount"); - this->Ammo_DeployUnlockMinimumAmount.Read(exINI, pSection, "Ammo.DeployUnlockMinimumAmount"); - this->Ammo_DeployUnlockMaximumAmount.Read(exINI, pSection, "Ammo.DeployUnlockMaximumAmount"); this->AutoDeath_Behavior.Read(exINI, pSection, "AutoDeath.Behavior"); this->AutoDeath_VanishAnimation.Read(exINI, pSection, "AutoDeath.VanishAnimation"); @@ -802,7 +782,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->AutoDeath_TechnosExist_AllowLimboed.Read(exINI, pSection, "AutoDeath.TechnosExist.AllowLimboed"); this->AutoDeath_TechnosExist_Houses.Read(exINI, pSection, "AutoDeath.TechnosExist.Houses"); - this->Slaved_OwnerWhenMasterKilled.Read(exINI, pSection, "Slaved.OwnerWhenMasterKilled"); this->SlavesFreeSound.Read(exINI, pSection, "SlavesFreeSound"); this->SellSound.Read(exINI, pSection, "SellSound"); this->EVA_Sold.Read(exINI, pSection, "EVA.Sold"); @@ -837,30 +816,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->WarpOutWeapon.Read(exINI, pSection, "WarpOutWeapon"); this->WarpInWeapon_UseDistanceAsDamage.Read(exINI, pSection, "WarpInWeapon.UseDistanceAsDamage"); - exINI.ReadSpeed(pSection, "SubterraneanSpeed", &this->SubterraneanSpeed); - this->SubterraneanHeight.Read(exINI, pSection, "SubterraneanHeight"); - - this->OreGathering_Anims.Read(exINI, pSection, "OreGathering.Anims"); - this->OreGathering_Tiberiums.Read(exINI, pSection, "OreGathering.Tiberiums"); - this->OreGathering_FramesPerDir.Read(exINI, pSection, "OreGathering.FramesPerDir"); - - this->DestroyAnim_Random.Read(exINI, pSection, "DestroyAnim.Random"); - this->NotHuman_RandomDeathSequence.Read(exINI, pSection, "NotHuman.RandomDeathSequence"); - - this->DefaultDisguise.Read(exINI, pSection, "DefaultDisguise"); - this->UseDisguiseMovementSpeed.Read(exINI, pSection, "UseDisguiseMovementSpeed"); - - this->OpenTopped_RangeBonus.Read(exINI, pSection, "OpenTopped.RangeBonus"); - this->OpenTopped_DamageMultiplier.Read(exINI, pSection, "OpenTopped.DamageMultiplier"); - this->OpenTopped_WarpDistance.Read(exINI, pSection, "OpenTopped.WarpDistance"); - this->OpenTopped_IgnoreRangefinding.Read(exINI, pSection, "OpenTopped.IgnoreRangefinding"); - this->OpenTopped_AllowFiringIfDeactivated.Read(exINI, pSection, "OpenTopped.AllowFiringIfDeactivated"); - this->OpenTopped_ShareTransportTarget.Read(exINI, pSection, "OpenTopped.ShareTransportTarget"); - this->OpenTopped_UseTransportRangeModifiers.Read(exINI, pSection, "OpenTopped.UseTransportRangeModifiers"); - this->OpenTopped_CheckTransportDisableWeapons.Read(exINI, pSection, "OpenTopped.CheckTransportDisableWeapons"); - this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus"); - this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier"); - this->AutoTargetOwnPosition.Read(exINI, pSection, "AutoTargetOwnPosition"); this->AutoTargetOwnPosition_Self.Read(exINI, pSection, "AutoTargetOwnPosition.Self"); @@ -868,17 +823,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->NoSecondaryWeaponFallback_AllowAA.Read(exINI, pSection, "NoSecondaryWeaponFallback.AllowAA"); this->AllowWeaponSelectAgainstWalls.Read(exINI, pSection, "AllowWeaponSelectAgainstWalls"); - this->JumpjetRotateOnCrash.Read(exINI, pSection, "JumpjetRotateOnCrash"); - this->ShadowSizeCharacteristicHeight.Read(exINI, pSection, "ShadowSizeCharacteristicHeight"); - - this->IsSimpleDeployer_ConsiderPathfinding.Read(exINI, pSection, "IsSimpleDeployer.ConsiderPathfinding"); - this->IsSimpleDeployer_DisallowedLandTypes.Read(exINI, pSection, "IsSimpleDeployer.DisallowedLandTypes"); - this->DeployDir.Read(exINI, pSection, "DeployDir"); - this->DeployingAnims.Read(exINI, pSection, "DeployingAnims"); - this->DeployingAnim_KeepUnitVisible.Read(exINI, pSection, "DeployingAnim.KeepUnitVisible"); - this->DeployingAnim_ReverseForUndeploy.Read(exINI, pSection, "DeployingAnim.ReverseForUndeploy"); - this->DeployingAnim_UseUnitDrawer.Read(exINI, pSection, "DeployingAnim.UseUnitDrawer"); - this->EnemyUIName.Read(exINI, pSection, "EnemyUIName"); this->ForceWeapon_Naval_Decloaked.Read(exINI, pSection, "ForceWeapon.Naval.Decloaked"); @@ -920,11 +864,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) || this->ForceAAWeapon_Aircraft >= 0 ); - this->Ammo_Shared.Read(exINI, pSection, "Ammo.Shared"); - this->Ammo_Shared_Group.Read(exINI, pSection, "Ammo.Shared.Group"); this->SelfHealGainType.Read(exINI, pSection, "SelfHealGainType"); - this->Passengers_SyncOwner.Read(exINI, pSection, "Passengers.SyncOwner"); - this->Passengers_SyncOwner_RevertOnExit.Read(exINI, pSection, "Passengers.SyncOwner.RevertOnExit"); this->IronCurtain_KeptOnDeploy.Read(exINI, pSection, "IronCurtain.KeptOnDeploy"); this->IronCurtain_Effect.Read(exINI, pSection, "IronCurtain.Effect"); @@ -933,8 +873,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->ForceShield_Effect.Read(exINI, pSection, "ForceShield.Effect"); this->ForceShield_KillWarhead.Read(exINI, pSection, "ForceShield.KillWarhead"); - this->Explodes_KillPassengers.Read(exINI, pSection, "Explodes.KillPassengers"); - this->Explodes_DuringBuildup.Read(exINI, pSection, "Explodes.DuringBuildup"); this->DeployFireWeapon.Read(exINI, pSection, "DeployFireWeapon"); this->TargetZoneScanType.Read(exINI, pSection, "TargetZoneScanType"); @@ -957,19 +895,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Insignia_ShowEnemy.Read(exINI, pSection, "Insignia.ShowEnemy"); - this->JumpjetTilt.Read(exINI, pSection, "JumpjetTilt"); - this->JumpjetTilt_ForwardAccelFactor.Read(exINI, pSection, "JumpjetTilt.ForwardAccelFactor"); - this->JumpjetTilt_ForwardSpeedFactor.Read(exINI, pSection, "JumpjetTilt.ForwardSpeedFactor"); - this->JumpjetTilt_SidewaysRotationFactor.Read(exINI, pSection, "JumpjetTilt.SidewaysRotationFactor"); - this->JumpjetTilt_SidewaysSpeedFactor.Read(exINI, pSection, "JumpjetTilt.SidewaysSpeedFactor"); - - this->TiltsWhenCrushes_Vehicles.Read(exINI, pSection, "TiltsWhenCrushes.Vehicles"); - this->TiltsWhenCrushes_Overlays.Read(exINI, pSection, "TiltsWhenCrushes.Overlays"); - this->CrushForwardTiltPerFrame.Read(exINI, pSection, "CrushForwardTiltPerFrame"); - this->CrushOverlayExtraForwardTilt.Read(exINI, pSection, "CrushOverlayExtraForwardTilt"); - this->CrushSlowdownMultiplier.Read(exINI, pSection, "CrushSlowdownMultiplier"); - this->SkipCrushSlowdown.Read(exINI, pSection, "SkipCrushSlowdown"); - this->DigitalDisplay_Disable.Read(exINI, pSection, "DigitalDisplay.Disable"); this->DigitalDisplayTypes.Read(exINI, pSection, "DigitalDisplayTypes"); @@ -988,17 +913,11 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->SpawnsPipSize.Read(exINI, pSection, "SpawnsPipSize"); this->SpawnsPipOffset.Read(exINI, pSection, "SpawnsPipOffset"); - this->SpawnDistanceFromTarget.Read(exINI, pSection, "SpawnDistanceFromTarget"); - this->SpawnHeight.Read(exINI, pSection, "SpawnHeight"); - this->LandingDir.Read(exINI, pSection, "LandingDir"); - this->Convert_Deploy.Read(exINI, pSection, "Convert.Deploy"); this->Convert_HumanToComputer.Read(exINI, pSection, "Convert.HumanToComputer"); this->Convert_ComputerToHuman.Read(exINI, pSection, "Convert.ComputerToHuman"); this->Convert_ResetMindControl.Read(exINI, pSection, "Convert.ResetMindControl"); - this->CrateGoodie_RerollChance.Read(exINI, pSection, "CrateGoodie.RerollChance"); - this->Tint_Color.Read(exINI, pSection, "Tint.Color"); this->Tint_Intensity.Read(exINI, pSection, "Tint.Intensity"); this->Tint_VisibleToHouses.Read(exINI, pSection, "Tint.VisibleToHouses"); @@ -1018,11 +937,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->BuildLimitGroup_ExtraLimit_MaxCount.Read(exINI, pSection, "BuildLimitGroup.ExtraLimit.MaxCount"); this->BuildLimitGroup_ExtraLimit_MaxNum.Read(exINI, pSection, "BuildLimitGroup.ExtraLimit.MaxNum"); - this->AmphibiousEnter.Read(exINI, pSection, "AmphibiousEnter"); - this->AmphibiousUnload.Read(exINI, pSection, "AmphibiousUnload"); - this->NoQueueUpToEnter.Read(exINI, pSection, "NoQueueUpToEnter"); - this->NoQueueUpToUnload.Read(exINI, pSection, "NoQueueUpToUnload"); - this->RateDown_Delay.Read(exINI, pSection, "RateDown.Delay"); this->RateDown_Reset.Read(exINI, pSection, "RateDown.Reset"); this->RateDown_Cover_Value.Read(exINI, pSection, "RateDown.Cover.Value"); @@ -1032,11 +946,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->NoRearm_Temporal.Read(exINI, pSection, "NoRearm.Temporal"); this->NoReload_UnderEMP.Read(exINI, pSection, "NoReload.UnderEMP"); this->NoReload_Temporal.Read(exINI, pSection, "NoReload.Temporal"); - this->NoTurret_TrackTarget.Read(exINI, pSection, "NoTurret.TrackTarget"); - - this->Wake.Read(exINI, pSection, "Wake"); - this->Wake_Grapple.Read(exINI, pSection, "Wake.Grapple"); - this->Wake_Sinking.Read(exINI, pSection, "Wake.Sinking"); this->AINormalTargetingDelay.Read(exINI, pSection, "AINormalTargetingDelay"); this->PlayerNormalTargetingDelay.Read(exINI, pSection, "PlayerNormalTargetingDelay"); @@ -1046,30 +955,10 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->PlayerAttackMoveTargetingDelay.Read(exINI, pSection, "PlayerAttackMoveTargetingDelay"); this->DistributeTargetingFrame.Read(exINI, pSection, "DistributeTargetingFrame"); - this->BunkerableAnyway.Read(exINI, pSection, "BunkerableAnyway"); - - this->DigitalDisplay_Health_FakeAtDisguise.Read(exINI, pSection, "DigitalDisplay.Health.FakeAtDisguise"); - - this->AttackMove_Aggressive.Read(exINI, pSection, "AttackMove.Aggressive"); - this->AttackMove_UpdateTarget.Read(exINI, pSection, "AttackMove.UpdateTarget"); - - this->KeepTargetOnMove.Read(exINI, pSection, "KeepTargetOnMove"); - this->KeepTargetOnMove_Weapon.Read(exINI, pSection, "KeepTargetOnMove.Weapon"); - this->KeepTargetOnMove_NoMorePursuit.Read(exINI, pSection, "KeepTargetOnMove.NoMorePursuit"); - this->KeepTargetOnMove_ExtraDistance.Read(exINI, pSection, "KeepTargetOnMove.ExtraDistance"); - this->Power.Read(exINI, pSection, "Power"); this->AllowAirstrike.Read(exINI, pSection, "AllowAirstrike"); - this->Image_ConditionYellow.Read(exINI, pSection, "Image.ConditionYellow"); - this->Image_ConditionRed.Read(exINI, pSection, "Image.ConditionRed"); - this->WaterImage_ConditionYellow.Read(exINI, pSection, "WaterImage.ConditionYellow"); - this->WaterImage_ConditionRed.Read(exINI, pSection, "WaterImage.ConditionRed"); - - this->NeedDamagedImage = this->Image_ConditionYellow.isset() || this->Image_ConditionRed.isset() - || this->WaterImage_ConditionYellow.isset() || this->WaterImage_ConditionRed.isset(); - this->InitialSpawnsNumber.Read(exINI, pSection, "InitialSpawnsNumber"); this->Spawns_Queue.Read(exINI, pSection, "Spawns.Queue"); @@ -1078,13 +967,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Spawner_RecycleCoord.Read(exINI, pSection, "Spawner.RecycleCoord"); this->Spawner_RecycleOnTurret.Read(exINI, pSection, "Spawner.RecycleOnTurret"); - this->Sinkable.Read(exINI, pSection, "Sinkable"); - this->Sinkable_SquidGrab.Read(exINI, pSection, "Sinkable.SquidGrab"); - this->SinkSpeed.Read(exINI, pSection, "SinkSpeed"); - - this->DamagedSpeed.Read(exINI, pSection, "DamagedSpeed"); - this->ProneSpeed.Read(exINI, pSection, "ProneSpeed"); - this->SuppressKillWeapons.Read(exINI, pSection, "SuppressKillWeapons"); this->SuppressKillWeapons_Types.Read(exINI, pSection, "SuppressKillWeapons.Types"); @@ -1100,42 +982,17 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Overload_ParticleSys.Read(exINI, pSection, "Overload.ParticleSys"); this->Overload_ParticleSysCount.Read(exINI, pSection, "Overload.ParticleSysCount"); - this->Harvester_CanGuardArea.Read(exINI, pSection, "Harvester.CanGuardArea"); - this->Harvester_CanGuardArea_RequireTarget.Read(exINI, pSection, "Harvester.CanGuardArea.RequireTarget"); - this->HarvesterScanAfterUnload.Read(exINI, pSection, "HarvesterScanAfterUnload"); - - this->ExtendedAircraftMissions_SmoothMoving.Read(exINI, pSection, "ExtendedAircraftMissions.SmoothMoving"); - this->ExtendedAircraftMissions_EarlyDescend.Read(exINI, pSection, "ExtendedAircraftMissions.EarlyDescend"); - this->ExtendedAircraftMissions_RearApproach.Read(exINI, pSection, "ExtendedAircraftMissions.RearApproach"); - this->ExtendedAircraftMissions_FastScramble.Read(exINI, pSection, "ExtendedAircraftMissions.FastScramble"); - this->ExtendedAircraftMissions_UnlandDamage.Read(exINI, pSection, "ExtendedAircraftMissions.UnlandDamage"); - - this->FallingDownDamage.Read(exINI, pSection, "FallingDownDamage"); - this->FallingDownDamage_Water.Read(exINI, pSection, "FallingDownDamage.Water"); - this->FiringForceScatter.Read(exINI, pSection, "FiringForceScatter"); - this->EngineerRepairAmount.Read(exINI, pSection, "EngineerRepairAmount"); - this->DebrisTypes_Limit.Read(exINI, pSection, "DebrisTypes.Limit"); this->DebrisMinimums.Read(exINI, pSection, "DebrisMinimums"); - this->AttackMove_Follow.Read(exINI, pSection, "AttackMove.Follow"); - this->AttackMove_Follow_IncludeAir.Read(exINI, pSection, "AttackMove.Follow.IncludeAir"); - this->AttackMove_Follow_IfMindControlIsFull.Read(exINI, pSection, "AttackMove.Follow.IfMindControlIsFull"); - this->AttackMove_StopWhenTargetAcquired.Read(exINI, pSection, "AttackMove.StopWhenTargetAcquired"); - this->AttackMove_PursuitTarget.Read(exINI, pSection, "AttackMove.PursuitTarget"); - this->Ammo_AutoConvertMinimumAmount.Read(exINI, pSection, "Ammo.AutoConvertMinimumAmount"); this->Ammo_AutoConvertMaximumAmount.Read(exINI, pSection, "Ammo.AutoConvertMaximumAmount"); this->Ammo_AutoConvertType.Read(exINI, pSection, "Ammo.AutoConvertType"); if (this->Ammo_AutoConvertMinimumAmount > this->Ammo_AutoConvertMaximumAmount) Debug::Log("[Developer warning][%s] Ammo.AutoConvertMinimumAmount is greater than Ammo.AutoConvertMaximumAmount, resulting in no conversion.\n", pSection); - - this->InfantryAutoDeploy.Read(exINI, pSection, "InfantryAutoDeploy"); - - this->TeamMember_ConsideredAs.Read(exINI, pSection, "TeamMember.ConsideredAs"); // Ares 0.2 this->RadarJamRadius.Read(exINI, pSection, "RadarJamRadius"); @@ -1151,48 +1008,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->NoAmmoWeapon.Read(exINI, pSection, "NoAmmoWeapon"); this->NoAmmoAmount.Read(exINI, pSection, "NoAmmoAmount"); - // Ares 2.0 - this->Passengers_BySize.Read(exINI, pSection, "Passengers.BySize"); - - if (pThis->Gunner) - { - size_t weaponCount = pThis->WeaponCount; - - if (this->Insignia_Weapon.empty() || this->Insignia_Weapon.size() != weaponCount) - { - this->Insignia_Weapon.resize(weaponCount); - this->InsigniaFrame_Weapon.resize(weaponCount, Promotable(-1)); - Valueable> frames; - frames = Vector3D(-1, -1, -1); - this->InsigniaFrames_Weapon.resize(weaponCount, frames); - } - - for (size_t i = 0; i < weaponCount; i++) - { - Nullable InsigniaType_Weapon; - _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaType.Weapon%d", i + 1); - InsigniaType_Weapon.Read(exINI, pSection, tempBuffer); - - if (InsigniaType_Weapon.isset()) - { - this->Insignia_Weapon[i] = InsigniaType_Weapon.Get()->Insignia; - this->InsigniaFrame_Weapon[i] = InsigniaType_Weapon.Get()->InsigniaFrame; - this->InsigniaFrames_Weapon[i] = Vector3D(-1, -1, -1); // override it so only InsigniaFrame will be used - } - else - { - _snprintf_s(tempBuffer, sizeof(tempBuffer), "Insignia.Weapon%d.%s", i + 1, "%s"); - this->Insignia_Weapon[i].Read(exINI, pSection, tempBuffer); - - _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaFrame.Weapon%d.%s", i + 1, "%s"); - this->InsigniaFrame_Weapon[i].Read(exINI, pSection, tempBuffer); - - _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaFrames.Weapon%d", i + 1); - this->InsigniaFrames_Weapon[i].Read(exINI, pSection, tempBuffer); - } - } - } - if (pThis->Passengers > 0) { size_t passengers = pThis->Passengers + 1; @@ -1240,8 +1055,6 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) INI_EX exArtINI(pArtINI); auto pArtSection = pThis->ImageFile; - this->TurretOffset.Read(exArtINI, pArtSection, "TurretOffset"); - this->TurretShadow.Read(exArtINI, pArtSection, "TurretShadow"); ValueableVector shadow_indices; shadow_indices.Read(exArtINI, pArtSection, "ShadowIndices"); ValueableVector shadow_indices_frame; @@ -1282,15 +1095,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) } this->ParseBurstFLHs(exArtINI, pArtSection, this->WeaponBurstFLHs, this->EliteWeaponBurstFLHs, ""); - this->ParseBurstFLHs(exArtINI, pArtSection, this->DeployedWeaponBurstFLHs, this->EliteDeployedWeaponBurstFLHs, "Deployed"); - this->ParseBurstFLHs(exArtINI, pArtSection, this->CrouchedWeaponBurstFLHs, this->EliteCrouchedWeaponBurstFLHs, "Prone"); - this->OnlyUseLandSequences.Read(exArtINI, pArtSection, "OnlyUseLandSequences"); - - this->PronePrimaryFireFLH.Read(exArtINI, pArtSection, "PronePrimaryFireFLH"); - this->ProneSecondaryFireFLH.Read(exArtINI, pArtSection, "ProneSecondaryFireFLH"); - this->DeployedPrimaryFireFLH.Read(exArtINI, pArtSection, "DeployedPrimaryFireFLH"); - this->DeployedSecondaryFireFLH.Read(exArtINI, pArtSection, "DeployedSecondaryFireFLH"); this->AlternateFLH_OnTurret.Read(exArtINI, pArtSection, "AlternateFLH.OnTurret"); this->AlternateFLH_ApplyVehicle.Read(exArtINI, pArtSection, "AlternateFLH.ApplyVehicle"); @@ -1312,36 +1117,8 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->AlternateFLHs.emplace_back(alternateFLH); } - // Parasitic types this->AttachEffects.LoadFromINI(pINI, pSection); - auto [canParse, resetValue] = PassengerDeletionTypeClass::CanParse(exINI, pSection); - - if (canParse && !this->PassengerDeletionType) - this->PassengerDeletionType = std::make_unique(pThis); - - if (this->PassengerDeletionType) - { - if (resetValue) - this->PassengerDeletionType.reset(); - else - this->PassengerDeletionType->LoadFromINI(pINI, pSection); - } - - Nullable transDelay; - transDelay.Read(exINI, pSection, "TiberiumEater.TransDelay"); - - if (transDelay.Get(-1) >= 0 && !this->TiberiumEaterType) - this->TiberiumEaterType = std::make_unique(); - - if (this->TiberiumEaterType) - { - if (transDelay.isset() && transDelay.Get() < 0) - this->TiberiumEaterType.reset(); - else - this->TiberiumEaterType->LoadFromINI(pINI, pSection); - } - Nullable isInterceptor; isInterceptor.Read(exINI, pSection, "Interceptor"); @@ -1357,34 +1134,82 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->InterceptorType.reset(); } - if (pThis->WhatAmI() != AbstractType::BuildingType) - { - if (this->DroppodType == nullptr) - this->DroppodType = std::make_unique(); - - this->DroppodType->LoadFromINI(pINI, pSection); - } - else - { - this->DroppodType.reset(); - } - if (GeneralUtils::IsValidString(pThis->PaletteFile) && !pThis->Palette) Debug::Log("[Developer warning] [%s] has Palette=%s set but no palette file was loaded (missing file or wrong filename). Missing palettes cause issues with lighting recalculations.\n", pArtSection, pThis->PaletteFile); - this->LoadFromINIByWhatAmI(exINI, pSection, exArtINI, pArtSection); + this->LoadFromINIByWhatAmI(pINI, exINI, pSection, exArtINI, pArtSection, pThis); // VoiceIFVRepair from Ares 0.2 this->VoiceIFVRepair.Read(exINI, pSection, "VoiceIFVRepair"); this->ParseVoiceWeaponAttacks(exINI, pSection, this->VoiceWeaponAttacks, this->VoiceEliteWeaponAttacks); } -void TechnoTypeExt::ExtData::LoadFromINIByWhatAmI(INI_EX& exINI, const char* pSection, INI_EX& exArtINI, const char* pArtSection) +void TechnoTypeExt::ExtData::LoadFromINIByWhatAmI(CCINIClass* const pINI, INI_EX& exINI, const char* pSection, INI_EX& exArtINI, const char* pArtSection, TechnoTypeClass* pThis) { - AbstractType abs = this->OwnerObject()->WhatAmI(); + this->AbsType = pThis->WhatAmI(); + char tempBuffer[40]; - switch (abs) + switch (this->AbsType) + { + case AbstractType::InfantryType: { + this->ReloadInTransport.Read(exINI, pSection, "ReloadInTransport"); + this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus"); + this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier"); + this->Slaved_OwnerWhenMasterKilled.Read(exINI, pSection, "Slaved.OwnerWhenMasterKilled"); + this->NotHuman_RandomDeathSequence.Read(exINI, pSection, "NotHuman.RandomDeathSequence"); + this->ProneSpeed.Read(exINI, pSection, "ProneSpeed"); + this->EngineerRepairAmount.Read(exINI, pSection, "EngineerRepairAmount"); + this->InfantryAutoDeploy.Read(exINI, pSection, "InfantryAutoDeploy"); + this->TeamMember_ConsideredAs.Read(exINI, pSection, "TeamMember.ConsideredAs"); + this->OnlyUseLandSequences.Read(exArtINI, pArtSection, "OnlyUseLandSequences"); + + this->DefaultDisguise.Read(exINI, pSection, "DefaultDisguise"); + this->UseDisguiseMovementSpeed.Read(exINI, pSection, "UseDisguiseMovementSpeed"); + this->DigitalDisplay_Health_FakeAtDisguise.Read(exINI, pSection, "DigitalDisplay.Health.FakeAtDisguise"); + + this->FallingDownDamage.Read(exINI, pSection, "FallingDownDamage"); + this->FallingDownDamage_Water.Read(exINI, pSection, "FallingDownDamage.Water"); + + this->AttackMove_Aggressive.Read(exINI, pSection, "AttackMove.Aggressive"); + this->AttackMove_UpdateTarget.Read(exINI, pSection, "AttackMove.UpdateTarget"); + this->AttackMove_Follow.Read(exINI, pSection, "AttackMove.Follow"); + this->AttackMove_Follow_IncludeAir.Read(exINI, pSection, "AttackMove.Follow.IncludeAir"); + this->AttackMove_Follow_IfMindControlIsFull.Read(exINI, pSection, "AttackMove.Follow.IfMindControlIsFull"); + this->AttackMove_StopWhenTargetAcquired.Read(exINI, pSection, "AttackMove.StopWhenTargetAcquired"); + this->AttackMove_PursuitTarget.Read(exINI, pSection, "AttackMove.PursuitTarget"); + + this->ParseBurstFLHs(exArtINI, pArtSection, this->DeployedWeaponBurstFLHs, this->EliteDeployedWeaponBurstFLHs, "Deployed"); + this->ParseBurstFLHs(exArtINI, pArtSection, this->CrouchedWeaponBurstFLHs, this->EliteCrouchedWeaponBurstFLHs, "Prone"); + this->PronePrimaryFireFLH.Read(exArtINI, pArtSection, "PronePrimaryFireFLH"); + this->ProneSecondaryFireFLH.Read(exArtINI, pArtSection, "ProneSecondaryFireFLH"); + this->DeployedPrimaryFireFLH.Read(exArtINI, pArtSection, "DeployedPrimaryFireFLH"); + this->DeployedSecondaryFireFLH.Read(exArtINI, pArtSection, "DeployedSecondaryFireFLH"); + + if (!this->Harvester_Counted.isset() && pThis->Enslaves) + this->Harvester_Counted = true; + + if (this->DroppodType == nullptr) + this->DroppodType = std::make_unique(); + + this->DroppodType->LoadFromINI(pINI, pSection); + + Nullable transDelay; + transDelay.Read(exINI, pSection, "TiberiumEater.TransDelay"); + + if (transDelay.Get(-1) >= 0 && !this->TiberiumEaterType) + this->TiberiumEaterType = std::make_unique(); + + if (this->TiberiumEaterType) + { + if (transDelay.isset() && transDelay.Get() < 0) + this->TiberiumEaterType.reset(); + else + this->TiberiumEaterType->LoadFromINI(pINI, pSection); + } + + break; + } case AbstractType::UnitType: { this->FireUp.Read(exArtINI, pArtSection, "FireUp"); @@ -1394,9 +1219,291 @@ void TechnoTypeExt::ExtData::LoadFromINIByWhatAmI(INI_EX& exINI, const char* pSe this->Deploy_NoPassenger.Read(exINI, pSection, "Deploy.NoPassenger"); this->Deploy_NoTiberium.Read(exINI, pSection, "Deploy.NoTiberium"); //this->SecondaryFire.Read(exArtINI, pArtSection, "SecondaryFire"); + + this->Ammo_AutoDeployMinimumAmount.Read(exINI, pSection, "Ammo.AutoDeployMinimumAmount"); + this->Ammo_AutoDeployMaximumAmount.Read(exINI, pSection, "Ammo.AutoDeployMaximumAmount"); + this->Ammo_DeployUnlockMinimumAmount.Read(exINI, pSection, "Ammo.DeployUnlockMinimumAmount"); + this->Ammo_DeployUnlockMaximumAmount.Read(exINI, pSection, "Ammo.DeployUnlockMaximumAmount"); + + this->HarvesterDumpAmount.Read(exINI, pSection, "HarvesterDumpAmount"); + this->Harvester_CanGuardArea.Read(exINI, pSection, "Harvester.CanGuardArea"); + this->Harvester_CanGuardArea_RequireTarget.Read(exINI, pSection, "Harvester.CanGuardArea.RequireTarget"); + this->HarvesterScanAfterUnload.Read(exINI, pSection, "HarvesterScanAfterUnload"); + this->OreGathering_Anims.Read(exINI, pSection, "OreGathering.Anims"); + this->OreGathering_Tiberiums.Read(exINI, pSection, "OreGathering.Tiberiums"); + this->OreGathering_FramesPerDir.Read(exINI, pSection, "OreGathering.FramesPerDir"); + + this->Passengers_SyncOwner.Read(exINI, pSection, "Passengers.SyncOwner"); + this->Passengers_SyncOwner_RevertOnExit.Read(exINI, pSection, "Passengers.SyncOwner.RevertOnExit"); + this->Explodes_KillPassengers.Read(exINI, pSection, "Explodes.KillPassengers"); + this->Ammo_Shared.Read(exINI, pSection, "Ammo.Shared"); + this->Ammo_Shared_Group.Read(exINI, pSection, "Ammo.Shared.Group"); + this->AmphibiousEnter.Read(exINI, pSection, "AmphibiousEnter"); + this->AmphibiousUnload.Read(exINI, pSection, "AmphibiousUnload"); + this->NoQueueUpToEnter.Read(exINI, pSection, "NoQueueUpToEnter"); + this->NoQueueUpToUnload.Read(exINI, pSection, "NoQueueUpToUnload"); + + // Ares 2.0 + this->Passengers_BySize.Read(exINI, pSection, "Passengers.BySize"); + + this->OpenTopped_RangeBonus.Read(exINI, pSection, "OpenTopped.RangeBonus"); + this->OpenTopped_DamageMultiplier.Read(exINI, pSection, "OpenTopped.DamageMultiplier"); + this->OpenTopped_WarpDistance.Read(exINI, pSection, "OpenTopped.WarpDistance"); + this->OpenTopped_IgnoreRangefinding.Read(exINI, pSection, "OpenTopped.IgnoreRangefinding"); + this->OpenTopped_AllowFiringIfDeactivated.Read(exINI, pSection, "OpenTopped.AllowFiringIfDeactivated"); + this->OpenTopped_ShareTransportTarget.Read(exINI, pSection, "OpenTopped.ShareTransportTarget"); + this->OpenTopped_UseTransportRangeModifiers.Read(exINI, pSection, "OpenTopped.UseTransportRangeModifiers"); + this->OpenTopped_CheckTransportDisableWeapons.Read(exINI, pSection, "OpenTopped.CheckTransportDisableWeapons"); + + this->JumpjetRotateOnCrash.Read(exINI, pSection, "JumpjetRotateOnCrash"); + this->JumpjetTilt.Read(exINI, pSection, "JumpjetTilt"); + this->JumpjetTilt_ForwardAccelFactor.Read(exINI, pSection, "JumpjetTilt.ForwardAccelFactor"); + this->JumpjetTilt_ForwardSpeedFactor.Read(exINI, pSection, "JumpjetTilt.ForwardSpeedFactor"); + this->JumpjetTilt_SidewaysRotationFactor.Read(exINI, pSection, "JumpjetTilt.SidewaysRotationFactor"); + this->JumpjetTilt_SidewaysSpeedFactor.Read(exINI, pSection, "JumpjetTilt.SidewaysSpeedFactor"); + + this->TiltsWhenCrushes_Vehicles.Read(exINI, pSection, "TiltsWhenCrushes.Vehicles"); + this->TiltsWhenCrushes_Overlays.Read(exINI, pSection, "TiltsWhenCrushes.Overlays"); + this->CrushForwardTiltPerFrame.Read(exINI, pSection, "CrushForwardTiltPerFrame"); + this->CrushOverlayExtraForwardTilt.Read(exINI, pSection, "CrushOverlayExtraForwardTilt"); + this->CrushSlowdownMultiplier.Read(exINI, pSection, "CrushSlowdownMultiplier"); + this->SkipCrushSlowdown.Read(exINI, pSection, "SkipCrushSlowdown"); + + this->ShadowSizeCharacteristicHeight.Read(exINI, pSection, "ShadowSizeCharacteristicHeight"); + this->TurretOffset.Read(exArtINI, pArtSection, "TurretOffset"); + this->TurretShadow.Read(exArtINI, pArtSection, "TurretShadow"); + + this->IsSimpleDeployer_ConsiderPathfinding.Read(exINI, pSection, "IsSimpleDeployer.ConsiderPathfinding"); + this->IsSimpleDeployer_DisallowedLandTypes.Read(exINI, pSection, "IsSimpleDeployer.DisallowedLandTypes"); + this->DeployDir.Read(exINI, pSection, "DeployDir"); + this->DeployingAnims.Read(exINI, pSection, "DeployingAnims"); + this->DeployingAnim_KeepUnitVisible.Read(exINI, pSection, "DeployingAnim.KeepUnitVisible"); + this->DeployingAnim_ReverseForUndeploy.Read(exINI, pSection, "DeployingAnim.ReverseForUndeploy"); + this->DeployingAnim_UseUnitDrawer.Read(exINI, pSection, "DeployingAnim.UseUnitDrawer"); + + this->Wake.Read(exINI, pSection, "Wake"); + this->Wake_Grapple.Read(exINI, pSection, "Wake.Grapple"); + this->Wake_Sinking.Read(exINI, pSection, "Wake.Sinking"); + + exINI.ReadSpeed(pSection, "SubterraneanSpeed", &this->SubterraneanSpeed); + this->SubterraneanHeight.Read(exINI, pSection, "SubterraneanHeight"); + + this->ReloadInTransport.Read(exINI, pSection, "ReloadInTransport"); + this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus"); + this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier"); + this->CrateGoodie_RerollChance.Read(exINI, pSection, "CrateGoodie.RerollChance"); + this->BunkerableAnyway.Read(exINI, pSection, "BunkerableAnyway"); + this->DamagedSpeed.Read(exINI, pSection, "DamagedSpeed"); + this->NoTurret_TrackTarget.Read(exINI, pSection, "NoTurret.TrackTarget"); + this->TeamMember_ConsideredAs.Read(exINI, pSection, "TeamMember.ConsideredAs"); + this->DestroyAnim_Random.Read(exINI, pSection, "DestroyAnim.Random"); + + this->Sinkable.Read(exINI, pSection, "Sinkable"); + this->Sinkable_SquidGrab.Read(exINI, pSection, "Sinkable.SquidGrab"); + this->SinkSpeed.Read(exINI, pSection, "SinkSpeed"); + + this->FallingDownDamage.Read(exINI, pSection, "FallingDownDamage"); + this->FallingDownDamage_Water.Read(exINI, pSection, "FallingDownDamage.Water"); + + this->AttackMove_Aggressive.Read(exINI, pSection, "AttackMove.Aggressive"); + this->AttackMove_UpdateTarget.Read(exINI, pSection, "AttackMove.UpdateTarget"); + this->AttackMove_Follow.Read(exINI, pSection, "AttackMove.Follow"); + this->AttackMove_Follow_IncludeAir.Read(exINI, pSection, "AttackMove.Follow.IncludeAir"); + this->AttackMove_Follow_IfMindControlIsFull.Read(exINI, pSection, "AttackMove.Follow.IfMindControlIsFull"); + this->AttackMove_StopWhenTargetAcquired.Read(exINI, pSection, "AttackMove.StopWhenTargetAcquired"); + this->AttackMove_PursuitTarget.Read(exINI, pSection, "AttackMove.PursuitTarget"); + + this->KeepTargetOnMove.Read(exINI, pSection, "KeepTargetOnMove"); + this->KeepTargetOnMove_Weapon.Read(exINI, pSection, "KeepTargetOnMove.Weapon"); + this->KeepTargetOnMove_NoMorePursuit.Read(exINI, pSection, "KeepTargetOnMove.NoMorePursuit"); + this->KeepTargetOnMove_ExtraDistance.Read(exINI, pSection, "KeepTargetOnMove.ExtraDistance"); + + this->Image_ConditionYellow.Read(exINI, pSection, "Image.ConditionYellow"); + this->Image_ConditionRed.Read(exINI, pSection, "Image.ConditionRed"); + this->WaterImage_ConditionYellow.Read(exINI, pSection, "WaterImage.ConditionYellow"); + this->WaterImage_ConditionRed.Read(exINI, pSection, "WaterImage.ConditionRed"); + + this->NeedDamagedImage = this->Image_ConditionYellow.isset() || this->Image_ConditionRed.isset() + || this->WaterImage_ConditionYellow.isset() || this->WaterImage_ConditionRed.isset(); + + if (pThis->Gunner) + { + size_t weaponCount = pThis->WeaponCount; + this->WeaponGroupAs.resize(weaponCount); + + for (int idx = 0; idx < weaponCount; ++idx) + { + _snprintf_s(tempBuffer, sizeof(tempBuffer), "WeaponGroupAs%d", idx + 1); + this->WeaponGroupAs[idx].Read(pINI, pSection, tempBuffer); + } + + if (this->Insignia_Weapon.empty() || this->Insignia_Weapon.size() != weaponCount) + { + this->Insignia_Weapon.resize(weaponCount); + this->InsigniaFrame_Weapon.resize(weaponCount, Promotable(-1)); + Valueable> frames; + frames = Vector3D(-1, -1, -1); + this->InsigniaFrames_Weapon.resize(weaponCount, frames); + } + + for (size_t i = 0; i < weaponCount; i++) + { + Nullable InsigniaType_Weapon; + _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaType.Weapon%d", i + 1); + InsigniaType_Weapon.Read(exINI, pSection, tempBuffer); + + if (InsigniaType_Weapon.isset()) + { + this->Insignia_Weapon[i] = InsigniaType_Weapon.Get()->Insignia; + this->InsigniaFrame_Weapon[i] = InsigniaType_Weapon.Get()->InsigniaFrame; + this->InsigniaFrames_Weapon[i] = Vector3D(-1, -1, -1); // override it so only InsigniaFrame will be used + } + else + { + _snprintf_s(tempBuffer, sizeof(tempBuffer), "Insignia.Weapon%d.%s", i + 1, "%s"); + this->Insignia_Weapon[i].Read(exINI, pSection, tempBuffer); + + _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaFrame.Weapon%d.%s", i + 1, "%s"); + this->InsigniaFrame_Weapon[i].Read(exINI, pSection, tempBuffer); + + _snprintf_s(tempBuffer, sizeof(tempBuffer), "InsigniaFrames.Weapon%d", i + 1); + this->InsigniaFrames_Weapon[i].Read(exINI, pSection, tempBuffer); + } + } + } + + if (this->DroppodType == nullptr) + this->DroppodType = std::make_unique(); + + this->DroppodType->LoadFromINI(pINI, pSection); + + Nullable transDelay; + transDelay.Read(exINI, pSection, "TiberiumEater.TransDelay"); + + if (transDelay.Get(-1) >= 0 && !this->TiberiumEaterType) + this->TiberiumEaterType = std::make_unique(); + + if (this->TiberiumEaterType) + { + if (transDelay.isset() && transDelay.Get() < 0) + this->TiberiumEaterType.reset(); + else + this->TiberiumEaterType->LoadFromINI(pINI, pSection); + } + + auto [canParse, resetValue] = PassengerDeletionTypeClass::CanParse(exINI, pSection); + + if (canParse && !this->PassengerDeletionType) + this->PassengerDeletionType = std::make_unique(pThis); + + if (this->PassengerDeletionType) + { + if (resetValue) + this->PassengerDeletionType.reset(); + else + this->PassengerDeletionType->LoadFromINI(pINI, pSection); + } + + break; + } + case AbstractType::AircraftType: + { + this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus"); + this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier"); + this->ShadowSizeCharacteristicHeight.Read(exINI, pSection, "ShadowSizeCharacteristicHeight"); + this->TeamMember_ConsideredAs.Read(exINI, pSection, "TeamMember.ConsideredAs"); + + this->SpawnDistanceFromTarget.Read(exINI, pSection, "SpawnDistanceFromTarget"); + this->SpawnHeight.Read(exINI, pSection, "SpawnHeight"); + this->LandingDir.Read(exINI, pSection, "LandingDir"); + + this->FallingDownDamage.Read(exINI, pSection, "FallingDownDamage"); + this->FallingDownDamage_Water.Read(exINI, pSection, "FallingDownDamage.Water"); + + this->AttackMove_Aggressive.Read(exINI, pSection, "AttackMove.Aggressive"); + this->AttackMove_UpdateTarget.Read(exINI, pSection, "AttackMove.UpdateTarget"); + this->AttackMove_Follow.Read(exINI, pSection, "AttackMove.Follow"); + this->AttackMove_Follow_IncludeAir.Read(exINI, pSection, "AttackMove.Follow.IncludeAir"); + this->AttackMove_Follow_IfMindControlIsFull.Read(exINI, pSection, "AttackMove.Follow.IfMindControlIsFull"); + this->AttackMove_StopWhenTargetAcquired.Read(exINI, pSection, "AttackMove.StopWhenTargetAcquired"); + this->AttackMove_PursuitTarget.Read(exINI, pSection, "AttackMove.PursuitTarget"); + + this->Image_ConditionYellow.Read(exINI, pSection, "Image.ConditionYellow"); + this->Image_ConditionRed.Read(exINI, pSection, "Image.ConditionRed"); + + this->NeedDamagedImage = this->Image_ConditionYellow.isset() || this->Image_ConditionRed.isset(); + + this->Passengers_SyncOwner.Read(exINI, pSection, "Passengers.SyncOwner"); + this->Passengers_SyncOwner_RevertOnExit.Read(exINI, pSection, "Passengers.SyncOwner.RevertOnExit"); + this->Explodes_KillPassengers.Read(exINI, pSection, "Explodes.KillPassengers"); + this->NoQueueUpToEnter.Read(exINI, pSection, "NoQueueUpToEnter"); + this->NoQueueUpToUnload.Read(exINI, pSection, "NoQueueUpToUnload"); + + // Ares 2.0 + this->Passengers_BySize.Read(exINI, pSection, "Passengers.BySize"); + + if (this->DroppodType == nullptr) + this->DroppodType = std::make_unique(); + + this->DroppodType->LoadFromINI(pINI, pSection); + + Nullable transDelay; + transDelay.Read(exINI, pSection, "TiberiumEater.TransDelay"); + + if (transDelay.Get(-1) >= 0 && !this->TiberiumEaterType) + this->TiberiumEaterType = std::make_unique(); + + if (this->TiberiumEaterType) + { + if (transDelay.isset() && transDelay.Get() < 0) + this->TiberiumEaterType.reset(); + else + this->TiberiumEaterType->LoadFromINI(pINI, pSection); + } + + auto [canParse, resetValue] = PassengerDeletionTypeClass::CanParse(exINI, pSection); + + if (canParse && !this->PassengerDeletionType) + this->PassengerDeletionType = std::make_unique(pThis); + + if (this->PassengerDeletionType) + { + if (resetValue) + this->PassengerDeletionType.reset(); + else + this->PassengerDeletionType->LoadFromINI(pINI, pSection); + } + break; } default: + this->Explodes_DuringBuildup.Read(exINI, pSection, "Explodes.DuringBuildup"); + this->EngineerRepairAmount.Read(exINI, pSection, "EngineerRepairAmount"); + + this->Passengers_SyncOwner.Read(exINI, pSection, "Passengers.SyncOwner"); + this->Passengers_SyncOwner_RevertOnExit.Read(exINI, pSection, "Passengers.SyncOwner.RevertOnExit"); + this->Explodes_KillPassengers.Read(exINI, pSection, "Explodes.KillPassengers"); + this->NoQueueUpToEnter.Read(exINI, pSection, "NoQueueUpToEnter"); + this->NoQueueUpToUnload.Read(exINI, pSection, "NoQueueUpToUnload"); + + // Ares 2.0 + this->Passengers_BySize.Read(exINI, pSection, "Passengers.BySize"); + + this->DroppodType.reset(); + + auto [canParse, resetValue] = PassengerDeletionTypeClass::CanParse(exINI, pSection); + + if (canParse && !this->PassengerDeletionType) + this->PassengerDeletionType = std::make_unique(pThis); + + if (this->PassengerDeletionType) + { + if (resetValue) + this->PassengerDeletionType.reset(); + else + this->PassengerDeletionType->LoadFromINI(pINI, pSection); + } + break; } } @@ -1405,6 +1512,8 @@ template void TechnoTypeExt::ExtData::Serialize(T& Stm) { Stm + .Process(this->AbsType) + .Process(this->HealthBar_Hide) .Process(this->HealthBar_HidePips) .Process(this->HealthBar_Permanent) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index 9ddbc78f3d..f099efc249 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -26,6 +26,8 @@ class TechnoTypeExt class ExtData final : public Extension { public: + AbstractType AbsType; + Valueable HealthBar_Hide; Valueable HealthBar_HidePips; Valueable HealthBar_Permanent; @@ -463,6 +465,8 @@ class TechnoTypeExt Valueable Deploy_NoTiberium; ExtData(TechnoTypeClass* OwnerObject) : Extension(OwnerObject) + , AbsType {} + , HealthBar_Hide { false } , HealthBar_HidePips { false } , HealthBar_Permanent { false } @@ -888,7 +892,7 @@ class TechnoTypeExt virtual void LoadFromStream(PhobosStreamReader& Stm) override; virtual void SaveToStream(PhobosStreamWriter& Stm) override; - void LoadFromINIByWhatAmI(INI_EX& exINI, const char* pSection, INI_EX& exArtINI, const char* pArtSection); + void LoadFromINIByWhatAmI(CCINIClass* const pINI, INI_EX& exINI, const char* pSection, INI_EX& exArtINI, const char* pArtSection, TechnoTypeClass* pThis); void ApplyTurretOffset(Matrix3D* mtx, double factor = 1.0); void CalculateSpawnerRange();