Vastly improve Protect objective targeting
What Does This PR Do
Should fix https://github.com/ParadiseSS13/Paradise/issues/30993
Changes how the Protect objective chooses targets.
Protect, when assigned, looks for someone in danger (defined as someone targeted by assassinate or assassinateonce) immediately. If it finds someone, it assigns them as the target and notifies the other objective's owner a minute later.
If it can't find anyone that meets those criteria, it sets a timer randomly from 5-10 minutes. Intent of this is to somewhat mitigate meta-ing whether or not your target is actually someone that's in danger or not.
Before that timer is up, if an assassinate or assassinateonce is assigned, that objective will iterate through all Protect objectives and link up with the first available one, notifying the Protect objective's owner a minute later.
If the Protect objective's timer elapses without this happening, it will:
- Make one more effort to iterate though all assassinate and assassinateonce.
- Choose a fallback target who is not necessarily in danger.
There are safeguards added to ensure that you cannot be forced to Protect someone you're supposed to kill, you cannot kill someone you're supposed to Protect, there is a defense against debraining someone you are supposed to Protect even though debrain does not have eligibility for a target being considered "in danger", etc, etc, etc.
Why It's Good For The Game
Protect objective sucks right now, this fixes that
Testing
Assign Protect first, wait for timer to elapse, get assigned a random target. Assign Protect first, then assassinate, then ensure everyone's notified properly. Assign assassinate first, then Protect, then ensure everyone's notified properly.
Lots and lots of rolling targets to try and catch weird edge cases.
Declaration
- [x] I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.
Changelog
:cl: fix: Protect objective targeting works better /:cl:
This pull request seems to be stale as there have been no changes in 14 days, please make changes within 7 days or the PR will be closed. If you believe this is a mistake, please inform a development team member on Discord.
Shut the heck up!!