Paradise
Paradise copied to clipboard
Yet Another Surgery Refactor
What Does This PR Do
TL;DR Refactors surgery and surgery steps. Adds support for branching surgeries. IMS still works as usual. Also fixes some longtime surgery issues.
Some notable changes:
-
Some surgeries now support branching steps. At certain points, you may be able to use a different tool to quickly perform a little mini-operation in the middle of an existing operation.
- As of this PR, any surgery that implements the common first three steps (scalpel -> hemo -> retractor) will allow for quick bone repair and/or treatment of IB immediately after.
- Robotic surgeries also now support fixing body parts with welder/wire after the panel is crowbarred open.
- The surgery computer will inform you of the possible steps that you can take when a surgery branches.
- If an IMS is used in a branching step and has multiple possible resultant steps, it will continue the main surgery.
- The door is open for more improvements like this!
- Some surgeries are now repeatable.
- The hemostat step of implant checks is now repeatable, so you don't need to redo the whole surgery every time. Just use the hemostat again.
- Cybernetic repair will now repeat automatically until all damage of a certain type is healed.
- In some cases, failed surgery steps can be retried until they succeed.
- If you've got an IMS, you'll automatically retry all failed surgery steps done with the tool.
- If you're an abductor, the same applies regardless of tool.
- The ability for a tool to start a surgery has been moved to a component.
- Surgery speeds have been tweaked a bit based on some behavior from /tg/.
- Surgeries with un-optimal tools will be slower than the ideal ones.
- Borgs are immune to surgery slowdowns, but not surgery success rates.
- Surgeries now make use of tool behaviors instead of just tools
- This means that something that works like a welder might be able to work as a ghetto-cautery
- This likely won't have any impact yet, but again opens the door down the line
- Limb reattachment is now a tiny bit different
- You can use a missing limb on someone to try and attach it, though it won't be good for much.
- You'll need the final attaching surgery step, otherwise it'll just dangle uselessly.
- If you've got such a limb, you'll have some flavor text showing it.
- Using some improvements from #13015 that didn't make it into the game (Shoutouts to @farie82)
- Plastic surgery now uses the standard three starting steps
- You can now use mitocholide during organ manipulation to heal dead organs.
- If you don't have enough chems to heal an organ, it won't use the chemicals so as to not waste them.
- The debridement mito step now in addition to reviving the limb also set the germ level to 0. This should keep the limb alive for a bit longer.
- Surgeries now have support for chems being required for certain steps to work. This isn't implemented yet, but could be added in the future.
Some things might have also been added in with this that I'm forgetting, but those should be the major things.
Why It's Good For The Game
Code-wise, it's nice to have things cleaned up a little bit. Bringing us closer in parity with /tg/ code should also make it easier down the line to implement advanced surgeries and wounds. I think that making branch points simple surgery steps should help to still keep us in line with /tg/ while providing much-needed flexibility in surgeries.
As for the game itself, non-linear surgeries have also been pretty highly requested for a good while, and this provides some much-desired changes (IB/bone repair during other surgeries) while also leaving the door open for more options. It also bundles some slight fixes along the way, so it should be a net positive for the surgical experience.
Images of changes
Changelog
:cl: Lewc, Farie82 add: Internal bleeding and bone-mending can now be performed mid-operation (after retractor) for most surgeries. add: Synthetic body-part repair can now be performed mid-operation as well. tweak: Plastic Surgery now uses the standard scalpel-hemo-retractor flow. tweak: If you have an IMS, you will auto-retry any failed surgery steps done with it. tweak: Abductors will auto-retry failed surgery steps. tweak: Repairing organs with wire/welder during Cybernetic Surgery will automatically repeat applying the tool until it runs out or the damage is healed. tweak: Implant check surgeries will now auto-retry the hemo step until something is found (or you give up). tweak: Mito can be used during organ manipulation to repair dead organs. tweak: The clean surgery step won't use any chemicals if it wouldn't actually treat the patient. tweak: You can use a power drill as a ghetto tool for the drill bone surgery step with 80% efficiency. tweak: You now no longer need to cut through bones when doing cavity implant surgery on slime people. tweak: Robotic surgeries can be cancelled with a screwdriver and crowbar. tweak: Limb reattachment can be started with just a limb, though the limb will be useless unless you finish the hemostat step. tweak: Implant removal surgery now has a 20% chance to find nothing.
/:cl:
So, funnily enough, implant check surgeries sometimes failing silently seems to have probably been unintentional. There wasn't a fail_step
for it, so if the surgery failed due to a lack of anesthetic (something I doubt many brig physicians would have used much back when implant checks happened on every perma prisoner) it wouldn't give any sort of feedback.
There's never been any sort of probability involved.
That being said.
It seems like a feature, not a bug, where you can possibly miss a traitor's implant. Unless people have strong feelings otherwise, I'm going to add some probability to it, so if you get really really unlucky, you might just not find the implant.
was messin around on mentorstation and noticed this was TM onto it already so wanted to try it out. Didn't really explore it too much but organ manipulation on the lower body seems to buggy a bit, no fractures or IB there but when it gets to the point of actually performing organ manipulation, its stuck on the three options of IB, Bone or Organ Manipulation however after going through every single tool, none of them actually progress the surgery step saying "This step requires a different tool!", making it unable to revive any of the organs via the dropper this way or remove the organs to do so afaik. Both Head and Upper Body work fine in this however.
while this one is likely on purpose but im not sure, when you finish the main surgery procedure, such as mend bones, then it closes off the options for treating IB and im assuming vice versa, leading instantly to cautery.
Edit: Learned that if you do IB and finish the main step there, it actually doesn't lock off the option and let you mend bone still.
Thanks for testing it out!
The lower body issue is known and should be fixed as of https://github.com/ParadiseSS13/Paradise/pull/18325/commits/291e3c4cba29db667b1027cee674b48ed5341184, I just haven't gotten the testmerge bumped on the test server.
As for closing off surgery options, if I'm reading you correctly, that's intentional. The mend bone/IB surgery steps are only present at certain parts of the surgery, and moving forward with the main step will push you past the points where they're options.
The only issue I have with this currently is that it will admin log to admin's chat no matter what they have the attack logs level set to. I don't believe operation being started is that much of an important log, especially operations such as internal bleeding or bone fixing. The level at which these logs should be sent is if the admin has the attack logs set to almost all or all in my opinion.
During the test merge playing as a medical doctor, i tried to do organ manipulation surgery on a vulp to fix their eyes as we were almost out of oculine. When i reached the surgery step of actually fixing their eyes it kept failing, even though they were fully sedated and on an operating table, when i tried to continue the surgery step to close the incision it would tell me that i was using the wrong tool. Checked the surgery computer which told me to mend the organs which didn't work.
I'll work on getting those bugs fixed up. I'll list out other things that don't get commented here that I want to take a look at:
- Nanopaste in organ manip for fixing robotic organs
- A ton of runtimes being spat out from organ re-attachment
Got a report that a player initiated a limb reattachment surgery on an IRC and was unable to attach the limb or cancel the surgery. They started the surgery with tools before attempting to attach the limb, which I think might no longer work as the reattachment is now intended to be started with the limb itself.
Pasting it here what I wrote on Discord, so it is not lost:
Attaching a robotic arm on an IRC, can be done with a scalpel (which is weird), then it works, but if you do it with a hand drill, it fails:
- spawn a
/obj/machinery/optable
- spawn a
/mob/living/carbon/human/machine/created
- put the torso onto the optable
- spawn a
/obj/item/robot_parts/r_arm
- spawn a
/obj/item/screwdriver/power
- pick up hand drill, use on body, select synthetic limb reattachment
- try to attach robotic arm
- get message of another surgery being in progress
Switch step 6 for a scalpel and it works properly, though scalpels should not start surgery on robots I guess.
Also, there is no way neither in-game nor for admins to stop a surgical step or I could not find it (limb reattachment, that is) - spent a good ten minutes staring at VV and the code and I could not neither remove something to stop it nor call a proc on it that would instantly stop surgery and remove all components reliably (but that might be simply because I'm retarded)
The limb attachment issues should be fixed, thank you so much for the detailed repro! Helped a lot in nailing down the issue.
I think that all of the reported issues should be fixed, as well as the one that spat out all of those nasty runtimes.
I've also combined both robotic limb surgery steps into one main operation, so it's hopefully less confusing when you're attaching robolimbs.
Got a few different notes about robotic surgeries being borked. I'll take a look at that when I get the chance.