Skip to content

Commit f060ec9

Browse files
NetsuNegiTaranDahl
authored andcommitted
Customize the scatter caused by aircraft attack mission (#1701)
* impl * Update Hooks.Misc.cpp * Update Hooks.Misc.cpp * Update Hooks.Misc.cpp * flag * Update Hooks.Misc.cpp * Update Hooks.Misc.cpp * Update Hooks.Misc.cpp * Update Hooks.Misc.cpp * Update Hooks.cpp * Update Hooks.cpp * doc * per techno * Update Hooks.cpp * Remove excess spaces --------- Co-authored-by: TaranDahl <[email protected]> Co-authored-by: 航味麻酱 <[email protected]> Co-authored-by: Netsu_Negi <[email protected]>
1 parent 3798f3f commit f060ec9

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ This page lists all the individual contributions to the project by their author.
519519
- RadarInvisible for non-enemy house
520520
- Allow miners do area guard
521521
- Make harvesters do addtional scan after unload
522+
- Customize the scatter caused by aircraft attack mission
522523
- **tyuah8**:
523524
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
524525
- Destroyed unit leaves sensors bugfix

docs/Fixed-or-Improved-Logics.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,16 @@ In `rulesmd.ini`:
260260
VoicePickup= ; Sound entry
261261
```
262262

263+
### Customize the scatter caused by aircraft attack mission
264+
265+
- In vanilla, when an aircraft attacks, it forces the target's cell to trigger a scatter. Now you can disable this behavior by setting the following flag to `false`.
266+
267+
In `rulesmd.ini`:
268+
```ini
269+
[SOMEAIRCRAFT] ; AircraftType
270+
FiringForceScatter=true ; boolean
271+
```
272+
263273
### Extended Aircraft Missions
264274

265275
- Aircraft will now be able to use waypoints.

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ New:
382382
- [Customizable airstrike flare colors](Fixed-or-Improved-Logics.md#airstrike-flare-customizations) (by Starkku)
383383
- Allowed player's self-healing effects to be benefited by allied or `PlayerControl=true` houses (by Ollerus)
384384
- Exclusive SuperWeapon Sidebar (by NetsuNegi & CrimRecya)
385+
- Customize the scatter caused by aircraft attack mission (by TaranDahl)
385386
386387
Vanilla fixes:
387388
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)

src/Ext/Aircraft/Hooks.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,22 @@ void __fastcall AircraftClass_SetTarget_Wrapper(AircraftClass* pThis, void* _, A
253253

254254
DEFINE_FUNCTION_JUMP(VTABLE, 0x7E266C, AircraftClass_SetTarget_Wrapper);
255255

256+
DEFINE_HOOK_AGAIN(0x41882C, AircraftClass_MissionAttack_ScatterCell1, 0x6);
257+
DEFINE_HOOK_AGAIN(0x41893B, AircraftClass_MissionAttack_ScatterCell1, 0x6);
258+
DEFINE_HOOK_AGAIN(0x418A4A, AircraftClass_MissionAttack_ScatterCell1, 0x6);
259+
DEFINE_HOOK_AGAIN(0x418B46, AircraftClass_MissionAttack_ScatterCell1, 0x6);
260+
DEFINE_HOOK(0x41847E, AircraftClass_MissionAttack_ScatterCell1, 0x6)
261+
{
262+
GET(AircraftClass*, pThis, ESI);
263+
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x44);
264+
}
265+
266+
DEFINE_HOOK(0x4186DD, AircraftClass_MissionAttack_ScatterCell2, 0x5)
267+
{
268+
GET(AircraftClass*, pThis, ESI);
269+
return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x43);
270+
}
271+
256272
#pragma endregion
257273

258274
DEFINE_HOOK(0x414F10, AircraftClass_AI_Trailer, 0x5)

src/Ext/TechnoType/Body.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
644644
this->Harvester_CanGuardArea.Read(exINI, pSection, "Harvester.CanGuardArea");
645645
this->HarvesterScanAfterUnload.Read(exINI, pSection, "HarvesterScanAfterUnload");
646646

647+
this->FiringForceScatter.Read(exINI, pSection, "FiringForceScatter");
648+
647649
// Ares 0.2
648650
this->RadarJamRadius.Read(exINI, pSection, "RadarJamRadius");
649651

@@ -1195,6 +1197,8 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
11951197

11961198
.Process(this->FallingDownDamage)
11971199
.Process(this->FallingDownDamage_Water)
1200+
1201+
.Process(this->FiringForceScatter)
11981202
;
11991203
}
12001204
void TechnoTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)

src/Ext/TechnoType/Body.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ class TechnoTypeExt
362362
Valueable<double> FallingDownDamage;
363363
Nullable<double> FallingDownDamage_Water;
364364

365+
Valueable<bool> FiringForceScatter;
366+
365367
ExtData(TechnoTypeClass* OwnerObject) : Extension<TechnoTypeClass>(OwnerObject)
366368
, HealthBar_Hide { false }
367369
, UIDescription {}
@@ -674,6 +676,8 @@ class TechnoTypeExt
674676

675677
, FallingDownDamage { 1.0 }
676678
, FallingDownDamage_Water {}
679+
680+
, FiringForceScatter { true }
677681
{ }
678682

679683
virtual ~ExtData() = default;

0 commit comments

Comments
 (0)