From be4b3d896e48087f3b3b24e3814fac0d18bea13f Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 13:20:55 +0800 Subject: [PATCH 1/7] Superweapon Change EVA --- docs/New-or-Enhanced-Logics.md | 14 ++++++++++++++ docs/Whats-New.md | 1 + src/Ext/SWType/Body.cpp | 3 +++ src/Ext/SWType/Body.h | 5 +++++ src/Ext/SWType/FireSuperWeapon.cpp | 16 ++++++++++++++++ 5 files changed, 39 insertions(+) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index d6d4f24f32..291f112514 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1268,6 +1268,20 @@ Detonate.Damage= ; integer Detonate.AtFirer=false ; boolean ``` +### Change EVA voice + +- Any superweapon can now change the player's EVA voice set after activation. + - `ChangeEVAIndex` specifies the EVA voice index to switch to, corresponding to entries under `[EVATypes]`. + - If set to `-1`, no change is applied. + - By default, `0` is Allied, `1` is Soviet, and `2` is Yuri. + - The change is applied to the player who activates the superweapon. + +In `rulesmd.ini`: +```ini +[SOMESW] ; SuperWeaponType +ChangeEVAIndex=-1 ; integer +``` + ## Technos ### Aggressive attack move mission diff --git a/docs/Whats-New.md b/docs/Whats-New.md index ae735b5c1a..d356dba740 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -573,6 +573,7 @@ New: - [Allow replacing vanilla repairing with togglable auto repairing](User-Interface.md#allow-replacing-vanilla-repairing-with-togglable-auto-repairing) (by TaranDahl) - Use `OpenTopped.AllowFiringIfAttackedByLocomotor` to control whether the passengers of a non-building transport unit can fire when the unit is being attacked by a weapon whose warhead has `IsLocomotor=true` (by Noble_Fish) - Framework for dynamic sight (by TaranDahl) +- [EVA voice switching on superweapon activation](New-or-Enhanced-Logics.md#change-eva-voice) (by Flactine) 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/SWType/Body.cpp b/src/Ext/SWType/Body.cpp index a8eeedbd50..73dfc7d5c2 100644 --- a/src/Ext/SWType/Body.cpp +++ b/src/Ext/SWType/Body.cpp @@ -95,6 +95,7 @@ void SWTypeExt::ExtData::Serialize(T& Stm) .Process(this->SW_Link_RollChances) .Process(this->Message_LinkedSWAcquired) .Process(this->EVA_LinkedSWAcquired) + .Process(this->ChangeEVAIndex) ; } @@ -226,6 +227,8 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->EVA_LinkedSWAcquired.Read(exINI, pSection, "EVA.LinkedSWAcquired"); this->SW_Link_RollChances.Read(exINI, pSection, "SW.Link.RollChances"); + this->ChangeEVAIndex.Read(exINI, pSection, "ChangeEVAIndex"); + // SW.Link.RandomWeights for (size_t i = 0; ; ++i) { diff --git a/src/Ext/SWType/Body.h b/src/Ext/SWType/Body.h index b36568dc4d..f37e120a88 100644 --- a/src/Ext/SWType/Body.h +++ b/src/Ext/SWType/Body.h @@ -108,6 +108,8 @@ class SWTypeExt Valueable Message_LinkedSWAcquired; NullableIdx EVA_LinkedSWAcquired; + Valueable ChangeEVAIndex; + ExtData(SuperWeaponTypeClass* OwnerObject) : Extension(OwnerObject) , TypeID { "" } , Money_Amount { 0 } @@ -185,6 +187,7 @@ class SWTypeExt , SW_Link_RandomWeightsData {} , Message_LinkedSWAcquired {} , EVA_LinkedSWAcquired {} + , ChangeEVAIndex { -1 } { } // Ares 0.A functions @@ -211,6 +214,8 @@ class SWTypeExt void ApplyLinkedSW(SuperClass* pSW); + void ApplyChangeEVAIndex(SuperClass* pSW); + virtual void LoadFromINIFile(CCINIClass* pINI) override; virtual void Initialize() override; diff --git a/src/Ext/SWType/FireSuperWeapon.cpp b/src/Ext/SWType/FireSuperWeapon.cpp index 442d0f6a9d..3edab845ff 100644 --- a/src/Ext/SWType/FireSuperWeapon.cpp +++ b/src/Ext/SWType/FireSuperWeapon.cpp @@ -37,6 +37,9 @@ void SWTypeExt::FireSuperWeaponExt(SuperClass* pSW, const CellStruct& cell) if (static_cast(pType->Type) == 28 && !pTypeExt->EMPulse_TargetSelf) // Ares' Type=EMPulse SW pTypeExt->HandleEMPulseLaunch(pSW, cell); + if (pTypeExt->ChangeEVAIndex != -1) + pTypeExt->ApplyChangeEVAIndex(pSW); + auto& sw_ext = HouseExt::ExtMap.Find(pHouse)->SuperExts[pType->ArrayIndex]; sw_ext.ShotCount++; @@ -483,3 +486,16 @@ void SWTypeExt::ExtData::ApplyLinkedSW(SuperClass* pSW) MessageListClass::Instance.PrintMessage(this->Message_LinkedSWAcquired.Get(), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true); } } + +void SWTypeExt::ExtData::ApplyChangeEVAIndex(SuperClass* pSW) +{ + const auto pHouse = pSW->Owner; + if (!pHouse->IsControlledByCurrentPlayer()) + return; + + int newEvaIndex = VoxClass::EVAIndex; + + newEvaIndex = this->ChangeEVAIndex; + + VoxClass::EVAIndex = newEvaIndex; +} From 8bac37209610e7425f04a91eb5ffd9d81143ea12 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 13:34:27 +0800 Subject: [PATCH 2/7] Update CREDITS.md --- CREDITS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.md b/CREDITS.md index 5b978b8f34..e5a0f05e89 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -758,6 +758,7 @@ This page lists all the individual contributions to the project by their author. - Add target filtering options to attacheffect system - Add veterancy-based target filtering for weapons and warheads - Fix BalloonHover incorrectly considering ground factors when pathfinding + - EVA voice switching on superweapon activation - **tyuah8**: - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix - Destroyed unit leaves sensors bugfix From d006ef653ddec7e7597fbbe0180248ce2c5f4664 Mon Sep 17 00:00:00 2001 From: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com> Date: Mon, 4 May 2026 13:57:02 +0800 Subject: [PATCH 3/7] Update New-or-Enhanced-Logics.md --- docs/New-or-Enhanced-Logics.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 291f112514..be5eca8569 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1086,6 +1086,20 @@ In `rulesmd.ini`: AISuperWeaponDelay= ; integer, game frames ``` +### Change EVA voice + +- Any superweapon can now change the player's EVA voice set after activation. + - `ChangeEVAIndex` specifies the EVA voice index to switch to, corresponding to entries under `[EVATypes]`. + - If set to `-1`, no change is applied. + - By default, `0` is Allied, `1` is Soviet, and `2` is Yuri. + - The change is applied to the player who activates the superweapon. + +In `rulesmd.ini`: +```ini +[SOMESW] ; SuperWeaponType +ChangeEVAIndex=-1 ; integer +``` + ### Convert TechnoType - Warheads can now change TechnoTypes of affected units to other Types in the same category (infantry to infantry, vehicles to vehicles, aircraft to aircraft). @@ -1268,20 +1282,6 @@ Detonate.Damage= ; integer Detonate.AtFirer=false ; boolean ``` -### Change EVA voice - -- Any superweapon can now change the player's EVA voice set after activation. - - `ChangeEVAIndex` specifies the EVA voice index to switch to, corresponding to entries under `[EVATypes]`. - - If set to `-1`, no change is applied. - - By default, `0` is Allied, `1` is Soviet, and `2` is Yuri. - - The change is applied to the player who activates the superweapon. - -In `rulesmd.ini`: -```ini -[SOMESW] ; SuperWeaponType -ChangeEVAIndex=-1 ; integer -``` - ## Technos ### Aggressive attack move mission From 2ad54b375487f2f9a879ec3416bbc6ac80818cf4 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 16:28:55 +0800 Subject: [PATCH 4/7] Try to fix load/save --- src/Ext/House/Body.cpp | 14 ++++++++++++++ src/Ext/House/Body.h | 3 +++ src/Ext/SWType/FireSuperWeapon.cpp | 8 ++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Ext/House/Body.cpp b/src/Ext/House/Body.cpp index 4f638fd1b5..110573bc01 100644 --- a/src/Ext/House/Body.cpp +++ b/src/Ext/House/Body.cpp @@ -719,10 +719,24 @@ void HouseExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) { Extension::LoadFromStream(Stm); this->Serialize(Stm); + + Debug::Log("Loading - ForceEvaIndex is: [%d]\n", ForceEvaIndex); + + if (ForceEvaIndex != -1) + { + VoxClass::EVAIndex = ForceEvaIndex; + } } void HouseExt::ExtData::SaveToStream(PhobosStreamWriter& Stm) { + Debug::Log("Saving - ForceEvaIndex is: [%d]\n", ForceEvaIndex); + + if (VoxClass::EVAIndex != -1) + { + ForceEvaIndex = VoxClass::EVAIndex; + } + Extension::SaveToStream(Stm); this->Serialize(Stm); } diff --git a/src/Ext/House/Body.h b/src/Ext/House/Body.h index 11585ed5a2..664f15cd0b 100644 --- a/src/Ext/House/Body.h +++ b/src/Ext/House/Body.h @@ -69,6 +69,8 @@ class HouseExt bool PlayerAutoRepair; + int ForceEvaIndex; + ExtData(HouseClass* OwnerObject) : Extension(OwnerObject) , PowerPlantEnhancers {} , OwnedLimboDeliveredBuildings {} @@ -103,6 +105,7 @@ class HouseExt , FreeRadar(false) , ForceRadar(false) , PlayerAutoRepair(true) + , ForceEvaIndex(-1) { } bool OwnsLimboDeliveredBuilding(BuildingClass* pBuilding) const; diff --git a/src/Ext/SWType/FireSuperWeapon.cpp b/src/Ext/SWType/FireSuperWeapon.cpp index 3edab845ff..501dfcb58b 100644 --- a/src/Ext/SWType/FireSuperWeapon.cpp +++ b/src/Ext/SWType/FireSuperWeapon.cpp @@ -493,9 +493,9 @@ void SWTypeExt::ExtData::ApplyChangeEVAIndex(SuperClass* pSW) if (!pHouse->IsControlledByCurrentPlayer()) return; - int newEvaIndex = VoxClass::EVAIndex; + VoxClass::EVAIndex = this->ChangeEVAIndex; - newEvaIndex = this->ChangeEVAIndex; - - VoxClass::EVAIndex = newEvaIndex; + Debug::Log("Before - ForceEvaIndex is: [%d]\n", HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex); + HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex = this->ChangeEVAIndex; + Debug::Log("After - ForceEvaIndex is: [%d]\n", HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex); } From 1d0de4f4999e6a13565d40d5aa819baffb47e503 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 16:49:36 +0800 Subject: [PATCH 5/7] Fixed save / load --- src/Ext/House/Body.cpp | 10 +--------- src/Ext/SWType/FireSuperWeapon.cpp | 3 --- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Ext/House/Body.cpp b/src/Ext/House/Body.cpp index 110573bc01..6b14f2f53b 100644 --- a/src/Ext/House/Body.cpp +++ b/src/Ext/House/Body.cpp @@ -712,6 +712,7 @@ void HouseExt::ExtData::Serialize(T& Stm) .Process(this->FreeRadar) .Process(this->ForceRadar) .Process(this->PlayerAutoRepair) + .Process(this->ForceEvaIndex) ; } @@ -720,8 +721,6 @@ void HouseExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) Extension::LoadFromStream(Stm); this->Serialize(Stm); - Debug::Log("Loading - ForceEvaIndex is: [%d]\n", ForceEvaIndex); - if (ForceEvaIndex != -1) { VoxClass::EVAIndex = ForceEvaIndex; @@ -730,13 +729,6 @@ void HouseExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) void HouseExt::ExtData::SaveToStream(PhobosStreamWriter& Stm) { - Debug::Log("Saving - ForceEvaIndex is: [%d]\n", ForceEvaIndex); - - if (VoxClass::EVAIndex != -1) - { - ForceEvaIndex = VoxClass::EVAIndex; - } - Extension::SaveToStream(Stm); this->Serialize(Stm); } diff --git a/src/Ext/SWType/FireSuperWeapon.cpp b/src/Ext/SWType/FireSuperWeapon.cpp index 501dfcb58b..e0162f9677 100644 --- a/src/Ext/SWType/FireSuperWeapon.cpp +++ b/src/Ext/SWType/FireSuperWeapon.cpp @@ -494,8 +494,5 @@ void SWTypeExt::ExtData::ApplyChangeEVAIndex(SuperClass* pSW) return; VoxClass::EVAIndex = this->ChangeEVAIndex; - - Debug::Log("Before - ForceEvaIndex is: [%d]\n", HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex); HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex = this->ChangeEVAIndex; - Debug::Log("After - ForceEvaIndex is: [%d]\n", HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex); } From 2b93755f556122c2e03b8abcc4bb66d9befe9c29 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 16:53:28 +0800 Subject: [PATCH 6/7] Update Body.cpp --- src/Ext/House/Body.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ext/House/Body.cpp b/src/Ext/House/Body.cpp index 6b14f2f53b..54f4e02e1e 100644 --- a/src/Ext/House/Body.cpp +++ b/src/Ext/House/Body.cpp @@ -721,9 +721,9 @@ void HouseExt::ExtData::LoadFromStream(PhobosStreamReader& Stm) Extension::LoadFromStream(Stm); this->Serialize(Stm); - if (ForceEvaIndex != -1) + if (this->ForceEvaIndex != -1) { - VoxClass::EVAIndex = ForceEvaIndex; + VoxClass::EVAIndex = this->ForceEvaIndex; } } From 97d5cd279353908aa47764d52e38a749419de5a8 Mon Sep 17 00:00:00 2001 From: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com> Date: Mon, 4 May 2026 20:00:17 +0800 Subject: [PATCH 7/7] Update CREDITS.md --- CREDITS.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index cbb73c10d4..cd50783248 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -758,11 +758,7 @@ This page lists all the individual contributions to the project by their author. - **Flactine** - Add target filtering options to attacheffect system - Add veterancy-based target filtering for weapons and warheads -<<<<<<< SWChangeEVA - - Fix BalloonHover incorrectly considering ground factors when pathfinding - EVA voice switching on superweapon activation -======= ->>>>>>> develop - **tyuah8**: - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix - Destroyed unit leaves sensors bugfix