Added a Damage class to pass damage value and damage(types) instead.
This removes a great amount of overhead and longterm opens possibilities to have damagetypes without warheads.
Originally, this was comparing distance beween pos and unit.CenterPosition with HitShape's OuterRadius. However, the OuterRadius can exceed the shape for Capsule and Rectangular shapes, so I tried to adress that a few months ago by using the DistanceFromEdge check instead. The approach was bogus, though. DistanceFromEdge just calculates the distance of a position to the edge, so by comparing it with the distance between pos and victim.CenterPosition in combination with using LengthSquared, it was entirely possible the explosion would be within the HitShape, but closer to the edge than the victim.CenterPosition and the check would return false.
Now we just check if DistanceFromEdge is 0 or negative, which means the impact is inside the HitShape.
This can be used to avoid several lookups for these traits, as well as allow Actor to provide specialised methods to deal with target types efficiently. This also reduces some code duplication.
There aren't any actors in any shipping mod where a health radius larger
than 1c512 would be feasible, so no need to make the default larger than necessary.
- reduces situations where infantry goes prone even though the impact was rather far away and damage absolutely negligible
- saves a little bit of performance by reducing the total area of effect, resulting in lower average number of calls to Health.InflictDamage at a given Spread value
This makes the UpgradeManager support requests to grant a timed
upgrade multiple times from a single source.
GrantUpgradeWarhead modified to take advantage of this.
Enabled firing multiple armaments at a target simultaneously.
Each armament defines own cursor for targeting.
The force attack modifier influences armament choice for target.
Autotargeting modified to handle firing multiple armaments simultaneously.
As a consequence, healers (medics) no longer require separate Heal
activity and AttackMedic and AutoHeal traits.
Allows to customize the victim scan radius. Necessary to ensure that actors where health radius is close enough, but CenterPosition isn't, properly receive damage.