OpenSRProject / OpenStarRuler-Modpack

OpenSR Modpack - An optional collection of bug fixes and non-gameplay changing improvements
Other
6 stars 3 forks source link

Interdict movement fixes #27

Closed Skeletonxf closed 2 years ago

Skeletonxf commented 2 years ago

This fixes a few bugs in the Ion Cannon's Entangled status effect InterdictMovement, which in vanilla tries to just subtract max acceleration (this is insufficient, as while a ship is interdicted it may gain or lose acceleration due to First buff buildings or Marenium planet upgrades). Instead, the mover component is told to add or subtract a stack of interdiction, and the Mover then handles the interdicting effects. This also improves the UX, your movement commands don't get cancelled while interdicted, and will resume as you ordered them once the effect ends. The duration tooltip for Entangled and Control computer boost statuses has also been ported from CE. This fixes no bugs as such, but fills a gaping UI/UX hole in the case of long duration ion cannon effects, as vanilla doesn't communicate the remaining duration of what could be as many as 1500 seconds to the player who was attacked by the ion cannon. Since I went to the effort of making the solution generic enough to work with any status is applied with a duration, I've added it to the control computer boost status too (this is one just nice to have rather than essential). In order to avoid increasing the bandwidth demand too much, these durations are only synced when a status has a delta anyway and the status type is marked as should be showing the duration to the client. The client calculates forward from the last sync time instead of needing regular syncs. This does impose the slight restriction that we can't really use variable status durations together with this tooltip code, but there aren't any vanilla hooks that do this afaik.