This fixes the various edge cases that occur when multiple
Captures or Capturable traits are defined on an actor and
are toggled using conditions.
The Sabotage threshold field moves from Capturable to
Captures in order to simplify the plumbing. The previous
behaviour ingame can be restored by creating a new
capturable type for each threshold level, each with their
own Captures trait.
- harvManager.Tick should run after FindNewUnits() in case new harvesters have appeared
- moved the FindNewUnits Mcv and ExcludeFromSquads checks to the foreach loop, for better readability and preparation of the idle harvester fix
Otherwise the AI would consider the harvester 'idle' in too many situations.
This way, the AI now only uses its own resource search algorithm if the next resource patch is too far away for the FindResources activity to find it.
* Maintains lists of claims, and only restricts
reservations for friendly units.
* Removes OnNotifyResourceClaimLost; it's not
clear whether that is still useful, and it
prevents future necessary cleanups.
* Moves other code without changing behaviour.
This fixed stale claims from dead units and enemy
claims from preventing otherwise valid harvest
activities.
Returning early in AssignRolesToIdleUnits would skip ticking down the counters that trigger new attack and capture attempts. This means they would be attempted far less often than intended.
While the general idea of AIs building distant secondary bases might be tempting, in reality the AI would way too often send the MCV close to some enemy base, wasting the cash and potentially increased build speed/additional build queue.
Deploying MCVs close to the existing base ensures that the AI will actually have some benefit from building an MCV.
Checking for IsMoving is a flawed approach no matter how you look at it. The MCV might just have temporarily stopped due to an obstacle, or about to be deployed.
Checking for IsIdle instead ensures that the MCV really isn't already in the process of doing something.