Skip to content

Commit 50e6563

Browse files
committed
AttackMove.Follow.IfMindControlIsFull
1 parent c3ac33b commit 50e6563

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

docs/New-or-Enhanced-Logics.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,13 +1199,15 @@ AttackMove.PursuitTarget= ; boolean
11991199

12001200
- Now you can have some units following surrounding units when executing an attack move command. The follow behavior is equivalent to the behavior of follow command (`ctrl + alt`).
12011201
- Use `AttackMove.Follow.IncludeAir` to determine whether the follower will follow an air unit.
1202+
- Mind control units with `AttackMove.Follow.IfMindControlIsFull=true` set will follow if they reach the capacity.
12021203
- This feature should be useful for supportive units such as medics and repairers.
12031204

12041205
In `rulesmd.ini`:
12051206
```ini
1206-
[SOMETECHNO] ; TechnoType
1207-
AttackMove.Follow=false ; boolean
1208-
AttackMove.Follow.IncludeAir=false ; boolean
1207+
[SOMETECHNO] ; TechnoType
1208+
AttackMove.Follow=false ; boolean
1209+
AttackMove.Follow.IncludeAir=false ; boolean
1210+
AttackMove.Follow.IfMindControlIsFull=false ;boolean
12091211
```
12101212

12111213
### Attack move - without weapon

src/Ext/Techno/Hooks.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include <AircraftClass.h>
2-
#include "Body.h"
1+
#include "Body.h"
32

43
#include <AircraftClass.h>
54
#include <EventClass.h>
@@ -1102,7 +1101,7 @@ DEFINE_HOOK(0x4DF3A6, FootClass_UpdateAttackMove_Follow, 0x6)
11021101

11031102
auto const pTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData;
11041103

1105-
if (pTypeExt->AttackMove_Follow)
1104+
if (pTypeExt->AttackMove_Follow || pTypeExt->AttackMove_Follow_IfMindControlIsFull && pThis->CaptureManager && pThis->CaptureManager->CannotControlAnyMore())
11061105
{
11071106
auto const& pTechnoVectors = Helpers::Alex::getCellSpreadItems(pThis->GetCoords(),
11081107
pThis->GetGuardRange(2) / Unsorted::LeptonsPerCell, pTypeExt->AttackMove_Follow_IncludeAir);

src/Ext/TechnoType/Body.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
895895

896896
this->AttackMove_Follow.Read(exINI, pSection, "AttackMove.Follow");
897897
this->AttackMove_Follow_IncludeAir.Read(exINI, pSection, "AttackMove.Follow.IncludeAir");
898+
this->AttackMove_Follow_IfMindControlIsFull.Read(exINI, pSection, "AttackMove.Follow.IfMindControlIsFull");
898899
this->AttackMove_StopWhenTargetAcquired.Read(exINI, pSection, "AttackMove.StopWhenTargetAcquired");
899900
this->AttackMove_PursuitTarget.Read(exINI, pSection, "AttackMove.PursuitTarget");
900901

@@ -1504,6 +1505,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
15041505

15051506
.Process(this->AttackMove_Follow)
15061507
.Process(this->AttackMove_Follow_IncludeAir)
1508+
.Process(this->AttackMove_Follow_IfMindControlIsFull)
15071509
.Process(this->AttackMove_StopWhenTargetAcquired)
15081510
.Process(this->AttackMove_PursuitTarget)
15091511

src/Ext/TechnoType/Body.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ class TechnoTypeExt
394394

395395
Valueable<bool> AttackMove_Follow;
396396
Valueable<bool> AttackMove_Follow_IncludeAir;
397+
Valueable<bool> AttackMove_Follow_IfMindControlIsFull;
397398
Nullable<bool> AttackMove_StopWhenTargetAcquired;
398399
Valueable<bool> AttackMove_PursuitTarget;
399400

@@ -746,6 +747,7 @@ class TechnoTypeExt
746747

747748
, AttackMove_Follow { false }
748749
, AttackMove_Follow_IncludeAir { false }
750+
, AttackMove_Follow_IfMindControlIsFull { false }
749751
, AttackMove_StopWhenTargetAcquired { }
750752
, AttackMove_PursuitTarget { false }
751753

0 commit comments

Comments
 (0)