From 234466d46bb626e5a5c2fe9e2a4fcb923cbb9882 Mon Sep 17 00:00:00 2001 From: Sovietianqi <130513099+Sovietianqi@users.noreply.github.com> Date: Sat, 16 Aug 2025 15:30:52 +0800 Subject: [PATCH 1/4] Update Hooks.cpp --- src/Ext/TechnoType/Hooks.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Ext/TechnoType/Hooks.cpp b/src/Ext/TechnoType/Hooks.cpp index b20dbd625e..fb1ed48d1b 100644 --- a/src/Ext/TechnoType/Hooks.cpp +++ b/src/Ext/TechnoType/Hooks.cpp @@ -1,6 +1,7 @@ #include "Body.h" #include #include +#include DEFINE_HOOK(0x73D223, UnitClass_DrawIt_OreGath, 0x6) { @@ -127,3 +128,30 @@ DEFINE_HOOK(0x71464A, TechnoTypeClass_ReadINI_Speed, 0x7) return SkipGameCode; } + +DEFINE_HOOK(0x5F547E, ObjectClass_ReceiveDamage_FlashDuration, 0x6) +{ + GET(ObjectClass*, pThis, ESI); + GET(int, nNewHealth, EDX); + LEA_STACK(args_ReceiveDamage*, pArgs, STACK_OFFSET(0x24, 0x4)); + enum { SkipGameCode = 0x5F545C }; + + if (pThis->Health == nNewHealth) + return SkipGameCode; + + int nFlashDuration = 7; + if (auto pWH = pArgs->WH) + { + if (auto pWHEXT = WarheadTypeExt::ExtMap.Find(pWH)) + { + nFlashDuration = pWHEXT->Flash_Duration.Get(nFlashDuration); + } + } + + if (nFlashDuration > 0) + { + pThis->Flash(nFlashDuration); + } + + return SkipGameCode; +} From e3cc437da5d9eb87fe1c9800293711a2f6b2d89f Mon Sep 17 00:00:00 2001 From: Sovietianqi <130513099+Sovietianqi@users.noreply.github.com> Date: Sat, 16 Aug 2025 16:17:30 +0800 Subject: [PATCH 2/4] Update Body.h --- src/Ext/WarheadType/Body.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ext/WarheadType/Body.h b/src/Ext/WarheadType/Body.h index 9c37b3c875..4a222dfa96 100644 --- a/src/Ext/WarheadType/Body.h +++ b/src/Ext/WarheadType/Body.h @@ -21,6 +21,7 @@ class WarheadTypeExt { public: + Nullable Flash_Duration; Valueable Reveal; Valueable CreateGap; Valueable TransactMoney; @@ -214,6 +215,7 @@ class WarheadTypeExt public: ExtData(WarheadTypeClass* OwnerObject) : Extension(OwnerObject) + , Flash_Duration { 0 } , Reveal { 0 } , CreateGap { 0 } , TransactMoney { 0 } From ac50fb06c99e686ca3446162b3d63140f2451def Mon Sep 17 00:00:00 2001 From: Sovietianqi <130513099+Sovietianqi@users.noreply.github.com> Date: Sat, 16 Aug 2025 16:18:46 +0800 Subject: [PATCH 3/4] Update Body.cpp --- src/Ext/WarheadType/Body.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ext/WarheadType/Body.cpp b/src/Ext/WarheadType/Body.cpp index 5c0adbd0ef..506edfa867 100644 --- a/src/Ext/WarheadType/Body.cpp +++ b/src/Ext/WarheadType/Body.cpp @@ -134,6 +134,7 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) INI_EX exINI(pINI); // Miscs + this->Flash_Duration.Read(exINI, pSection, "Flash.Duration"); this->Reveal.Read(exINI, pSection, "Reveal"); this->CreateGap.Read(exINI, pSection, "CreateGap"); this->TransactMoney.Read(exINI, pSection, "TransactMoney"); @@ -401,6 +402,7 @@ template void WarheadTypeExt::ExtData::Serialize(T& Stm) { Stm + .Process(this->Flash_Duration) .Process(this->Reveal) .Process(this->CreateGap) .Process(this->TransactMoney) From 8bf682675102948b478be37151b726289f7b0c64 Mon Sep 17 00:00:00 2001 From: Sovietianqi <130513099+Sovietianqi@users.noreply.github.com> Date: Sat, 16 Aug 2025 16:20:19 +0800 Subject: [PATCH 4/4] Update Fixed-or-Improved-Logics.md --- 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 002d9eb617..f8cc22d03e 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -279,7 +279,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - 1000 save files are supported, from `SVGM_000.NET` to `SVGM_999.NET`. When the limit is reached, the game will overwrite the latest save file. - The previous `SVGM_XXX.NET` files are cleaned up before first copy if it's a new game, otherwise the highest numbered `SVGM_XXX.NET` file is found and the index is incremented, if possible. - The game also automatically copies `spawn.ini` to the save folder as `spawnSG.ini` when saving a game. - +- Fix the issue where Ares' `Flash.Duration` cannot override the weapon's repair flash effect. ```{note} The described behavior is a replica of and is compliant with XNA CnCNet Client's multiplayer save game support.