Capturing now behaves as in C&C3:KW - wait for 8 seconds
outside the structure before running inside and being disposed.
A "Reusable Engineer" lobby option is provided to restore
the previous non-disposing behaviour.
CaptureDelay is defined per-trait, and the shortest
delay will be used if multiple traits are enabled.
CapturingCondition and BeingCapturedCondition are
global, and are granted when any capture is in progress.
The capture period is defined from when the unit reaches
the cell next to the target, and either starts to wait
or enter the target through to when the capture succeeds
or fails.
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.
The index values are round numbers. Checking agaist
the half-values improves robustness against small
floating point delta errors that occur on some GPUs.
Should save a trait look-up for each path search. Also ditch bogus null checks (this trait is a must-have anyway, so we *want* to crash if it's missing).
During heated battles, those TraitsImplementing look-ups in Health might cause bursty CPU load on warhead impacts. Caching the notify traits of the actor + owner can reduce the trait look-ups per impact by more than half.
While avoiding divisions.
While there haven't been any desyncs to speak of recently (not in this part of the code, in any case), this still looks like an oversight from when we migrated away from using floats.
This also makes it easier to expose the thresholds to modders later.