Currently, the attack bonuses (known as rps hard bonuses) are only taken into account for the main target. It will be the false one if the hitten entity is not the main targeted entity. Worse, there is such a bonus schema for the splash schema which will not be used at all.
In fact, it seems that we should parse those data in the Damage component.
- basically, split the GetAttackBonus function in two parts:
- parse the bonus template to the damage component (for ranged attack) and compute the actual 'bonus' for the damaged entities.
- add an helper function (we could put it in the damage component, but it has to be called straightly for Melee and Capture in the Attack component)
- update and fix (!) some previous tests, add tests about those new things, add a 'complete' test of the MissileHit function
- remove an useless UnitAI function
- remove a comment in the AI code which would not be exactly accurate after the patch