From be9fa8b7d070137cb8680e6a2d51995dc63d6027 Mon Sep 17 00:00:00 2001 From: NetsuNegi39 Date: Fri, 27 Mar 2026 11:53:48 +0800 Subject: [PATCH 1/4] init --- docs/Whats-New.md | 1 + docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 5 +++++ src/Ext/Bullet/Hooks.DetonateLogics.cpp | 10 ++++++++-- src/Ext/WarheadType/Body.h | 8 ++++---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 2c722f95b8..88b5518848 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -662,6 +662,7 @@ Phobos fixes: - Fixed the bug that the upgrade building's power-enhancing effect depends only on its parent building and is not related to the upgrade building itself (by NetsuNegi) - Fixed an issue where hover vehicles could not be destroyed after malfunctioning on water surfaces (by FlyStar) - Fixed an issue where shadow matrix scaling was incorrectly applied to `TurretOffset` causing turret shadow misplacement (by Noble_Fish) +- Fixed an issue that customizable warhead animation scatter cannot override 32 leptons scatter of `Inviso=yes` projectile (by NetsuNegi) Fixes / interactions with other extensions: diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index 53f5e0f7cb..d2e9dac9c8 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -2301,6 +2301,11 @@ msgid "" "`TurretOffset` causing turret shadow misplacement (by Noble_Fish)" msgstr "修复了一个影子矩阵缩放错误地应用于 `TurretOffset` 而导致炮塔影子错位的问题(by Noble_Fish)" +msgid "" +"Fixed an issue that customizable warhead animation scatter cannot " +"override 32 leptons scatter of `Inviso=yes` projectile (by NetsuNegi)" +msgstr "修复了自定义弹头动画散布范围不能覆盖 `Inviso=yes` 抛射体的32Leptons散布的问题(by NetsuNegi)" + msgid "Fixes / interactions with other extensions:" msgstr "其他扩展引擎相关的修复/交互:" diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index 56ecc8d8fc..4cbfaf75e3 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -252,6 +252,8 @@ DEFINE_HOOK(0x469B44, BulletClass_Logics_LandTypeCheck, 0x6) return 0; } +DEFINE_JUMP(LJMP, 0x469AC1, 0x469AF0) // Skip random scatter in vanilla code + DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) { enum { SkipGameCode = 0x469C98 }; @@ -280,7 +282,7 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) int* remainingInterval = &pWHExt->RemainingAnimCreationInterval; const int scatterMin = splashed ? pWHExt->SplashList_ScatterMin.Get() : pWHExt->AnimList_ScatterMin.Get(); const int scatterMax = splashed ? pWHExt->SplashList_ScatterMax.Get() : pWHExt->AnimList_ScatterMax.Get(); - const bool allowScatter = scatterMax != 0 || scatterMin != 0; + const bool allowScatter = scatterMax >= 0 || pThis->Type->Inviso; if (creationInterval > 0 && pOwner) remainingInterval = &TechnoExt::ExtMap.Find(pOwner)->WHAnimRemainingCreationInterval; @@ -329,7 +331,11 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) if (allowScatter) { - const int distance = random.RandomRanged(scatterMin, scatterMax); + int distance = 32; + + if (scatterMax >= 0) + distance = random(std::max(scatterMin, 0), scatterMax); + animCoords = MapClass::GetRandomCoordsNear(animCoords, distance, false); } diff --git a/src/Ext/WarheadType/Body.h b/src/Ext/WarheadType/Body.h index 1a08e540fc..22715ea821 100644 --- a/src/Ext/WarheadType/Body.h +++ b/src/Ext/WarheadType/Body.h @@ -275,13 +275,13 @@ class WarheadTypeExt , SplashList_PickRandom { false } , SplashList_CreateAll { false } , SplashList_CreationInterval { 0 } - , SplashList_ScatterMin { Leptons(0) } - , SplashList_ScatterMax { Leptons(0) } + , SplashList_ScatterMin { Leptons(-1) } + , SplashList_ScatterMax { Leptons(-1) } , AnimList_PickRandom { false } , AnimList_CreateAll { false } , AnimList_CreationInterval { 0 } - , AnimList_ScatterMin { Leptons(0) } - , AnimList_ScatterMax { Leptons(0) } + , AnimList_ScatterMin { Leptons(-1) } + , AnimList_ScatterMax { Leptons(-1) } , CreateAnimsOnZeroDamage { false } , Conventional_IgnoreUnits { false } , RemoveDisguise { false } From e0a618f2d7a60ffc3b814f8f1dcb95d398b9959d Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 27 Mar 2026 13:19:58 +0800 Subject: [PATCH 2/4] update --- docs/Fixed-or-Improved-Logics.md | 2 +- docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 2ee15a0dd5..7b92558583 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -2447,7 +2447,7 @@ AnimList.PickRandom=false ; boolean AnimList.CreateAll=false ; boolean AnimList.CreationInterval=0 ; integer AnimList.ScatterMin=0.0 ; floating point value, distance in cells -AnimList.ScatterMax=0.0 ; floating point value, distance in cells +AnimList.ScatterMax= ; floating point value, distance in cells, default to 0.125 if [Projectile] -> Inviso=true, and 0 if false SplashList= ; List of AnimationTypes, default to [CombatDamage] -> SplashList SplashList.PickRandom=false ; boolean SplashList.CreateAll=false ; boolean diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index d2e9dac9c8..f512ff8b87 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -2304,7 +2304,7 @@ msgstr "修复了一个影子矩阵缩放错误地应用于 `TurretOffset` 而 msgid "" "Fixed an issue that customizable warhead animation scatter cannot " "override 32 leptons scatter of `Inviso=yes` projectile (by NetsuNegi)" -msgstr "修复了自定义弹头动画散布范围不能覆盖 `Inviso=yes` 抛射体的32Leptons散布的问题(by NetsuNegi)" +msgstr "修复了自定义弹头动画散布范围不能覆盖 `Inviso=yes` 抛射体自带 32 leptons 散布的问题(by NetsuNegi)" msgid "Fixes / interactions with other extensions:" msgstr "其他扩展引擎相关的修复/交互:" From 5762bdd25e7ff1bcdebbc3f59da7b043fc21435b Mon Sep 17 00:00:00 2001 From: NetsuNegi39 Date: Fri, 27 Mar 2026 16:42:10 +0800 Subject: [PATCH 3/4] update --- src/Ext/Bullet/Hooks.DetonateLogics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index 4cbfaf75e3..7d44a9459d 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -282,7 +282,7 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) int* remainingInterval = &pWHExt->RemainingAnimCreationInterval; const int scatterMin = splashed ? pWHExt->SplashList_ScatterMin.Get() : pWHExt->AnimList_ScatterMin.Get(); const int scatterMax = splashed ? pWHExt->SplashList_ScatterMax.Get() : pWHExt->AnimList_ScatterMax.Get(); - const bool allowScatter = scatterMax >= 0 || pThis->Type->Inviso; + const bool allowScatter = scatterMax >= 0 || scatterMin >= 0 || pThis->Type->Inviso; if (creationInterval > 0 && pOwner) remainingInterval = &TechnoExt::ExtMap.Find(pOwner)->WHAnimRemainingCreationInterval; @@ -333,8 +333,8 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) { int distance = 32; - if (scatterMax >= 0) - distance = random(std::max(scatterMin, 0), scatterMax); + if (scatterMax >= 0 || scatterMin >= 0) + distance = random(scatterMin, scatterMax); animCoords = MapClass::GetRandomCoordsNear(animCoords, distance, false); } From 75e21f0e35f6356aa698b585d250cc22cbdf17ef Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 27 Mar 2026 17:24:47 +0800 Subject: [PATCH 4/4] update --- docs/Fixed-or-Improved-Logics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 7b92558583..61379b9738 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -2446,7 +2446,7 @@ In `rulesmd.ini`: AnimList.PickRandom=false ; boolean AnimList.CreateAll=false ; boolean AnimList.CreationInterval=0 ; integer -AnimList.ScatterMin=0.0 ; floating point value, distance in cells +AnimList.ScatterMin=0.0 ; floating point value, distance in cells, default to 0.125 if [Projectile] -> Inviso=true, and 0 if false AnimList.ScatterMax= ; floating point value, distance in cells, default to 0.125 if [Projectile] -> Inviso=true, and 0 if false SplashList= ; List of AnimationTypes, default to [CombatDamage] -> SplashList SplashList.PickRandom=false ; boolean