From 5d2bba03f7d18f8602eba0eb10856e45c47d38f6 Mon Sep 17 00:00:00 2001 From: NetsuNegi39 Date: Thu, 19 Mar 2026 16:33:23 +0800 Subject: [PATCH 1/3] init --- CREDITS.md | 1 + docs/New-or-Enhanced-Logics.md | 10 ++++++++++ docs/Whats-New.md | 1 + src/Ext/Techno/Hooks.Misc.cpp | 15 +++++++++++++++ src/Ext/TechnoType/Body.cpp | 2 ++ src/Ext/TechnoType/Body.h | 1 + 6 files changed, 30 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index a9620465ef..ec2769d055 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -513,6 +513,7 @@ This page lists all the individual contributions to the project by their author. - Customize which parasite can remove by warhead - Fix the bug that unit will play crashing voice & sound when dropped by warhead with `IsLocomotor=yes` - Add toggle of whether shield use ArmorMultiplier or not + - Customize default mirage disguises per technotypes - **Apollo** - Translucent SHP drawing patches - **ststl**: - Customizable `ShowTimer` priority of superweapons diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index cd0b6e4ac1..60490ce423 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -2320,6 +2320,16 @@ FireUp= ; integer FireUp.ResetInRetarget=true ; boolean ``` +### Default mirage disguise for individual VehicleTypes + +- Vehicle can now have its `DefaultMirageDisguises` overridden per-type. + +In `rulesmd.ini`: +```ini +[SOMEVEHICLE] ; VehicleType +DefaultMirageDisguises= ; List of TerrainTypes +``` + ## Warheads ```{hint} diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 9d0ded6b6f..ed5040abc5 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -553,6 +553,7 @@ New: - [Implement `CurleyShuffle` for AircraftTypes](Fixed-or-Improved-Logics.md#implement-curleyshuffle-for-aircrafttypes) (ported from Vinifera by Noble_Fish) - Customize which parasite can remove by warhead (by NetsuNegi) - Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi) +- Customize default mirage disguises per technotypes (by NetsuNegi) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index c924f694ff..6e40ab44db 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -507,6 +507,21 @@ DEFINE_HOOK(0x522790, InfantryClass_ClearDisguise_DefaultDisguise, 0x6) return 0; } +DEFINE_HOOK(0x746A30, UnitClass_UpdateDisguise_DefaultMirageDisguises, 0x5) +{ + enum { Apply = 0x746A6C }; + + GET(UnitClass*, pThis, ESI); + const auto& disguises = TechnoTypeExt::ExtMap.Find(pThis->Type)->DefaultMirageDisguises.GetElements(RulesClass::Instance->DefaultMirageDisguises); + TerrainTypeClass* pDisguiseAs = nullptr; + + if (const int size = static_cast(disguises.size())) + pDisguiseAs = disguises[ScenarioClass::Instance->Random.RandomRanged(0, size - 1)]; + + R->EAX(pDisguiseAs); + return Apply; +} + DEFINE_HOOK(0x74691D, UnitClass_UpdateDisguise_EMP, 0x6) { GET(UnitClass*, pThis, ESI); diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 5081f73487..a239526268 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -845,6 +845,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->NotHuman_RandomDeathSequence.Read(exINI, pSection, "NotHuman.RandomDeathSequence"); this->DefaultDisguise.Read(exINI, pSection, "DefaultDisguise"); + this->DefaultMirageDisguises.Read(exINI, pSection, "DefaultMirageDisguises"); this->UseDisguiseMovementSpeed.Read(exINI, pSection, "UseDisguiseMovementSpeed"); this->OpenTopped_RangeBonus.Read(exINI, pSection, "OpenTopped.RangeBonus"); @@ -1566,6 +1567,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm) .Process(this->DestroyAnim_Random) .Process(this->NotHuman_RandomDeathSequence) .Process(this->DefaultDisguise) + .Process(this->DefaultMirageDisguises) .Process(this->UseDisguiseMovementSpeed) .Process(this->WeaponBurstFLHs) .Process(this->EliteWeaponBurstFLHs) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index f5b512f4a3..e0cb824ef8 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -156,6 +156,7 @@ class TechnoTypeExt Valueable NotHuman_RandomDeathSequence; Valueable DefaultDisguise; + NullableVector DefaultMirageDisguises; Valueable UseDisguiseMovementSpeed; Nullable OpenTopped_RangeBonus; From 2d03fe0958ad5c0b69743ee608a5118e0b83952a Mon Sep 17 00:00:00 2001 From: NetsuNegi39 Date: Thu, 19 Mar 2026 16:48:20 +0800 Subject: [PATCH 2/3] docs --- CREDITS.md | 2 +- docs/Whats-New.md | 2 +- docs/locale/zh_CN/LC_MESSAGES/CREDITS.po | 5 +++++ docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po | 6 ++++++ docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 8 ++++++-- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index ec2769d055..2fe7c2091e 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -513,7 +513,7 @@ This page lists all the individual contributions to the project by their author. - Customize which parasite can remove by warhead - Fix the bug that unit will play crashing voice & sound when dropped by warhead with `IsLocomotor=yes` - Add toggle of whether shield use ArmorMultiplier or not - - Customize default mirage disguises per technotypes + - Customize default mirage disguises per vehicletypes - **Apollo** - Translucent SHP drawing patches - **ststl**: - Customizable `ShowTimer` priority of superweapons diff --git a/docs/Whats-New.md b/docs/Whats-New.md index ed5040abc5..25f90d4695 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -553,7 +553,7 @@ New: - [Implement `CurleyShuffle` for AircraftTypes](Fixed-or-Improved-Logics.md#implement-curleyshuffle-for-aircrafttypes) (ported from Vinifera by Noble_Fish) - Customize which parasite can remove by warhead (by NetsuNegi) - Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi) -- Customize default mirage disguises per technotypes (by NetsuNegi) +- Customize default mirage disguises per vehicletypes (by NetsuNegi) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po index 3993d8c689..36902dfb38 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po +++ b/docs/locale/zh_CN/LC_MESSAGES/CREDITS.po @@ -1671,6 +1671,11 @@ msgid "" msgstr "" "添加了护盾是否使用护甲倍率的开关" +msgid "" +"Customize default mirage disguises per vehicletypes" +msgstr "" +"为每个载具类型单独定义默认的幻影伪装类型" + msgid "**Apollo** - Translucent SHP drawing patches" msgstr "**Apollo** - 半透明 SHP 绘制补丁" diff --git a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po index 145a9421f6..30c173cfed 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po @@ -5013,6 +5013,12 @@ msgid "" "target." msgstr "`FireUp.ResetInRetarget` 决定当前载具目标改变时其前摇是否重置。失去目标强制重置。" +msgid "Default mirage disguise for individual VehicleTypes" +msgstr "载具类型默认幻影伪装" + +msgid "Vehicle can now have its `DefaultMirageDisguises` overridden per-type." +msgstr "现在可以单独为每个载具类型设置其 `DefaultMirageDisguises`。" + msgid "Warheads" msgstr "弹头" diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index 9e93d848ef..c5da92fc6f 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -1749,12 +1749,16 @@ msgid "" msgstr "" "[实现战机微观 `CurleyShuffle` 设置](Fixed-or-Improved-Logics.md#implement-" "curleyshuffle-for-aircrafttypes)(由 Noble_Fish 移植自 Vinifera)" -msgid "Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)" -msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)" msgid "Customize which parasite can remove by warhead (by NetsuNegi)" msgstr "自定义哪些寄生者可被弹头移除(by NetsuNegi)" +msgid "Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)" +msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)" + +msgid "Customize default mirage disguises per vehicletypes (by NetsuNegi)" +msgstr "为每个载具类型单独定义默认的幻影伪装类型(by NetsuNegi)" + msgid "Vanilla fixes:" msgstr "原版问题修复:" From 0b04eb824783ff988f437e8f99d6cdf38a6dae76 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Thu, 19 Mar 2026 19:35:29 +0800 Subject: [PATCH 3/3] Update docs Add links, correct locations, and roll back unrelated changes to avoid future merge conflicts --- docs/New-or-Enhanced-Logics.md | 20 +++++++++---------- docs/Whats-New.md | 2 +- .../LC_MESSAGES/New-or-Enhanced-Logics.po | 12 +++++------ docs/locale/zh_CN/LC_MESSAGES/Whats-New.po | 14 ++++++++----- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 60490ce423..5a360e70d7 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -2267,6 +2267,16 @@ WaterImage.ConditionRed= ; VehicleType entry Note that the VehicleTypes had to be defined under [VehicleTypes] and use same image type (SHP/VXL) for vanilla/damaged states. ``` +### Default mirage disguise for individual VehicleTypes + +- Vehicle can now have its `DefaultMirageDisguises` overridden per-type. + +In `rulesmd.ini`: +```ini +[SOMEVEHICLE] ; VehicleType +DefaultMirageDisguises= ; List of TerrainTypes +``` + ### Independent SHP Vehicle Turret Files - SHP turret vehicles support the use of `*tur.shp` files. @@ -2320,16 +2330,6 @@ FireUp= ; integer FireUp.ResetInRetarget=true ; boolean ``` -### Default mirage disguise for individual VehicleTypes - -- Vehicle can now have its `DefaultMirageDisguises` overridden per-type. - -In `rulesmd.ini`: -```ini -[SOMEVEHICLE] ; VehicleType -DefaultMirageDisguises= ; List of TerrainTypes -``` - ## Warheads ```{hint} diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 25f90d4695..7451c5c8ec 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -553,7 +553,7 @@ New: - [Implement `CurleyShuffle` for AircraftTypes](Fixed-or-Improved-Logics.md#implement-curleyshuffle-for-aircrafttypes) (ported from Vinifera by Noble_Fish) - Customize which parasite can remove by warhead (by NetsuNegi) - Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi) -- Customize default mirage disguises per vehicletypes (by NetsuNegi) +- [Customize default mirage disguises per vehicletypes](New-or-Enhanced-Logics.md#default-mirage-disguise-for-individual-vehicletypes) (by NetsuNegi) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po index 30c173cfed..0b7f7630a0 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po @@ -4918,6 +4918,12 @@ msgid "" " same image type (SHP/VXL) for vanilla/damaged states." msgstr "注意这些被使用的载具必须在 `[VehicleTypes]` 下注册并且在常规/伤残状态下使用相同的图像类型(Shape/Voxel)。" +msgid "Default mirage disguise for individual VehicleTypes" +msgstr "载具类型默认幻影伪装" + +msgid "Vehicle can now have its `DefaultMirageDisguises` overridden per-type." +msgstr "现在可以单独为每个载具类型设置其 `DefaultMirageDisguises`。" + msgid "Independent SHP Vehicle Turret Files" msgstr "独立的 Shape 载具炮塔文件" @@ -5013,12 +5019,6 @@ msgid "" "target." msgstr "`FireUp.ResetInRetarget` 决定当前载具目标改变时其前摇是否重置。失去目标强制重置。" -msgid "Default mirage disguise for individual VehicleTypes" -msgstr "载具类型默认幻影伪装" - -msgid "Vehicle can now have its `DefaultMirageDisguises` overridden per-type." -msgstr "现在可以单独为每个载具类型设置其 `DefaultMirageDisguises`。" - msgid "Warheads" msgstr "弹头" diff --git a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po index c5da92fc6f..9dc0f606c8 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po +++ b/docs/locale/zh_CN/LC_MESSAGES/Whats-New.po @@ -1749,15 +1749,19 @@ msgid "" msgstr "" "[实现战机微观 `CurleyShuffle` 设置](Fixed-or-Improved-Logics.md#implement-" "curleyshuffle-for-aircrafttypes)(由 Noble_Fish 移植自 Vinifera)" +msgid "Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)" +msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)" msgid "Customize which parasite can remove by warhead (by NetsuNegi)" msgstr "自定义哪些寄生者可被弹头移除(by NetsuNegi)" -msgid "Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)" -msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)" - -msgid "Customize default mirage disguises per vehicletypes (by NetsuNegi)" -msgstr "为每个载具类型单独定义默认的幻影伪装类型(by NetsuNegi)" +msgid "" +"[Customize default mirage disguises per vehicletypes](New-or-Enhanced-" +"Logics.md#default-mirage-disguise-for-individual-vehicletypes) (by " +"NetsuNegi)" +msgstr "" +"[为每个载具类型单独定义默认的幻影伪装类型](New-or-Enhanced-Logics.md#" +"default-mirage-disguise-for-individual-vehicletypes)(by NetsuNegi)" msgid "Vanilla fixes:" msgstr "原版问题修复:"