Gives Surgical Drapes a Use (#25686)

* Gives drapes some utility for starting surgeries

* Adds a nice helping of drapes throughout the codebase

* add icon, realize I didn't think that through

* Handles blood with signals

* whoopsie daisy

* range

* how about borgs

* Apply suggestions from code review

Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* burza suggestion

* more dgamer reviews

* Oops

* Update code/modules/surgery/surgery.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Matt <116982774+Burzah@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
Luc
2024-07-01 12:01:17 -07:00
committed by GitHub
parent 87e6460c58
commit 77253c5ae7
13 changed files with 157 additions and 23 deletions
+5
View File
@@ -9,6 +9,11 @@
"Kidan" = 'icons/mob/clothing/species/kidan/under/suit.dmi'
)
/obj/item/clothing/under/suit/Initialize(mapload)
. = ..()
// better than nothing! ghetto surgery time
AddComponent(/datum/component/surgery_initiator/cloth, null, 0.1)
/obj/item/clothing/under/suit/black
name = "black suit"
desc = "A black suit and red tie. Very formal."
@@ -355,7 +355,8 @@
/obj/item/stack/medical/ointment/advanced/cyborg,
/obj/item/stack/medical/splint/cyborg,
/obj/item/stack/nanopaste/cyborg,
/obj/item/gripper/medical
/obj/item/gripper/medical,
/obj/item/surgical_drapes,
)
malf_modules = list(/obj/item/gun/syringemalf)
special_rechargables = list(
@@ -154,7 +154,8 @@
/obj/item/bonegel,
/obj/item/retractor,
/obj/item/bonesetter,
/obj/item/circular_saw)
/obj/item/circular_saw,
/obj/item/surgical_drapes)
cost = 400
containertype = /obj/structure/closet/crate/secure
containername = "surgery crate"
+8 -8
View File
@@ -28,8 +28,8 @@
/datum/surgery_step/generic/cut_open/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"[user] starts the incision on [target]'s [affected.name] with \the [tool].",
"You start the incision on [target]'s [affected.name] with \the [tool].",
"[user] starts the incision on [target]'s [affected.name] with [tool].",
"You start the incision on [target]'s [affected.name] with [tool].",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!")
@@ -38,8 +38,8 @@
/datum/surgery_step/generic/cut_open/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='notice'> [user] has made an incision on [target]'s [affected.name] with \the [tool].</span>",
"<span class='notice'> You have made an incision on [target]'s [affected.name] with \the [tool].</span>",
"<span class='notice'>[user] has made an incision on [target]'s [affected.name] with [tool].</span>",
"<span class='notice'>You have made an incision on [target]'s [affected.name] with [tool].</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.open = ORGAN_ORGANIC_OPEN
@@ -49,8 +49,8 @@
/datum/surgery_step/generic/cut_open/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'> [user]'s hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>",
"<span class='warning'> Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!</span>",
"<span class='warning'>[user]'s hand slips, slicing open [target]'s [affected.name] in a wrong spot with [tool]!</span>",
"<span class='warning'>Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(10)
@@ -93,8 +93,8 @@
/datum/surgery_step/generic/clamp_bleeders/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message(
"<span class='warning'> [user]'s hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'> Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'>[user]'s hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
"<span class='warning'>Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!</span>",
chat_message_type = MESSAGE_TYPE_COMBAT
)
affected.receive_damage(10)
+13 -5
View File
@@ -44,7 +44,10 @@
var/abstract = FALSE
/// Whether this surgery should be cancelled when an organ change happens. (removed if requires bodypart, or added if doesn't require bodypart)
var/cancel_on_organ_change = TRUE
/// Whether the surgery was started with drapes.
var/started_with_drapes = FALSE
/// How likely it should be for the surgery to cause infection: 0-1
var/germ_prevention_quality = 0
/datum/surgery/New(atom/surgery_target, surgery_location, surgery_bodypart)
..()
@@ -440,16 +443,21 @@
SHOULD_CALL_PARENT(TRUE)
if(ishuman(target))
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(can_infect && affected)
if(can_infect && affected && !prob(surgery.germ_prevention_quality))
spread_germs_to_organ(affected, user, tool)
if(ishuman(user) && !isalien(target) && prob(60))
var/mob/living/carbon/human/H = user
var/blood_spread = SEND_SIGNAL(surgery, COMSIG_SURGERY_BLOOD_SPLASH, user, target, target_zone, tool)
if(blood_spread == COMPONENT_BLOOD_SPLASH_HANDLED)
return
switch(blood_level)
if(SURGERY_BLOODSPREAD_HANDS)
target.visible_message("<span class='notice'>Blood splashes onto [user]'s hands.</span>")
H.make_bloody_hands(target.get_blood_dna_list(), target.get_blood_color())
if(SURGERY_BLOODSPREAD_FULLBODY)
target.visible_message("<span class='notice'>A spray of blood coats [user].</span>")
H.bloody_body(target)
return
/**
* Finish a surgery step, performing anything that runs on the tail-end of a successful surgery.
@@ -484,7 +492,7 @@
* * user - The user who's manipulating the organ.
* * tool - The tool the user is using to mess with the organ.
*/
/proc/spread_germs_to_organ(obj/item/organ/target_organ, mob/living/carbon/human/user, obj/item/tool)
/datum/surgery_step/proc/spread_germs_to_organ(obj/item/organ/target_organ, mob/living/carbon/human/user, obj/item/tool, datum/surgery/surgery)
if(!istype(user) || !istype(target_organ) || target_organ.is_robotic() || target_organ.sterile)
return
@@ -502,7 +510,7 @@
* * E - An external organ being operated on.
* * tool - The tool performing the operation.
*/
/proc/spread_germs_by_incision(obj/item/organ/external/E, obj/item/tool)
/datum/surgery_step/proc/spread_germs_by_incision(obj/item/organ/external/E, obj/item/tool, datum/surgery/surgery)
if(!is_external_organ(E))
return
if(!E.owner)
+16 -1
View File
@@ -274,9 +274,24 @@
/obj/item/surgical_drapes
name = "surgical drapes"
desc = "Apearature brand surgical drapes providing privacy and infection control."
desc = "Apearature brand surgical drapes providing privacy and infection control. Built from durathread."
icon = 'icons/obj/surgery.dmi'
icon_state = "surgical_drapes"
w_class = WEIGHT_CLASS_SMALL
origin_tech = "biotech=1"
attack_verb = list("slapped")
/// How effective this is at preventing infections during surgeries.
var/surgery_effectiveness = 0.9
/obj/item/surgical_drapes/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SURGICAL, ROUNDSTART_TRAIT)
AddComponent(/datum/component/surgery_initiator/cloth, null, surgery_effectiveness)
/obj/item/surgical_drapes/improvised
name = "improvised drapes"
desc = "Hastily-sliced fabric that seems like it'd be useful for surgery. Probably better than the shirt off your back."
icon = 'icons/obj/stacks/miscellaneous.dmi'
icon_state = "empty-sandbags"
origin_tech = null
surgery_effectiveness = 0.67