Files
Bubberstation/code/modules/surgery/tools.dm
Ryll Ryll 0f6496a55c [READY] Adds Medical Wounds: Bamboo Bones and the Skin of Your Teeth (#50558)
About The Pull Request

This PR adds medical wounds, new forms of injuries that people can suffer that cause debilitation and complications, and often require more than what can be found in a medkit to treat. But let's be honest, big complicated walls of text about medical changes make people's eyes glaze over easily- so I created a handy infograph to explain the basics!

Also there's a full guide here!

dreamseeker_2020-04-18_20-42-19.png

The infograph may not be fully up to date with the specifics of the PR's status, but it'll be updated along with major changes so people have something to use as a crash course for familiarizing themselves with how wounds function. I also have another infograph with all 9 of the possible initial wounds coming, and will be up soon. You can also find the longform design doc here with more info on the broad details, including descriptions of treatments: hackmd whee
What this does

There's a lot to cover, but here's the bullet points of the main features and changes:

    Getting lots of damage on a limb can result in wounds, with more damage causing worse wounds. These can range from dislocated joints and minor cuts to compound fractures and fourth degree burns, and can affect you in different ways depending on what bodypart they're applied to (namely with broken bones).
    You can damage individual bodyparts on clothing (only jumpsuits for now) through the use of lasers and sharp weapons. Bodyparts that reach max damage are considered "shredded" and will not apply any protection for that zone until it is repaired with cloth. If all zones are disabled, the entire piece of clothing is shredded and unwearable until repaired with 3 cloth. Jumpsuits give a small amount of wound protection, and since sharp weapons and lasers generally get extra wound bonuses against bare flesh, even a plain jumpsuit provides decent protection from a few laser shots or scalpel stabs.
    Lasers gain a powerful niche versus unarmored/lightly armored carbons! As noted above, lasers can shred clothing and burn away zones of jumpsuits in 2 shots each, after which the target's bare flesh is exposed (barring other clothing), and lasers excel at dealing burn wounds against uncovered skin. Think big, nasty charring!
    Bleeding is now totally limb based, and gauze is as well. Bleeding is also 95% cut wound based, meaning sharp weapons make you bleed rather than just having 40+ brute on a limb.
    The more wounds and damage you get on a bodypart, the easier it'll be to gain more severe wounds. Wounds are arranged from Moderate, to Severe, to Critical in increasing severity, and you'll generally have to suffer the lesser ones before getting the worse ones.

dreamseeker_2020-05-15_03-15-59.png
Above: Someone having an incredibly bad day from bloodloss

dreamseeker_2020-05-04_22-29-29.png
Above: Scars from healed wounds

ShareX_2020-05-15_06-55-20.png
Above: Actual combat involving someone's head getting cracked

Here's a quick, if non-exhaustive, list of things I have left to do before I consider it feature complete

Finish adding treatments for each wound type/severity (mostly surgeries/triage for critical wounds)
Add second winds for bad injuries to give the victim a chance to get away
Flesh out severe & critical injuries in general
Find sprites for the bonesetter, bone gel, and anything else that might be needed
Add the medical items for treating the less severe wounds to the station
Polish code and remove any redundancies I left behind

    Quick balance pass to make sure nothing is horribly abuseable

Why It's Good For The Game

Adds a flexible new system for representing damage on carbons with injuries that can be treated in different ways. Moderate wounds from getting toolboxed or sliced with a scalpel can usually be treated by a buddy or even by yourself with the right tools, but getting flayed with a fireaxe or a laser gun emptied into your bare skin may require extra attention or even surgery in bad cases! Also makes laser guns cooler and more like 40k lasguns that can flash fry people (cool!)

This should also make spessmen more resilient and harder to kill outright, while still adding consequences and complications to getting hurt. Wounds aren't immediately fatal, but they can do things like slow down interactions, deal damage over time through infections, and generally make you more fragile until fixed. They can also give you a "second wind" on being applied that gives you a small adrenaline boost (or whatever) to help disengage and escape immediate danger.
Changelog

🆑 Ryll/Shaps
add: Introduces medical wounds, new injuries that can happen to fleshy carbons when they sustain lots of damage on a bodypart. There's quite a lot of change here, but you can read the guide at: https://tgstation13.org/wiki/Guide_to_wounds and an extended changelog is available here: https://hackmd.io/l_FI9b3tSqa_woDadewJXA
add: Introduces scars and temporal scarring! Healing a wound leaves a scar behind that can be seen by examining someone twice rapidly, and if Temporal Scarring is enabled in character prefs, surviving a round with scars will save them to be granted at roundstart another round! Let your body tell stories!
tweak: Bleeding is now fully bodypart-focused, and 95% of bleeding comes from cut wounds from sharp weapons. Gauze is applied on a limb-by-limb basis, and helps staunch bloodflow rather than totally stop it. Notably, you no longer bleed just from having 40+ brute damage on a limb.
del: Organic bodyparts are no longer disabled at maximum damage, but are easier to cause wounds to
add: O2 medkits in emergency lockers have been replaced with new emergency medkits with basic tools for diagnosing and treating wounds and basic damage
tweak: Herapin now rapidly increases bleeding on all open cuts, rather than causing bleeding by itself. The more cuts on the target, the more it will affect them.
tweak: Neckgrab table slams now hit the targeted limb rather than just the head, with a large chance to dislocate or break a bone
tweak: Sharp weapons and burning weapons can now shred zones on jumpsuits, disabling protection on that limb. Damaged clothes can be repaired with cloth.
tweak: Slaughter demons now deal less raw damage, but gain the ability to cause cut wounds, which becomes more powerful with each attack on a humanoid but resets when bloodcrawling.
/🆑
2020-06-12 23:47:33 +12:00

420 lines
15 KiB
Plaintext

/obj/item/retractor
name = "retractor"
desc = "Retracts stuff."
icon = 'icons/obj/surgery.dmi'
icon_state = "retractor"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
inhand_icon_state = "clamps"
custom_materials = list(/datum/material/iron=6000, /datum/material/glass=3000)
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
w_class = WEIGHT_CLASS_TINY
tool_behaviour = TOOL_RETRACTOR
toolspeed = 1
/obj/item/retractor/augment
desc = "Micro-mechanical manipulator for retracting stuff."
toolspeed = 0.5
/obj/item/hemostat
name = "hemostat"
desc = "You think you have seen this before."
icon = 'icons/obj/surgery.dmi'
icon_state = "hemostat"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
inhand_icon_state = "clamps"
custom_materials = list(/datum/material/iron=5000, /datum/material/glass=2500)
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
w_class = WEIGHT_CLASS_TINY
attack_verb = list("attacked", "pinched")
tool_behaviour = TOOL_HEMOSTAT
toolspeed = 1
/obj/item/hemostat/augment
desc = "Tiny servos power a pair of pincers to stop bleeding."
toolspeed = 0.5
/obj/item/cautery
name = "cautery"
desc = "This stops bleeding."
icon = 'icons/obj/surgery.dmi'
icon_state = "cautery"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
inhand_icon_state = "cautery"
custom_materials = list(/datum/material/iron=2500, /datum/material/glass=750)
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
w_class = WEIGHT_CLASS_TINY
attack_verb = list("burnt")
tool_behaviour = TOOL_CAUTERY
toolspeed = 1
/obj/item/cautery/augment
desc = "A heated element that cauterizes wounds."
toolspeed = 0.5
/obj/item/surgicaldrill
name = "surgical drill"
desc = "You can drill using this item. You dig?"
icon = 'icons/obj/surgery.dmi'
icon_state = "drill"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
hitsound = 'sound/weapons/circsawhit.ogg'
custom_materials = list(/datum/material/iron=10000, /datum/material/glass=6000)
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL | EYE_STAB
force = 15
w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("drilled")
tool_behaviour = TOOL_DRILL
toolspeed = 1
/obj/item/surgicaldrill/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] rams [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to commit suicide!</span>")
addtimer(CALLBACK(user, /mob/living/carbon.proc/gib, null, null, TRUE, TRUE), 25)
user.SpinAnimation(3, 10)
playsound(user, 'sound/machines/juicer.ogg', 20, TRUE)
return (MANUAL_SUICIDE)
/obj/item/surgicaldrill/augment
desc = "Effectively a small power drill contained within your arm, edges dulled to prevent tissue damage. May or may not pierce the heavens."
hitsound = 'sound/weapons/circsawhit.ogg'
force = 10
w_class = WEIGHT_CLASS_SMALL
toolspeed = 0.5
/obj/item/scalpel
name = "scalpel"
desc = "Cut, cut, and once more cut."
icon = 'icons/obj/surgery.dmi'
icon_state = "scalpel"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
inhand_icon_state = "scalpel"
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL | EYE_STAB
force = 10
w_class = WEIGHT_CLASS_TINY
throwforce = 5
throw_speed = 3
throw_range = 5
custom_materials = list(/datum/material/iron=4000, /datum/material/glass=1000)
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = IS_SHARP_ACCURATE
tool_behaviour = TOOL_SCALPEL
toolspeed = 1
bare_wound_bonus = 20
/obj/item/scalpel/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 80 * toolspeed, 100, 0)
/obj/item/scalpel/augment
desc = "Ultra-sharp blade attached directly to your bone for extra-accuracy."
toolspeed = 0.5
/obj/item/scalpel/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat", "stomach")] with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (BRUTELOSS)
/obj/item/circular_saw
name = "circular saw"
desc = "For heavy duty cutting."
icon = 'icons/obj/surgery.dmi'
icon_state = "saw"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
hitsound = 'sound/weapons/circsawhit.ogg'
mob_throw_hit_sound = 'sound/weapons/pierce.ogg'
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
force = 15
w_class = WEIGHT_CLASS_NORMAL
throwforce = 9
throw_speed = 2
throw_range = 5
custom_materials = list(/datum/material/iron=1000)
attack_verb = list("attacked", "slashed", "sawed", "cut")
sharpness = IS_SHARP
tool_behaviour = TOOL_SAW
toolspeed = 1
wound_bonus = 10
bare_wound_bonus = 15
/obj/item/circular_saw/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 40 * toolspeed, 100, 5, 'sound/weapons/circsawhit.ogg') //saws are very accurate and fast at butchering
/obj/item/circular_saw/augment
desc = "A small but very fast spinning saw. Edges dulled to prevent accidental cutting inside of the surgeon."
w_class = WEIGHT_CLASS_SMALL
force = 10
toolspeed = 0.5
/obj/item/surgical_drapes
name = "surgical drapes"
desc = "Nanotrasen brand surgical drapes provide optimal safety and infection control."
icon = 'icons/obj/surgery.dmi'
icon_state = "surgical_drapes"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
inhand_icon_state = "drapes"
w_class = WEIGHT_CLASS_TINY
attack_verb = list("slapped")
/obj/item/surgical_drapes/attack(mob/living/M, mob/user)
if(!attempt_initiate_surgery(src, M, user))
..()
/obj/item/organ_storage //allows medical cyborgs to manipulate organs without hands
name = "organ storage bag"
desc = "A container for holding body parts."
icon = 'icons/obj/storage.dmi'
icon_state = "evidenceobj"
item_flags = SURGICAL_TOOL
/obj/item/organ_storage/afterattack(obj/item/I, mob/user, proximity)
. = ..()
if(!proximity)
return
if(contents.len)
to_chat(user, "<span class='warning'>[src] already has something inside it!</span>")
return
if(!isorgan(I) && !isbodypart(I))
to_chat(user, "<span class='warning'>[src] can only hold body parts!</span>")
return
user.visible_message("<span class='notice'>[user] puts [I] into [src].</span>", "<span class='notice'>You put [I] inside [src].</span>")
icon_state = "evidence"
var/xx = I.pixel_x
var/yy = I.pixel_y
I.pixel_x = 0
I.pixel_y = 0
var/image/img = image("icon"=I, "layer"=FLOAT_LAYER)
img.plane = FLOAT_PLANE
I.pixel_x = xx
I.pixel_y = yy
add_overlay(img)
add_overlay("evidence")
desc = "An organ storage container holding [I]."
I.forceMove(src)
w_class = I.w_class
/obj/item/organ_storage/attack_self(mob/user)
if(contents.len)
var/obj/item/I = contents[1]
user.visible_message("<span class='notice'>[user] dumps [I] from [src].</span>", "<span class='notice'>You dump [I] from [src].</span>")
cut_overlays()
I.forceMove(get_turf(src))
icon_state = "evidenceobj"
desc = "A container for holding body parts."
else
to_chat(user, "<span class='notice'>[src] is empty.</span>")
return
/obj/item/surgical_processor //allows medical cyborgs to scan and initiate advanced surgeries
name = "\improper Surgical Processor"
desc = "A device for scanning and initiating surgeries from a disk or operating computer."
icon = 'icons/obj/device.dmi'
icon_state = "spectrometer"
item_flags = NOBLUDGEON
var/list/advanced_surgeries = list()
/obj/item/surgical_processor/afterattack(obj/item/O, mob/user, proximity)
. = ..()
if(!proximity)
return
if(istype(O, /obj/item/disk/surgery))
to_chat(user, "<span class='notice'>You load the surgery protocol from [O] into [src].</span>")
var/obj/item/disk/surgery/D = O
if(do_after(user, 10, target = O))
advanced_surgeries |= D.surgeries
return TRUE
if(istype(O, /obj/machinery/computer/operating))
to_chat(user, "<span class='notice'>You copy surgery protocols from [O] into [src].</span>")
var/obj/machinery/computer/operating/OC = O
if(do_after(user, 10, target = O))
advanced_surgeries |= OC.advanced_surgeries
return TRUE
return
/obj/item/scalpel/advanced
name = "laser scalpel"
desc = "An advanced scalpel which uses laser technology to cut."
icon = 'icons/obj/surgery.dmi'
icon_state = "scalpel_a"
hitsound = 'sound/weapons/blade1.ogg'
force = 16
toolspeed = 0.7
light_color = LIGHT_COLOR_GREEN
sharpness = IS_SHARP_ACCURATE
/obj/item/scalpel/advanced/Initialize()
. = ..()
set_light(1)
/obj/item/scalpel/advanced/attack_self(mob/user)
playsound(get_turf(user), 'sound/machines/click.ogg', 50, TRUE)
if(tool_behaviour == TOOL_SCALPEL)
tool_behaviour = TOOL_SAW
to_chat(user, "<span class='notice'>You increase the power of [src], now it can cut bones.</span>")
set_light(2)
force += 1 //we don't want to ruin sharpened stuff
icon_state = "saw_a"
else
tool_behaviour = TOOL_SCALPEL
to_chat(user, "<span class='notice'>You lower the power of [src], it can no longer cut bones.</span>")
set_light(1)
force -= 1
icon_state = "scalpel_a"
/obj/item/scalpel/advanced/examine()
. = ..()
. += " It's set to [tool_behaviour == TOOL_SCALPEL ? "scalpel" : "saw"] mode."
/obj/item/retractor/advanced
name = "mechanical pinches"
desc = "An agglomerate of rods and gears."
icon = 'icons/obj/surgery.dmi'
icon_state = "retractor_a"
toolspeed = 0.7
/obj/item/retractor/advanced/attack_self(mob/user)
playsound(get_turf(user), 'sound/items/change_drill.ogg', 50, TRUE)
if(tool_behaviour == TOOL_RETRACTOR)
tool_behaviour = TOOL_HEMOSTAT
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in hemostat mode.</span>")
icon_state = "hemostat_a"
else
tool_behaviour = TOOL_RETRACTOR
to_chat(user, "<span class='notice'>You configure the gears of [src], they are now in retractor mode.</span>")
icon_state = "retractor_a"
/obj/item/retractor/advanced/examine()
. = ..()
. += " It resembles a [tool_behaviour == TOOL_RETRACTOR ? "retractor" : "hemostat"]."
/obj/item/surgicaldrill/advanced
name = "searing tool"
desc = "It projects a high power laser used for medical application."
icon = 'icons/obj/surgery.dmi'
icon_state = "surgicaldrill_a"
hitsound = 'sound/items/welder.ogg'
toolspeed = 0.7
light_color = LIGHT_COLOR_RED
/obj/item/surgicaldrill/advanced/Initialize()
. = ..()
set_light(1)
/obj/item/surgicaldrill/advanced/attack_self(mob/user)
playsound(get_turf(user), 'sound/weapons/tap.ogg', 50, TRUE)
if(tool_behaviour == TOOL_DRILL)
tool_behaviour = TOOL_CAUTERY
to_chat(user, "<span class='notice'>You focus the lenses of [src], it is now in mending mode.</span>")
icon_state = "cautery_a"
else
tool_behaviour = TOOL_DRILL
to_chat(user, "<span class='notice'>You dilate the lenses of [src], it is now in drilling mode.</span>")
icon_state = "surgicaldrill_a"
/obj/item/surgicaldrill/advanced/examine()
. = ..()
. += " It's set to [tool_behaviour == TOOL_DRILL ? "drilling" : "mending"] mode."
/obj/item/shears
name = "amputation shears"
desc = "A type of heavy duty surgical shears used for achieving a clean separation between limb and patient. Keeping the patient still is imperative to be able to secure and align the shears."
icon = 'icons/obj/surgery.dmi'
icon_state = "shears"
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
toolspeed = 1
force = 12
w_class = WEIGHT_CLASS_NORMAL
throwforce = 6
throw_speed = 2
throw_range = 5
custom_materials = list(/datum/material/iron=8000, /datum/material/titanium=6000)
attack_verb = list("sheared", "snipped")
sharpness = IS_SHARP
custom_premium_price = 1800
/obj/item/shears/attack(mob/living/M, mob/user)
if(!iscarbon(M) || user.a_intent != INTENT_HELP)
return ..()
if(user.zone_selected == BODY_ZONE_CHEST)
return ..()
var/mob/living/carbon/patient = M
if(HAS_TRAIT(patient, TRAIT_NODISMEMBER))
to_chat(user, "<span class='warning'>The patient's limbs look too sturdy to amputate.</span>")
return
var/candidate_name
var/obj/item/organ/tail_snip_candidate
var/obj/item/bodypart/limb_snip_candidate
if(user.zone_selected == BODY_ZONE_PRECISE_GROIN)
tail_snip_candidate = patient.getorganslot(ORGAN_SLOT_TAIL)
if(!tail_snip_candidate)
to_chat(user, "<span class='warning'>[patient] does not have a tail.</span>")
return
candidate_name = tail_snip_candidate.name
else
limb_snip_candidate = patient.get_bodypart(check_zone(user.zone_selected))
if(!limb_snip_candidate)
to_chat(user, "<span class='warning'>[patient] is already missing that limb, what more do you want?</span>")
return
candidate_name = limb_snip_candidate.name
var/amputation_speed_mod
patient.visible_message("<span class='danger'>[user] begins to secure [src] around [patient]'s [candidate_name].</span>", "<span class='userdanger'>[user] begins to secure [src] around your [candidate_name]!</span>")
playsound(get_turf(patient), 'sound/items/ratchet.ogg', 20, TRUE)
if(patient.stat == DEAD || patient.stat == UNCONSCIOUS || patient.IsStun()) //Stun is used by paralytics like curare it should not be confused with the more common paralyze.
amputation_speed_mod = 0.5
else if(patient.jitteriness >= 1)
amputation_speed_mod = 1.5
else
amputation_speed_mod = 1
if(do_after(user, toolspeed * 150 * amputation_speed_mod, target = patient))
playsound(get_turf(patient), 'sound/weapons/bladeslice.ogg', 250, TRUE)
if(user.zone_selected == BODY_ZONE_PRECISE_GROIN) //OwO
tail_snip_candidate.Remove(patient)
tail_snip_candidate.forceMove(get_turf(patient))
else
limb_snip_candidate.dismember()
user.visible_message("<span class='danger'>[src] violently slams shut, amputating [patient]'s [candidate_name].</span>", "<span class='notice'>You amputate [patient]'s [candidate_name] with [src].</span>")
/obj/item/bonesetter
name = "bonesetter"
desc = "For setting things right."
icon = 'icons/obj/surgery.dmi'
icon_state = "bone setter"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
custom_materials = list(/datum/material/iron=5000, /datum/material/glass=2500)
flags_1 = CONDUCT_1
item_flags = SURGICAL_TOOL
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("corrected", "properly set")
tool_behaviour = TOOL_BONESET
toolspeed = 1