Skip to content

Commit

Permalink
Getting surgically cut open while conscious will now give you the "TH…
Browse files Browse the repository at this point in the history
…EY'RE CUTTING ME OPEN!!" surgical mood event. (tgstation#83797)

Implements an unused mood event found in tgstation#83741

🆑 ShizCalev
fix: Getting surgically cut open while conscious will now give you the
"THEY'RE CUTTING ME OPEN!!" surgical mood event.
/🆑
  • Loading branch information
ShizCalev authored Jun 8, 2024
1 parent 7bbe54b commit 9e11a5c
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 28 deletions.
7 changes: 6 additions & 1 deletion code/datums/mood_events/generic_negative_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,16 @@
mood_change *= people_laughing_at_you
return ..()

//These are unused so far but I want to remember them to use them later
/datum/mood_event/surgery
description = "THEY'RE CUTTING ME OPEN!!"
mood_change = -8

/datum/mood_event/surgery/success
timeout = 3 MINUTES

/datum/mood_event/surgery/failure
timeout = 10 MINUTES

/datum/mood_event/bald
description = "I need something to cover my head..."
mood_change = -3
Expand Down
6 changes: 3 additions & 3 deletions code/modules/surgery/advanced/lobotomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
span_notice("[user] begins to perform a lobotomy on [target]'s brain."),
span_notice("[user] begins to perform surgery on [target]'s brain."),
)
display_pain(target, "Your head pounds with unimaginable pain!")
display_pain(target, "Your head pounds with unimaginable pain!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/lobotomize/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
display_results(
Expand All @@ -58,7 +58,7 @@
span_notice("[user] successfully lobotomizes [target]!"),
span_notice("[user] completes the surgery on [target]'s brain."),
)
display_pain(target, "Your head goes totally numb for a moment, the pain is overwhelming!")
display_pain(target, "Your head goes totally numb for a moment, the pain is overwhelming!", mood_event_type = /datum/mood_event/surgery/success)

target.cure_all_traumas(TRAUMA_RESILIENCE_LOBOTOMY)
if(target.mind && target.mind.has_antag_datum(/datum/antagonist/brainwashed))
Expand Down Expand Up @@ -86,7 +86,7 @@
span_notice("[user] successfully lobotomizes [target]!"),
span_notice("[user] completes the surgery on [target]'s brain."),
)
display_pain(target, "The pain in your head only seems to get worse!")
display_pain(target, "The pain in your head only seems to get worse!", mood_event_type = /datum/mood_event/surgery/failure)
target_brain.apply_organ_damage(80)
switch(rand(1,3))
if(1)
Expand Down
8 changes: 6 additions & 2 deletions code/modules/surgery/amputation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
span_notice("[user] begins to sever [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
span_notice("[user] begins to sever [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, "You feel a gruesome pain in your [parse_zone(target_zone)]'s joint!")
display_pain(target, "You feel a gruesome pain in your [parse_zone(target_zone)]'s joint!", mood_event_type = /datum/mood_event/surgery)


/datum/surgery_step/sever_limb/success(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
Expand All @@ -58,7 +58,7 @@
span_notice("[user] severs [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
span_notice("[user] severs [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, "You can no longer feel your severed [target.parse_zone_with_bodypart(target_zone)]!")
display_pain(target, "You can no longer feel your severed [target.parse_zone_with_bodypart(target_zone)]!", mood_event_type = /datum/mood_event/surgery)

if(HAS_MIND_TRAIT(user, TRAIT_MORBID) && ishuman(user))
var/mob/living/carbon/human/morbid_weirdo = user
Expand All @@ -68,3 +68,7 @@
var/obj/item/bodypart/target_limb = surgery.operated_bodypart
target_limb.drop_limb()
return ..()

/datum/surgery_step/sever_limb/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob)
display_pain(target, mood_event_type = /datum/mood_event/surgery/failure)
return ..()
4 changes: 3 additions & 1 deletion code/modules/surgery/burn_dressing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
span_notice("[user] begins to excise infected flesh from [target]'s [target.parse_zone_with_bodypart(user.zone_selected)] with [tool]."),
span_notice("[user] begins to excise infected flesh from [target]'s [target.parse_zone_with_bodypart(user.zone_selected)]."),
)
display_pain(target, "The infection in your [target.parse_zone_with_bodypart(user.zone_selected)] stings like hell! It feels like you're being stabbed!")
display_pain(target, "The infection in your [target.parse_zone_with_bodypart(user.zone_selected)] stings like hell! It feels like you're being stabbed!", mood_event_type = /datum/mood_event/surgery)
else
user.visible_message(span_notice("[user] looks for [target]'s [target.parse_zone_with_bodypart(user.zone_selected)]."), span_notice("You look for [target]'s [target.parse_zone_with_bodypart(user.zone_selected)]..."))

Expand All @@ -98,6 +98,7 @@
span_notice("[user] successfully excises some of the infected flesh from [target]'s [target.parse_zone_with_bodypart(target_zone)] with [tool]!"),
span_notice("[user] successfully excises some of the infected flesh from [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/success)
log_combat(user, target, "excised infected flesh in", addition="COMBAT MODE: [uppertext(user.combat_mode)]")
surgery.operated_bodypart.receive_damage(brute=3, wound_bonus=CANT_WOUND)
burn_wound.infestation -= infestation_removed
Expand All @@ -117,6 +118,7 @@
span_notice("[user] carves away some of the healthy flesh from [target]'s [target.parse_zone_with_bodypart(target_zone)] with [tool]!"),
span_notice("[user] carves away some of the healthy flesh from [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/failure)
surgery.operated_bodypart.receive_damage(brute=rand(4,8), sharpness=TRUE)

/datum/surgery_step/debride/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/surgery/coronary_bypass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
span_notice("[user] begins to make an incision in [target]'s heart."),
span_notice("[user] begins to make an incision in [target]'s heart."),
)
display_pain(target, "You feel a horrendous pain in your heart, it's almost enough to make you pass out!")
display_pain(target, "You feel a horrendous pain in your heart, it's almost enough to make you pass out!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(ishuman(target))
Expand All @@ -53,6 +53,7 @@
span_notice("Blood pools around the incision in [target_human]'s heart."),
span_notice("Blood pools around the incision in [target_human]'s heart."),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/success)
var/obj/item/bodypart/target_bodypart = target_human.get_bodypart(target_zone)
target_bodypart.adjustBleedStacks(10)
target_human.adjustBruteLoss(10)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/surgery/gastrectomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
span_notice("[user] begins to make an incision in [target]."),
span_notice("[user] begins to make an incision in [target]."),
)
display_pain(target, "You feel a horrible stab in your gut!")
display_pain(target, "You feel a horrible stab in your gut!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/gastrectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
var/mob/living/carbon/human/target_human = target
Expand All @@ -57,7 +57,7 @@
span_notice("[user] successfully removes the damaged part of [target]'s stomach."),
span_notice("[user] successfully removes the damaged part of [target]'s stomach."),
)
display_pain(target, "The pain in your gut ebbs and fades somewhat.")
display_pain(target, "The pain in your gut ebbs and fades somewhat.", mood_event_type = /datum/mood_event/surgery/success)
return ..()

/datum/surgery_step/gastrectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery)
Expand All @@ -70,4 +70,4 @@
span_warning("[user] cuts the wrong part of [target]'s stomach!"),
span_warning("[user] cuts the wrong part of [target]'s stomach!"),
)
display_pain(target, "Your stomach throbs with pain; it's not getting any better!")
display_pain(target, "Your stomach throbs with pain; it's not getting any better!", mood_event_type = /datum/mood_event/surgery/failure)
6 changes: 3 additions & 3 deletions code/modules/surgery/hepatectomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
span_notice("[user] begins to make an incision in [target]."),
span_notice("[user] begins to make an incision in [target]."),
)
display_pain(target, "Your abdomen burns in horrific stabbing pain!")
display_pain(target, "Your abdomen burns in horrific stabbing pain!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/hepatectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
var/mob/living/carbon/human/human_target = target
Expand All @@ -56,7 +56,7 @@
span_notice("[user] successfully removes the damaged part of [target]'s liver."),
span_notice("[user] successfully removes the damaged part of [target]'s liver."),
)
display_pain(target, "The pain receeds slightly.")
display_pain(target, "The pain receeds slightly.", mood_event_type = /datum/mood_event/surgery/success)
return ..()

