Skip to content

Commit fa7fc05

Browse files
authored
[New Feature]Raise alert when technos are taking damage (#1313)
### Raise alert when technos are taking damage - In Vanilla, non-building technos will not generate radar events or EVAs when attacked, so players can hardly notice them until they are destroyed. You can now receive a radar event (and optionally a sound effect) when your units is attacked, so you can respond to the combats in time. - `[AudioVisual]->CombatAlert` is a global switch, set it to `true` to enable the entire logic. - These flags controlls when to trigger a combat alert. - You can disable this logic on specific techno by setting `[SOMETECHNO]->CombatAlert` to `false`. You may hope to disable it on insignificant technos, like the spawns or slaves. - `[AudioVisual]->CombatAlert.IgnoreBuilding` will turn the logic off on buildings. You can override it for specific building by setting `[SOMETECHNO]->CombatAlert.NotBuilding` to true. You may hope to use it on veh-buildings. - `[AudioVisual]->CombatAlert.SuppressIfInScreen` decides whether to disable the logic for the units in the current screen. - `[AudioVisual]->CombatAlert.Interval` decides the time interval (in frames) between alerts, to prevent the alert from being anonying. It is default to 150 frames. - `[AudioVisual]->CombatAlert.SuppressIfAllyDamage` decides whether to disable the logic for the damage from allys. - Technos hitted by a warhead with `[SOMEWARHEAD]->CombatAlert.Suppress` setted to `true` will not raise a radar event or EVA. This flag is default to the inverse value of ares flag `[SOMEWARHEAD]->Malicious`. - And the following flags controlls the effect of a combat alert. - `[AudioVisual]->CombatAlert.MakeAVoice` decides whether to play some sound effect with the combat alert. Set it to `true` will enable the following flags, otherwise they will be ignored. - `[SOMETECHNO]->CombatAlert.UseFeedbackVoice` decides whether to use the sound defined by `VoiceFeedback`. Default to `[AudioVisual]->CombatAlert.UseFeedbackVoice`. - `[SOMETECHNO]->CombatAlert.UseAttackVoice` decides whether to use the sound defined by `VoiceAttack`. Default to `[AudioVisual]->CombatAlert.UseAttackVoice`. - `[SOMETECHNO]->CombatAlert.UseEVA` decides whether to play an EVA. Default to `[AudioVisual]->CombatAlert.UseEVA`. The EVA to play is default to `EVA_UnitsInCombat`, and can be specified through `[SOMETECHNO]->CombatAlert.EVA`. - The sound effect is taken **at order**, feedback first, attack then, eva finally. The flags in `[AudioVisual]` controlls whether to check it globally, and can be specify per techno. - An example: You set `CombatAlert.UseFeedbackVoice` and `CombatAlert.UseEVA` to `true` and `CombatAlert.UseAttackVoice` to `false`. A unit with `VoiceFeedback` `VoiceAttack` and `CombatAlert.EVA` are all set will play `VoiceFeedback`. A unit with `VoiceAttack` set will play `EVA_UnitsInCombat`. In `rulesmd.ini`: ```ini [AudioVisual] CombatAlert=false ;boolean CombatAlert.IgnoreBuilding=true ;boolean CombatAlert.SuppressIfInScreen=true ;boolean CombatAlert.Interval=150 ;integer, game frames CombatAlert.SuppressIfAllyDamage=true ;boolean CombatAlert.MakeAVoice=true ;boolean CombatAlert.UseFeedbackVoice=true ;boolean CombatAlert.UseAttackVoice=true ;boolean CombatAlert.UseEVA=true ;boolean [SOMETECHNO] CombatAlert=true ;boolean CombatAlert.NotBuilding=false ;boolean CombatAlert.UseFeedbackVoice=true ;boolean CombatAlert.UseAttackVoice=true ;boolean CombatAlert.UseEVA=true ;boolean CombatAlert.EVA=EVA_UnitsInCombat ;EVA entry [SOMEWARHEAD] CombatAlert.Suppress= ;boolean ```
1 parent 245b08a commit fa7fc05

File tree

13 files changed

+207
-5
lines changed

13 files changed

+207
-5
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ This page lists all the individual contributions to the project by their author.
397397
- Global value of `RepairBaseNodes`
398398
- Skip anim delay for burst fire
399399
- Type select for buildings (code)
400+
- Raise alert when technos are taking damage
400401
- **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
401402
- **Aephiex** - initial fix for Ares academy not working on the initial payloads of vehicles built from a war factory
402403
- **Ares developers**

docs/New-or-Enhanced-Logics.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,50 @@ Promote.VeteranAnimation= ; Animation
14901490
Promote.EliteAnimation= ; Animation
14911491
```
14921492

1493+
### Raise alert when technos are taking damage
1494+
1495+
- In Vanilla, non-building technos will not generate radar events or EVAs when attacked, so players can hardly notice them until they are destroyed. You can now receive a radar event (and optionally a sound effect) when your units is attacked, so you can respond to the combats in time.
1496+
- `[AudioVisual]->CombatAlert` is a global switch, set it to `true` to enable the entire logic.
1497+
- These flags controlls when to trigger a combat alert.
1498+
- You can disable this logic on specific techno by setting `[SOMETECHNO]->CombatAlert` to `false`. It is defaultly disabled for technos with `Insignificant=yes` or `Spawned=yes`.
1499+
- `[AudioVisual]->CombatAlert.IgnoreBuilding` will turn the logic off on buildings. You can override it for specific building by setting `[SOMETECHNO]->CombatAlert.NotBuilding` to true. You may hope to use it on veh-buildings.
1500+
- `[AudioVisual]->CombatAlert.SuppressIfInScreen` decides whether to disable the logic for the units in the current screen.
1501+
- `[AudioVisual]->CombatAlert.Interval` decides the time interval (in frames) between alerts, to prevent the alert from being anonying. It is default to 150 frames.
1502+
- `[AudioVisual]->CombatAlert.SuppressIfAllyDamage` decides whether to disable the logic for the damage from allys.
1503+
- Technos hitted by a warhead with `[SOMEWARHEAD]->CombatAlert.Suppress` setted to `true` will not raise a radar event or EVA. This flag is default to the logical or of inverse value of ares flag `[SOMEWARHEAD]->Malicious` and `[SOMEWARHEAD]->Nonprovocative`.
1504+
- And the following flags controlls the effect of a combat alert.
1505+
- `[AudioVisual]->CombatAlert.MakeAVoice` decides whether to play some sound effect with the combat alert. Set it to `true` will enable the following flags, otherwise they will be ignored.
1506+
- `[SOMETECHNO]->CombatAlert.UseFeedbackVoice` decides whether to use the sound defined by `VoiceFeedback`. Default to `[AudioVisual]->CombatAlert.UseFeedbackVoice`.
1507+
- `[SOMETECHNO]->CombatAlert.UseAttackVoice` decides whether to use the sound defined by `VoiceAttack`. Default to `[AudioVisual]->CombatAlert.UseAttackVoice`.
1508+
- `[SOMETECHNO]->CombatAlert.UseEVA` decides whether to play an EVA. Default to `[AudioVisual]->CombatAlert.UseEVA`. The EVA to play is default to `EVA_UnitsInCombat`, and can be specified through `[SOMETECHNO]->CombatAlert.EVA`.
1509+
- The sound effect is taken **at order**, feedback first, attack then, eva finally. The flags in `[AudioVisual]` controlls whether to check it globally, and can be specify per techno.
1510+
- An example: You set `CombatAlert.UseFeedbackVoice` and `CombatAlert.UseEVA` to `true` and `CombatAlert.UseAttackVoice` to `false`. A unit with `VoiceFeedback` `VoiceAttack` and `CombatAlert.EVA` are all set will play `VoiceFeedback`. A unit with `VoiceAttack` set will play `EVA_UnitsInCombat`.
1511+
1512+
In `rulesmd.ini`:
1513+
```ini
1514+
[AudioVisual]
1515+
CombatAlert=false ;boolean
1516+
CombatAlert.IgnoreBuilding=true ;boolean
1517+
CombatAlert.SuppressIfInScreen=true ;boolean
1518+
CombatAlert.Interval=150 ;integer, game frames
1519+
CombatAlert.SuppressIfAllyDamage=true ;boolean
1520+
CombatAlert.MakeAVoice=true ;boolean
1521+
CombatAlert.UseFeedbackVoice=true ;boolean
1522+
CombatAlert.UseAttackVoice=true ;boolean
1523+
CombatAlert.UseEVA=true ;boolean
1524+
1525+
[SOMETECHNO]
1526+
CombatAlert= ;boolean
1527+
CombatAlert.NotBuilding=false ;boolean
1528+
CombatAlert.UseFeedbackVoice=true ;boolean
1529+
CombatAlert.UseAttackVoice=true ;boolean
1530+
CombatAlert.UseEVA=true ;boolean
1531+
CombatAlert.EVA=EVA_UnitsInCombat ;EVA entry
1532+
1533+
[SOMEWARHEAD]
1534+
CombatAlert.Suppress= ;boolean
1535+
```
1536+
14931537
### Convert TechnoType on owner house change
14941538

14951539
- You can now change a unit's type when changing ownership from human to computer or from computer to human.

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ New:
321321
- Skip anim delay for burst fire (by TaranDahl)
322322
- New Parabola trajectory (by CrimRecya)
323323
- Type select for buildings (code by TaranDahl(航味麻酱), doc by Ollerus)
324+
- Raise alert when technos are taking damage (by TaranDahl)
324325
325326
Vanilla fixes:
326327
- Aircraft will now behave as expected according to it's `MovementZone` and `SpeedType` when moving onto different surfaces. In particular, this fixes erratic behavior when vanilla aircraft is ordered to move onto water surface and instead the movement order changes to a shore nearby (by CrimRecya)

src/Ext/House/Body.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ void HouseExt::ExtData::Serialize(T& Stm)
621621
.Process(this->RestrictedFactoryPlants)
622622
.Process(this->LastBuiltNavalVehicleType)
623623
.Process(this->ProducingNavalUnitTypeIndex)
624+
.Process(this->CombatAlertTimer)
624625
.Process(this->NumAirpads_NonMFB)
625626
.Process(this->NumBarracks_NonMFB)
626627
.Process(this->NumWarFactories_NonMFB)

src/Ext/House/Body.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class HouseExt
3535
BuildingClass* Factory_NavyType;
3636
BuildingClass* Factory_AircraftType;
3737

38+
CDTimerClass CombatAlertTimer;
3839
CDTimerClass AISuperWeaponDelayTimer;
3940
CDTimerClass AIFireSaleDelayTimer;
4041

@@ -79,6 +80,7 @@ class HouseExt
7980
, RestrictedFactoryPlants {}
8081
, LastBuiltNavalVehicleType { -1 }
8182
, ProducingNavalUnitTypeIndex { -1 }
83+
, CombatAlertTimer {}
8284
, NumAirpads_NonMFB { 0 }
8385
, NumBarracks_NonMFB { 0 }
8486
, NumWarFactories_NonMFB { 0 }

src/Ext/Rules/Body.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
198198
this->VoxelLightSource.Read(exINI, GameStrings::AudioVisual, "VoxelLightSource");
199199
// this->VoxelShadowLightSource.Read(exINI, GameStrings::AudioVisual, "VoxelShadowLightSource");
200200

201+
this->CombatAlert.Read(exINI, GameStrings::AudioVisual, "CombatAlert");
202+
this->CombatAlert_IgnoreBuilding.Read(exINI, GameStrings::AudioVisual, "CombatAlert.IgnoreBuilding");
203+
this->CombatAlert_SuppressIfInScreen.Read(exINI, GameStrings::AudioVisual, "CombatAlert.SuppressIfInScreen");
204+
this->CombatAlert_Interval.Read(exINI, GameStrings::AudioVisual, "CombatAlert.Interval");
205+
this->CombatAlert_SuppressIfAllyDamage.Read(exINI, GameStrings::AudioVisual, "CombatAlert.SuppressIfAllyDamage");
206+
this->CombatAlert_MakeAVoice.Read(exINI, GameStrings::AudioVisual, "CombatAlert.MakeAVoice");
207+
this->CombatAlert_UseFeedbackVoice.Read(exINI, GameStrings::AudioVisual, "CombatAlert.UseFeedbackVoice");
208+
this->CombatAlert_UseAttackVoice.Read(exINI, GameStrings::AudioVisual, "CombatAlert.UseAttackVoice");
209+
this->CombatAlert_UseEVA.Read(exINI, GameStrings::AudioVisual, "CombatAlert.UseEVA");
210+
201211
this->ReplaceVoxelLightSources();
202212

203213
this->UseFixedVoxelLighting.Read(exINI, GameStrings::AudioVisual, "UseFixedVoxelLighting");
@@ -390,6 +400,15 @@ void RulesExt::ExtData::Serialize(T& Stm)
390400
.Process(this->JumpjetLevelLightMultiplier)
391401
.Process(this->VoxelLightSource)
392402
// .Process(this->VoxelShadowLightSource)
403+
.Process(this->CombatAlert)
404+
.Process(this->CombatAlert_IgnoreBuilding)
405+
.Process(this->CombatAlert_SuppressIfInScreen)
406+
.Process(this->CombatAlert_Interval)
407+
.Process(this->CombatAlert_SuppressIfAllyDamage)
408+
.Process(this->CombatAlert_MakeAVoice)
409+
.Process(this->CombatAlert_UseFeedbackVoice)
410+
.Process(this->CombatAlert_UseAttackVoice)
411+
.Process(this->CombatAlert_UseEVA)
393412
.Process(this->UseFixedVoxelLighting)
394413
.Process(this->GatherWhenMCVDeploy)
395414
.Process(this->AIFireSale)

src/Ext/Rules/Body.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ class RulesExt
157157
Valueable<double> AircraftLevelLightMultiplier;
158158
Valueable<double> JumpjetLevelLightMultiplier;
159159

160+
Valueable<bool> CombatAlert;
161+
Valueable<bool> CombatAlert_IgnoreBuilding;
162+
Valueable<bool> CombatAlert_SuppressIfInScreen;
163+
Valueable<int> CombatAlert_Interval;
164+
Valueable<bool> CombatAlert_SuppressIfAllyDamage;
165+
Valueable<bool> CombatAlert_MakeAVoice;
166+
Valueable<bool> CombatAlert_UseFeedbackVoice;
167+
Valueable<bool> CombatAlert_UseAttackVoice;
168+
Valueable<bool> CombatAlert_UseEVA;
169+
160170
Nullable<Vector3D<float>> VoxelLightSource;
161171
// Nullable<Vector3D<float>> VoxelShadowLightSource;
162172
Valueable<bool> UseFixedVoxelLighting;
@@ -288,6 +298,16 @@ class RulesExt
288298
, JumpjetLevelLightMultiplier { 0.0 }
289299
, VoxelLightSource { }
290300
// , VoxelShadowLightSource { }
301+
302+
, CombatAlert { false }
303+
, CombatAlert_IgnoreBuilding { true }
304+
, CombatAlert_SuppressIfInScreen { true }
305+
, CombatAlert_Interval { 150 }
306+
, CombatAlert_SuppressIfAllyDamage { true }
307+
, CombatAlert_MakeAVoice { true }
308+
, CombatAlert_UseFeedbackVoice { true }
309+
, CombatAlert_UseAttackVoice { true }
310+
, CombatAlert_UseEVA { true }
291311
, UseFixedVoxelLighting { false }
292312
, GatherWhenMCVDeploy { true }
293313
, AIFireSale { true }

src/Ext/Techno/Hooks.ReceiveDamage.cpp

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#include "Body.h"
22

3+
#include <TacticalClass.h>
4+
#include <RadarEventClass.h>
5+
36
#include <Ext/WarheadType/Body.h>
47
#include <Ext/WeaponType/Body.h>
58
#include <Ext/TEvent/Body.h>
9+
#include <Ext/House/Body.h>
610

711
namespace ReceiveDamageTemp
812
{
@@ -19,6 +23,75 @@ DEFINE_HOOK(0x701900, TechnoClass_ReceiveDamage_Shield, 0x6)
1923

2024
int nDamageLeft = *args->Damage;
2125

26+
const auto pRules = RulesExt::Global();
27+
28+
if (pRules->CombatAlert && nDamageLeft > 1)
29+
{
30+
do
31+
{
32+
const auto pHouse = pThis->Owner;
33+
34+
if (!pHouse || (!pThis->IsOwnedByCurrentPlayer && !pHouse->IsInPlayerControl) || !pThis->IsInPlayfield)
35+
break;
36+
37+
const auto pSourceHouse = args->SourceHouse;
38+
39+
if (pRules->CombatAlert_SuppressIfAllyDamage && pHouse->IsAlliedWith(pSourceHouse))
40+
break;
41+
42+
const auto pHouseExt = HouseExt::ExtMap.Find(pHouse);
43+
44+
if (pHouseExt->CombatAlertTimer.HasTimeLeft())
45+
break;
46+
47+
const auto pWHExt = WarheadTypeExt::ExtMap.Find(args->WH);
48+
49+
if (pWHExt->CombatAlert_Suppress.Get(!pWHExt->Malicious || pWHExt->Nonprovocative))
50+
break;
51+
52+
const auto pType = pThis->GetTechnoType();
53+
const auto pTypeExt = TechnoTypeExt::ExtMap.Find(pType);
54+
55+
if (!pType || !pTypeExt || !pTypeExt->CombatAlert.Get(!pType->Insignificant && !pType->Spawned))
56+
break;
57+
58+
const auto pBuilding = pThis->WhatAmI() == AbstractType::Building ? static_cast<BuildingClass*>(pThis) : nullptr;
59+
60+
if (pRules->CombatAlert_IgnoreBuilding && pBuilding && !pTypeExt->CombatAlert_NotBuilding.Get(pBuilding->Type->IsVehicle()))
61+
break;
62+
63+
const CoordStruct coordInMap = pThis->GetCoords();
64+
65+
if (pRules->CombatAlert_SuppressIfInScreen)
66+
{
67+
TacticalClass* const pTactical = TacticalClass::Instance;
68+
const Point2D coordInScreen = pTactical->CoordsToScreen(coordInMap) - pTactical->TacticalPos;
69+
const RectangleStruct screenArea = DSurface::Composite->GetRect();
70+
71+
if (screenArea.Width >= coordInScreen.X && screenArea.Height >= coordInScreen.Y && coordInScreen.X >= 0 && coordInScreen.Y >= 0) // check if the unit is in screen
72+
break;
73+
}
74+
75+
pHouseExt->CombatAlertTimer.Start(pRules->CombatAlert_Interval);
76+
RadarEventClass::Create(RadarEventType::Combat, CellClass::Coord2Cell(coordInMap));
77+
78+
int index = -1;
79+
80+
if (!pRules->CombatAlert_MakeAVoice) // No one want to play two sound at a time, I guess?
81+
break;
82+
else if (pTypeExt->CombatAlert_UseFeedbackVoice.Get((const bool)pRules->CombatAlert_UseFeedbackVoice) && pType->VoiceFeedback.Count > 0) // Use VoiceFeedback first
83+
VocClass::PlayGlobal(pType->VoiceFeedback.GetItem(0), 0x2000, 1.0);
84+
else if (pTypeExt->CombatAlert_UseAttackVoice.Get((const bool)pRules->CombatAlert_UseAttackVoice) && pType->VoiceAttack.Count > 0) // Use VoiceAttack then
85+
VocClass::PlayGlobal(pType->VoiceAttack.GetItem(0), 0x2000, 1.0);
86+
else if (pTypeExt->CombatAlert_UseEVA.Get((const bool)pRules->CombatAlert_UseEVA)) // Use Eva finally
87+
index = pTypeExt->CombatAlert_EVA.Get(VoxClass::FindIndex((const char*)"EVA_UnitsInCombat"));
88+
89+
if (index != -1)
90+
VoxClass::PlayIndex(index);
91+
}
92+
while (false);
93+
}
94+
2295
if (!args->IgnoreDefenses)
2396
{
2497
if (const auto pShieldData = pExt->Shield.get())

src/Ext/Techno/Hooks.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <Ext/House/Body.h>
1010
#include <Ext/WarheadType/Body.h>
1111
#include <Ext/WeaponType/Body.h>
12+
#include <Ext/TechnoType/Body.h>
1213
#include <Utilities/EnumFunctions.h>
1314
#include <Utilities/AresHelper.h>
1415

@@ -564,7 +565,7 @@ DEFINE_HOOK(0x4C7462, EventClass_Execute_KeepTargetOnMove, 0x5)
564565

565566
auto const mission = static_cast<Mission>(pThis->MegaMission.Mission);
566567
auto const pExt = TechnoExt::ExtMap.Find(pTechno);
567-
568+
568569
if ((mission == Mission::Move) && pExt->TypeExtData->KeepTargetOnMove && pTechno->Target && !pTarget)
569570
{
570571
if (pTechno->IsCloseEnoughToAttack(pTechno->Target))
@@ -613,7 +614,6 @@ DEFINE_HOOK(0x736480, UnitClass_AI_KeepTargetOnMove, 0x6)
613614

614615
#pragma endregion
615616

616-
617617
#pragma region BuildingTypeSelectable
618618

619619
namespace BuildingTypeSelectable
@@ -640,10 +640,10 @@ DEFINE_HOOK(0x732C97, TechnoClass_IDMatches_ResetContext, 0x5)
640640
DEFINE_HOOK(0x465D40, BuildingClass_Is1x1AndUndeployable_BuildingMassSelectable, 0x6)
641641
{
642642
enum { SkipGameCode = 0x465D6A };
643-
643+
644644
// Since Ares hooks around, we have difficulty juggling Ares and no Ares.
645645
// So we simply disable this feature if no Ares.
646-
if (!AresHelper::CanUseAres)
646+
if (!AresHelper::CanUseAres)
647647
return 0;
648648

649649
if (!BuildingTypeSelectable::ProcessingIDMatches || !RulesExt::Global()->BuildingTypeSelectable)
@@ -653,4 +653,4 @@ DEFINE_HOOK(0x465D40, BuildingClass_Is1x1AndUndeployable_BuildingMassSelectable,
653653
return SkipGameCode;
654654
}
655655

656-
#pragma endregion
656+
#pragma endregion

src/Ext/TechnoType/Body.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,13 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
324324
this->SellSound.Read(exINI, pSection, "SellSound");
325325
this->EVA_Sold.Read(exINI, pSection, "EVA.Sold");
326326

327+
this->CombatAlert.Read(exINI, pSection, "CombatAlert");
328+
this->CombatAlert_NotBuilding.Read(exINI, pSection, "CombatAlert.NotBuilding");
329+
this->CombatAlert_UseFeedbackVoice.Read(exINI, pSection, "CombatAlert.UseFeedbackVoice");
330+
this->CombatAlert_UseAttackVoice.Read(exINI, pSection, "CombatAlert.UseAttackVoice");
331+
this->CombatAlert_UseEVA.Read(exINI, pSection, "CombatAlert.UseEVA");
332+
this->CombatAlert_EVA.Read(exINI, pSection, "CombatAlert.EVA");
333+
327334
this->VoiceCreated.Read(exINI, pSection, "VoiceCreated");
328335
this->VoicePickup.Read(exINI, pSection, "VoicePickup");
329336

@@ -684,6 +691,13 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
684691
.Process(this->SellSound)
685692
.Process(this->EVA_Sold)
686693

694+
.Process(this->CombatAlert)
695+
.Process(this->CombatAlert_NotBuilding)
696+
.Process(this->CombatAlert_UseFeedbackVoice)
697+
.Process(this->CombatAlert_UseAttackVoice)
698+
.Process(this->CombatAlert_UseEVA)
699+
.Process(this->CombatAlert_EVA)
700+
687701
.Process(this->VoiceCreated)
688702
.Process(this->VoicePickup)
689703

src/Ext/TechnoType/Body.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ class TechnoTypeExt
8484
NullableIdx<VocClass> SellSound;
8585
NullableIdx<VoxClass> EVA_Sold;
8686

87+
Nullable<bool> CombatAlert;
88+
Nullable<bool> CombatAlert_NotBuilding;
89+
Nullable<bool> CombatAlert_UseFeedbackVoice;
90+
Nullable<bool> CombatAlert_UseAttackVoice;
91+
Nullable<bool> CombatAlert_UseEVA;
92+
NullableIdx<VoxClass> CombatAlert_EVA;
93+
8794
NullableIdx<VocClass> VoiceCreated;
8895
NullableIdx<VocClass> VoicePickup; // Used by carryalls instead of VoiceMove if set.
8996

@@ -360,6 +367,14 @@ class TechnoTypeExt
360367
, SlavesFreeSound {}
361368
, SellSound {}
362369
, EVA_Sold {}
370+
371+
, CombatAlert {}
372+
, CombatAlert_NotBuilding {}
373+
, CombatAlert_UseFeedbackVoice {}
374+
, CombatAlert_UseAttackVoice {}
375+
, CombatAlert_UseEVA {}
376+
, CombatAlert_EVA {}
377+
363378
, EnemyUIName {}
364379

365380
, VoiceCreated {}

src/Ext/WarheadType/Body.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
266266
this->SuppressReflectDamage.Read(exINI, pSection, "SuppressReflectDamage");
267267
this->SuppressReflectDamage_Types.Read(exINI, pSection, "SuppressReflectDamage.Types");
268268

269+
this->CombatAlert_Suppress.Read(exINI, pSection, "CombatAlert.Suppress");
270+
269271
// Convert.From & Convert.To
270272
TypeConvertGroup::Parse(this->Convert_Pairs, exINI, pSection, AffectedHouse::All);
271273

@@ -300,6 +302,7 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
300302
this->AffectsEnemies.Read(exINI, pSection, "AffectsEnemies");
301303
this->AffectsOwner.Read(exINI, pSection, "AffectsOwner");
302304
this->EffectsRequireVerses.Read(exINI, pSection, "EffectsRequireVerses");
305+
this->Malicious.Read(exINI, pSection, "Malicious");
303306

304307
// List all Warheads here that respect CellSpread
305308
// Used in WarheadTypeExt::ExtData::Detonate
@@ -489,10 +492,13 @@ void WarheadTypeExt::ExtData::Serialize(T& Stm)
489492
.Process(this->CLIsBlack)
490493
.Process(this->Particle_AlphaImageIsLightFlash)
491494

495+
.Process(this->CombatAlert_Suppress)
496+
492497
// Ares tags
493498
.Process(this->AffectsEnemies)
494499
.Process(this->AffectsOwner)
495500
.Process(this->EffectsRequireVerses)
501+
.Process(this->Malicious)
496502

497503
.Process(this->WasDetonatedOnAllMapObjects)
498504
.Process(this->RemainingAnimCreationInterval)

0 commit comments

Comments
 (0)