From dec1fd0e2ecda66df21bf4ceffe089b506667d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=AA=E5=91=B3=E9=BA=BB=E9=85=B1?= <93972760+TaranDahl@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:42:19 +0800 Subject: [PATCH 1/2] code --- src/Ext/TechnoType/Body.cpp | 4 ++++ src/Ext/TechnoType/Body.h | 4 ++++ src/Ext/Unit/Hooks.Firing.cpp | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 99426a6d4f..43487c0757 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -1035,6 +1035,8 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) 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->CanGoAboveTarget.Read(exINI, pSection, "CanGoAboveTarget"); // Ares 0.2 this->RadarJamRadius.Read(exINI, pSection, "RadarJamRadius"); @@ -1698,6 +1700,8 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm) .Process(this->InfantryAutoDeploy) .Process(this->TurretResponse) + + .Process(this->CanGoAboveTarget) ; } void TechnoTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index be8a176b49..d2e4014d9e 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -445,6 +445,8 @@ class TechnoTypeExt Nullable TurretResponse; + Valueable CanGoAboveTarget; + ExtData(TechnoTypeClass* OwnerObject) : Extension(OwnerObject) , HealthBar_Hide { false } , HealthBar_HidePips { false } @@ -840,6 +842,8 @@ class TechnoTypeExt , InfantryAutoDeploy {} , TurretResponse {} + + , CanGoAboveTarget { false } { } virtual ~ExtData() = default; diff --git a/src/Ext/Unit/Hooks.Firing.cpp b/src/Ext/Unit/Hooks.Firing.cpp index 853ec461f1..3cfce40c1c 100644 --- a/src/Ext/Unit/Hooks.Firing.cpp +++ b/src/Ext/Unit/Hooks.Firing.cpp @@ -160,3 +160,12 @@ DEFINE_HOOK(0x741A96, UnitClass_SetDestination_ResetFiringFrame, 0x6) return 0; } + +DEFINE_HOOK(0x74159F, UnitClass_ApproachTarget_GoAboveTarget, 0x6) +{ + GET(UnitClass* const, pThis, ESI); + auto pType = pThis->Type; + auto pTypeExt = TechnoTypeExt::ExtMap.Find(pType); + R->AL(pType->BalloonHover || pTypeExt->CanGoAboveTarget); + return R->Origin() + 0x6; +} From 204eb76236f1ffedcd067978d065d1bb53f21f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=88=AA=E5=91=B3=E9=BA=BB=E9=85=B1?= <93972760+TaranDahl@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:48:58 +0800 Subject: [PATCH 2/2] docs --- CREDITS.md | 1 + docs/Fixed-or-Improved-Logics.md | 12 ++++++++++++ docs/Whats-New.md | 1 + 3 files changed, 14 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index 6a2035cd83..563558142b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -648,6 +648,7 @@ This page lists all the individual contributions to the project by their author. - Fix an issue where the vanilla script ignores jumpjets - CellSpread in cylinder shape - CellSpread damage check if victim is in air or on floor + - Allow other vehicles to attempt to move above the target like `BalloonHover=yes` - **solar-III (凤九歌)** - Target scanning delay customization (documentation) - Skip target scanning function calling for unarmed technos (documentation) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index d0494c7685..3f529cc397 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -1941,6 +1941,18 @@ In `rulesmd.ini`: Harvester.CanGuardArea=no ; boolean ``` +### Allow other vehicles to attempt to move above the target like `BalloonHover=yes` + +- In vanilla, vehicles with `BalloonHover=yes` and a weapon with projectile with `Vertical=yes` will attempt to move above the target. +- Now you can make other vehicles do the same without `BalloonHover=yes`. + - A weapon with projectile with `Vertical=yes` is still needed. + +In `rulesmd.ini`: +```ini +[SOMEVEHICLE] ; VehicleType +CanGoAboveTarget=false ; boolean +``` + ### Bunker entering check dehardcode - In vanilla, vehicles entering tank bunkers are subject to a series of hardcoding restrictions, including having to have turrets, having to have weapons, and not having Hover speed types. Now you can skip these restrictions. diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 6ad7bee8f6..667b42c79a 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -466,6 +466,7 @@ New: - [Customize type selection for IFV](Fixed-or-Improved-Logics.md#customize-type-selection-for-ifv) (by NetsuNegi) - CellSpread in cylinder shape (by TaranDahl) - CellSpread damage check if victim is in air or on floor (by TaranDahl) +- Allow other vehicles to attempt to move above the target like `BalloonHover=yes` (by TaranDahl) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)