From aeefabf8a52d13a593f4d34eb1c9064582aedbb9 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Mon, 4 May 2026 19:54:28 +0800 Subject: [PATCH 1/3] Firer-only EVA on superweapon activated --- CREDITS.md | 3 ++- docs/New-or-Enhanced-Logics.md | 11 +++++++++++ src/Ext/SWType/Body.cpp | 2 ++ src/Ext/SWType/Body.h | 4 ++++ src/Ext/SWType/FireSuperWeapon.cpp | 12 ++++++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index 5b978b8f34..68f3f2f308 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -751,13 +751,14 @@ This page lists all the individual contributions to the project by their author. - Allow replacing vanilla repairing with togglable auto repairing - Fix an issue that the time for units in the area guard mission to reacquire targets after eliminating the target is significantly longer than that in other missions - Framework for dynamic sight + - Fix BalloonHover incorrectly considering ground factors when pathfinding - **solar-III (凤九歌)** - Target scanning delay customization (documentation) - Skip target scanning function calling for unarmed technos (documentation) - **Flactine** - Add target filtering options to attacheffect system - Add veterancy-based target filtering for weapons and warheads - - Fix BalloonHover incorrectly considering ground factors when pathfinding + - Firer-only EVA on superweapon activation - **tyuah8**: - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix - Destroyed unit leaves sensors bugfix diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index d6d4f24f32..d21583c1ca 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1268,6 +1268,17 @@ Detonate.Damage= ; integer Detonate.AtFirer=false ; boolean ``` +### Firer-only EVA on superweapon activated + +Adds `EVA.Activated.Firer` for superweapons. +Unlike `EVA.Activated`, this EVA message is played only for the player who fires the superweapon, instead of being broadcast to all players. +In `rulesmd.ini`: + +```ini +[SOMESW] +EVA.Activated.Firer= ; EVA entry +``` + ## Technos ### Aggressive attack move mission diff --git a/src/Ext/SWType/Body.cpp b/src/Ext/SWType/Body.cpp index a8eeedbd50..2bcbbb92fa 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->EVA_Activated_Firer) ; } @@ -224,6 +225,7 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->SW_Link_Reset.Read(exINI, pSection, "SW.Link.Reset"); this->Message_LinkedSWAcquired.Read(exINI, pSection, "Message.LinkedSWAcquired"); this->EVA_LinkedSWAcquired.Read(exINI, pSection, "EVA.LinkedSWAcquired"); + this->EVA_Activated_Firer.Read(exINI, pSection, "EVA.Activated.Firer"); this->SW_Link_RollChances.Read(exINI, pSection, "SW.Link.RollChances"); // SW.Link.RandomWeights diff --git a/src/Ext/SWType/Body.h b/src/Ext/SWType/Body.h index b36568dc4d..95a6b92378 100644 --- a/src/Ext/SWType/Body.h +++ b/src/Ext/SWType/Body.h @@ -107,6 +107,7 @@ class SWTypeExt ValueableVector SW_Link_RollChances; Valueable Message_LinkedSWAcquired; NullableIdx EVA_LinkedSWAcquired; + NullableIdx EVA_Activated_Firer; ExtData(SuperWeaponTypeClass* OwnerObject) : Extension(OwnerObject) , TypeID { "" } @@ -185,6 +186,7 @@ class SWTypeExt , SW_Link_RandomWeightsData {} , Message_LinkedSWAcquired {} , EVA_LinkedSWAcquired {} + , EVA_Activated_Firer {} { } // Ares 0.A functions @@ -211,6 +213,8 @@ class SWTypeExt void ApplyLinkedSW(SuperClass* pSW); + void ApplyActivatedFirerEva(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..c585df93fc 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->EVA_Activated_Firer.isset()) + pTypeExt->ApplyActivatedFirerEva(pSW); + auto& sw_ext = HouseExt::ExtMap.Find(pHouse)->SuperExts[pType->ArrayIndex]; sw_ext.ShotCount++; @@ -483,3 +486,12 @@ void SWTypeExt::ExtData::ApplyLinkedSW(SuperClass* pSW) MessageListClass::Instance.PrintMessage(this->Message_LinkedSWAcquired.Get(), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true); } } + +void SWTypeExt::ExtData::ApplyActivatedFirerEva(SuperClass* pSW) +{ + const auto pHouse = pSW->Owner; + if (!pHouse->IsControlledByCurrentPlayer()) + return; + + VoxClass::PlayIndex(this->EVA_Activated_Firer.Get(), -1, -1); +} From 25903a578e49a9e84284c406d4f7fa2e4bf8eef2 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Mon, 4 May 2026 20:20:55 +0800 Subject: [PATCH 2/3] update docs --- docs/New-or-Enhanced-Logics.md | 21 ++++++++++----------- docs/Whats-New.md | 1 + 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index d21583c1ca..38aa8786ca 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1153,6 +1153,16 @@ EMPulse.SuspendOthers=false ; boolean `Type=EMPulse` superweapon and any associated keys are [Ares features](https://ares-developers.github.io/Ares-docs/new/superweapons/types/empulse.html). ``` +### Firer-only EVA on superweapon activated + +- Unlike `EVA.Activated`, this EVA message is played only for the player who fires the superweapon, instead of being broadcast to all players. + +In `rulesmd.ini`: +```ini +[SOMESW] ; SuperWeaponType +EVA.Activated.Firer= ; EVA entry +``` + ### LimboDelivery - Superweapons can now deliver off-map buildings that act as if they were on the field. @@ -1268,17 +1278,6 @@ Detonate.Damage= ; integer Detonate.AtFirer=false ; boolean ``` -### Firer-only EVA on superweapon activated - -Adds `EVA.Activated.Firer` for superweapons. -Unlike `EVA.Activated`, this EVA message is played only for the player who fires the superweapon, instead of being broadcast to all players. -In `rulesmd.ini`: - -```ini -[SOMESW] -EVA.Activated.Firer= ; EVA entry -``` - ## Technos ### Aggressive attack move mission diff --git a/docs/Whats-New.md b/docs/Whats-New.md index ae735b5c1a..ba35a6c242 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) +- [Firer-only EVA on superweapon activated](New-or-Enhanced-Logics.md#firer-only-eva-on-superweapon-activated) (by Flactine) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) From e5def37f2579054a54ed896958a4c6e7eebc5079 Mon Sep 17 00:00:00 2001 From: Flactine <1716455702@qq.com> Date: Tue, 5 May 2026 00:15:42 +0800 Subject: [PATCH 3/3] Added Message.Activated.Firer --- CREDITS.md | 2 +- docs/New-or-Enhanced-Logics.md | 5 +++-- docs/Whats-New.md | 2 +- src/Ext/SWType/Body.cpp | 2 ++ src/Ext/SWType/Body.h | 5 ++++- src/Ext/SWType/FireSuperWeapon.cpp | 14 +++++++++++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CREDITS.md b/CREDITS.md index 96bd007421..85b7c3c91a 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -758,7 +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 - - Firer-only EVA on superweapon activation + - Firer-only message and EVA on superweapon activation - **tyuah8**: - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix - Destroyed unit leaves sensors bugfix diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 38aa8786ca..692713969e 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1153,13 +1153,14 @@ EMPulse.SuspendOthers=false ; boolean `Type=EMPulse` superweapon and any associated keys are [Ares features](https://ares-developers.github.io/Ares-docs/new/superweapons/types/empulse.html). ``` -### Firer-only EVA on superweapon activated +### Firer-only message and EVA on superweapon activated -- Unlike `EVA.Activated`, this EVA message is played only for the player who fires the superweapon, instead of being broadcast to all players. +- Unlike `Message.Activated` and `EVA.Activated`, this message and EVA are played only for the player who fires the superweapon, instead of being broadcast to all players. In `rulesmd.ini`: ```ini [SOMESW] ; SuperWeaponType +Message.Activated.Firer= ; CSF entry key EVA.Activated.Firer= ; EVA entry ``` diff --git a/docs/Whats-New.md b/docs/Whats-New.md index ba35a6c242..8de21b1a8a 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -573,7 +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) -- [Firer-only EVA on superweapon activated](New-or-Enhanced-Logics.md#firer-only-eva-on-superweapon-activated) (by Flactine) +- [Firer-only message and EVA on superweapon activated](New-or-Enhanced-Logics.md#firer-only-eva-on-superweapon-activated) (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 2bcbbb92fa..abcfc83687 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->Message_Activated_Firer) .Process(this->EVA_Activated_Firer) ; } @@ -225,6 +226,7 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->SW_Link_Reset.Read(exINI, pSection, "SW.Link.Reset"); this->Message_LinkedSWAcquired.Read(exINI, pSection, "Message.LinkedSWAcquired"); this->EVA_LinkedSWAcquired.Read(exINI, pSection, "EVA.LinkedSWAcquired"); + this->Message_Activated_Firer.Read(exINI, pSection, "Message.Activated.Firer"); this->EVA_Activated_Firer.Read(exINI, pSection, "EVA.Activated.Firer"); this->SW_Link_RollChances.Read(exINI, pSection, "SW.Link.RollChances"); diff --git a/src/Ext/SWType/Body.h b/src/Ext/SWType/Body.h index 95a6b92378..1764d5217f 100644 --- a/src/Ext/SWType/Body.h +++ b/src/Ext/SWType/Body.h @@ -107,6 +107,7 @@ class SWTypeExt ValueableVector SW_Link_RollChances; Valueable Message_LinkedSWAcquired; NullableIdx EVA_LinkedSWAcquired; + Valueable Message_Activated_Firer; NullableIdx EVA_Activated_Firer; ExtData(SuperWeaponTypeClass* OwnerObject) : Extension(OwnerObject) @@ -186,6 +187,7 @@ class SWTypeExt , SW_Link_RandomWeightsData {} , Message_LinkedSWAcquired {} , EVA_LinkedSWAcquired {} + , Message_Activated_Firer {} , EVA_Activated_Firer {} { } @@ -213,7 +215,8 @@ class SWTypeExt void ApplyLinkedSW(SuperClass* pSW); - void ApplyActivatedFirerEva(SuperClass* pSW); + void ApplyActivatedFirerMessage(SuperClass* pSW) const; + void ApplyActivatedFirerEva(SuperClass* pSW) const; 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 c585df93fc..668fdd19c6 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->Message_Activated_Firer.Get().empty()) + pTypeExt->ApplyActivatedFirerMessage(pSW); + if (pTypeExt->EVA_Activated_Firer.isset()) pTypeExt->ApplyActivatedFirerEva(pSW); @@ -487,7 +490,16 @@ void SWTypeExt::ExtData::ApplyLinkedSW(SuperClass* pSW) } } -void SWTypeExt::ExtData::ApplyActivatedFirerEva(SuperClass* pSW) +void SWTypeExt::ExtData::ApplyActivatedFirerMessage(SuperClass* pSW) const +{ + const auto pHouse = pSW->Owner; + if (!pHouse->IsControlledByCurrentPlayer()) + return; + + MessageListClass::Instance.PrintMessage(this->Message_Activated_Firer.Get(), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true); +} + +void SWTypeExt::ExtData::ApplyActivatedFirerEva(SuperClass* pSW) const { const auto pHouse = pSW->Owner; if (!pHouse->IsControlledByCurrentPlayer())