/datum/surgery_step/hepatectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery)
Expand All @@ -69,4 +69,4 @@
span_warning("[user] cuts the wrong part of [target]'s liver!"),
span_warning("[user] cuts the wrong part of [target]'s liver!"),
)
display_pain(target, "You feel a sharp stab inside your abdomen!")
display_pain(target, "You feel a sharp stab inside your abdomen!", mood_event_type = /datum/mood_event/surgery/failure)
8 changes: 6 additions & 2 deletions code/modules/surgery/lipoplasty.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
span_notice("[user] begins to cut away [target]'s excess fat."),
span_notice("[user] begins to cut [target]'s [target_zone] with [tool]."),
)
display_pain(target, "You feel a stabbing in your [target_zone]!")
display_pain(target, "You feel a stabbing in your [target_zone]!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/cut_fat/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results)
display_results(
Expand All @@ -48,9 +48,13 @@
span_notice("[user] cuts [target]'s excess fat loose!"),
span_notice("[user] finishes the cut on [target]'s [target_zone]."),
)
display_pain(target, "The fat in your [target_zone] comes loose, dangling and hurting like hell!")
display_pain(target, "The fat in your [target_zone] comes loose, dangling and hurting like hell!", mood_event_type = /datum/mood_event/surgery/success)
return TRUE

/datum/surgery_step/cut_fat/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob)
display_pain(target, mood_event_type = /datum/mood_event/surgery/failure)
return ..()

//remove fat
/datum/surgery_step/remove_fat
name = "remove loose fat (retractor)"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/surgery/lobectomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
span_notice("[user] begins to make an incision in [target]."),
span_notice("[user] begins to make an incision in [target]."),
)
display_pain(target, "You feel a stabbing pain in your chest!")
display_pain(target, "You feel a stabbing pain in your chest!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/lobectomy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(ishuman(target))
Expand All @@ -54,7 +54,7 @@
span_notice("Successfully removes a piece of [human_target]'s lungs."),
"",
)
display_pain(target, "Your chest hurts like hell, but breathing becomes slightly easier.")
display_pain(target, "Your chest hurts like hell, but breathing becomes slightly easier.", mood_event_type = /datum/mood_event/surgery/success)
return ..()

/datum/surgery_step/lobectomy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
Expand All @@ -67,7 +67,7 @@
span_warning("[user] screws up!"),
span_warning("[user] screws up!"),
)
display_pain(target, "You feel a sharp stab in your chest; the wind is knocked out of you and it hurts to catch your breath!")
display_pain(target, "You feel a sharp stab in your chest; the wind is knocked out of you and it hurts to catch your breath!", mood_event_type = /datum/mood_event/surgery/failure)
human_target.losebreath += 4
human_target.adjustOrganLoss(ORGAN_SLOT_LUNGS, 10)
return FALSE
17 changes: 13 additions & 4 deletions code/modules/surgery/organic_steps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
span_notice("[user] begins to make an incision in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
span_notice("[user] begins to make an incision in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
)
display_pain(target, "You feel a stabbing in your [target.parse_zone_with_bodypart(target_zone)].")
display_pain(target, "You feel a stabbing in your [target.parse_zone_with_bodypart(target_zone)].", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/incise/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.get_sharpness())
Expand All @@ -39,11 +39,16 @@
span_notice("Blood pools around the incision in [human_target]'s [target.parse_zone_with_bodypart(target_zone)]."),
span_notice("Blood pools around the incision in [human_target]'s [target.parse_zone_with_bodypart(target_zone)]."),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/success)
var/obj/item/bodypart/target_bodypart = target.get_bodypart(target_zone)
if(target_bodypart)
target_bodypart.adjustBleedStacks(10)
return ..()

/datum/surgery_step/incise/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob)
display_pain(target, mood_event_type = /datum/mood_event/surgery)
return ..()

/datum/surgery_step/incise/nobleed/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
Expand All @@ -52,7 +57,7 @@
span_notice("[user] begins to <i>carefully</i> make an incision in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
span_notice("[user] begins to <i>carefully</i> make an incision in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
)
display_pain(target, "You feel a <i>careful</i> stabbing in your [target.parse_zone_with_bodypart(target_zone)].")
display_pain(target, "You feel a <i>careful</i> stabbing in your [target.parse_zone_with_bodypart(target_zone)].", mood_event_type = /datum/mood_event/surgery)

//clamp bleeders
/datum/surgery_step/clamp_bleeders
Expand Down Expand Up @@ -177,7 +182,7 @@
span_notice("[user] begins to saw through the bone in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
span_notice("[user] begins to saw through the bone in [target]'s [target.parse_zone_with_bodypart(target_zone)]."),
)
display_pain(target, "You feel a horrid ache spread through the inside of your [target.parse_zone_with_bodypart(target_zone)]!")
display_pain(target, "You feel a horrid ache spread through the inside of your [target.parse_zone_with_bodypart(target_zone)]!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/saw/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !(tool.get_sharpness() && (tool.force >= 10)))
Expand All @@ -193,7 +198,11 @@
span_notice("[user] saws [target]'s [target.parse_zone_with_bodypart(target_zone)] open!"),
span_notice("[user] saws [target]'s [target.parse_zone_with_bodypart(target_zone)] open!"),
)
display_pain(target, "It feels like something just broke in your [target.parse_zone_with_bodypart(target_zone)]!")
display_pain(target, "It feels like something just broke in your [target.parse_zone_with_bodypart(target_zone)]!", mood_event_type = /datum/mood_event/surgery/success)
return ..()

/datum/surgery_step/saw/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob)
display_pain(target, mood_event_type = /datum/mood_event/surgery/failure)
return ..()

//drill bone
Expand Down
6 changes: 3 additions & 3 deletions code/modules/surgery/plastic_surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
span_notice("[user] begins to alter [target]'s appearance."),
span_notice("[user] begins to make an incision in [target]'s face."),
)
display_pain(target, "You feel slicing pain across your face!")
display_pain(target, "You feel slicing pain across your face!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/reshape_face/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
if(HAS_TRAIT_FROM(target, TRAIT_DISFIGURED, TRAIT_GENERIC))
Expand All @@ -82,7 +82,7 @@
span_notice("[user] successfully restores [target]'s appearance!"),
span_notice("[user] finishes the operation on [target]'s face."),
)
display_pain(target, "The pain fades, your face feels normal again!")
display_pain(target, "The pain fades, your face feels normal again!", mood_event_type = /datum/mood_event/surgery/success)
else
var/list/names = list()
if(!isabductor(user))
Expand Down Expand Up @@ -112,7 +112,7 @@
span_notice("[user] alters [oldname]'s appearance completely, [target.p_they()] is now [newname]!"),
span_notice("[user] finishes the operation on [target]'s face."),
)
display_pain(target, "The pain fades, your face feels new and unfamiliar!")
display_pain(target, "The pain fades, your face feels new and unfamiliar!", mood_event_type = /datum/mood_event/surgery/failure)
if(ishuman(target))
var/mob/living/carbon/human/human_target = target
human_target.sec_hud_set_ID()
Expand Down
4 changes: 3 additions & 1 deletion code/modules/surgery/repair_puncture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
span_notice("[user] begins to realign the torn blood vessels in [target]'s [target.parse_zone_with_bodypart(user.zone_selected)] with [tool]."),
span_notice("[user] begins to realign the torn blood vessels in [target]'s [target.parse_zone_with_bodypart(user.zone_selected)]."),
)
display_pain(target, "You feel a horrible stabbing pain in your [target.parse_zone_with_bodypart(user.zone_selected)]!")
display_pain(target, "You feel a horrible stabbing pain in your [target.parse_zone_with_bodypart(user.zone_selected)]!", mood_event_type = /datum/mood_event/surgery)

/datum/surgery_step/repair_innards/success(mob/living/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
var/datum/wound/pierce/bleed/pierce_wound = surgery.operated_wound
Expand All @@ -80,6 +80,7 @@
span_notice("[user] successfully realigns some of the blood vessels in [target]'s [target.parse_zone_with_bodypart(target_zone)] with [tool]!"),
span_notice("[user] successfully realigns some of the blood vessels in [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/success)
log_combat(user, target, "excised infected flesh in", addition="COMBAT MODE: [uppertext(user.combat_mode)]")
surgery.operated_bodypart.receive_damage(brute=3, wound_bonus=CANT_WOUND)
pierce_wound.adjust_blood_flow(-0.25)
Expand All @@ -94,6 +95,7 @@
span_notice("[user] jerks apart some of the blood vessels in [target]'s [target.parse_zone_with_bodypart(target_zone)] with [tool]!"),
span_notice("[user] jerk apart some of the blood vessels in [target]'s [target.parse_zone_with_bodypart(target_zone)]!"),
)
display_pain(target, mood_event_type = /datum/mood_event/surgery/failure)
surgery.operated_bodypart.receive_damage(brute=rand(4,8), sharpness=SHARP_EDGED, wound_bonus = 10)

///// Sealing the vessels back together
Expand Down
9 changes: 8 additions & 1 deletion code/modules/surgery/surgery_step.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,19 @@
* * target - Who the message will be sent to
* * pain_message - The message to be displayed
* * mechanical_surgery - Boolean flag that represents if a surgery step is done on a mechanical limb (therefore does not force scream)
* * mood_event_type - What type of mood event the step applies if they're still conscious (ie "THEY'RE CUTTING ME OPEN!!" when being sliced open with a scalpel/saw/ect)
*/
/datum/surgery_step/proc/display_pain(mob/living/target, pain_message, mechanical_surgery = FALSE)
/datum/surgery_step/proc/display_pain(mob/living/target, pain_message, mechanical_surgery = FALSE, datum/mood_event/mood_event_type)
if(target.stat < UNCONSCIOUS)
if(HAS_TRAIT(target, TRAIT_ANALGESIA))
if(!pain_message)
return
to_chat(target, span_notice("You feel a dull, numb sensation as your body is surgically operated on."))
else
if(mood_event_type)
target.add_mood_event("surgery", mood_event_type)
if(!pain_message)
return
to_chat(target, span_userdanger(pain_message))
if(prob(30) && !mechanical_surgery)
target.emote("scream")
Expand Down

0 comments on commit 9e11a5c

Please sign in to comment.