Closed lL1l1 closed 4 months ago
The main change is the salvo retargeting feature. An issue that was being solved before this PR is that salvos can be restarted from shot 0 if you cancel the firing through OnLostTarget in the middle of the FiringState. Timeline:
ReadyState.OnFire -> FiringState.OnLostTarget
immediately (halt fire is ordered immediately) so the firing state doesn't get time to shoot.ResetTarget
which calls OnLostTarget
which changes the weapon state to idle/packing, unlike the vanilla behavior. That state change can happen constantly if the weapon has a target in tracking radius but not firing range, which I suppose can lead to unexpected animation or FX.The retargeting feature does solve being able to restart salvos while still shooting on the last shot of AttackGroundTries. It also allows cool retargeting in the middle of a salvo with different orders, so you can't lose an entire salvo to a misclick (for example scathis). The only remaining issue is that weapons do not call OnLostTarget when they retarget due to target priorities or the target dying. This causes a ravager to not stop firing when it switches from a striker tank to another striker tank (because the old one died) or to an Othuum (because the othuum has higher priority). I think it's a pretty minor issue though.
I'm going to have to split the various changes in this PR.
Description of the proposed changes
Fixes the ability of
AttackGroundTries
for bombers and fixes an off by one issue for other units. Annotates the field. As a bonus, fixes lightning storm spawned from Ythotha too (cheat menu spawn and Ythotha spawn act differently).Testing done on the proposed changes
Checklist