Fixes Autoinjectors and Some Hyposprays Working on Robotic/Missing Limbs, Minor Refactor of can_inject()
and Related Variables
#27118
+33
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Does This PR Do
Hyposprays (and by extension autoinjectors) no longer ignore
can_inject()
if they are piercing hyposprays, andcan_inject()
now checks for robotic/missing limbs before anything else. This prevents hyposprays and autoinjectors from injecting robotic and missing limbs.Hyposprays now check for targeted body zones like other handheld injectors do.
Several injection items have had their local variables name changed so they obviously are referring to the ability to defeat thick clothing.
The unused
piercing
variable has been renamedpenetrate_everything
so it's immediately obvious that it will always returnTRUE
if the missing/robotics limb checks succeed. Autoinjectors and piercing hyposprays (CMO/emagged/Syndicate/Deathsquad) have been given this characteristic due to it being how they currently behave on live, but it's now very easy to change the behaviour for individual hyposprays and injectors.Why It's Good For The Game
You're not supposed to be able to inject into robotic/missing body parts.
There is now more granular control over the piercing behaviours of hyposprays and autoinjectors.
There is now a single variable that can be tweaked for tems doing an injection check if we want them to be able to bypass all injection protection without fuss.
Testing
Spawned a bunch of syringes, a dart gun, an RSG, hypospray, CMO hypospray, DS hypospray, and some autoinjectors.
Used them on test skrell with various protections (or lack thereof) to check that nothing got broken.
Everything worked good.
Declaration
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
🆑
fix: Hyposprays and autoinjectors no longer inject into missing or robotic limbs.
/:cl: