Skip to content

Commit

Permalink
tweak(surgery): ports surgery sounds from /TG/ and /VG/ (#11306)
Browse files Browse the repository at this point in the history
  • Loading branch information
Filatelele authored Jan 4, 2024
1 parent 0e52853 commit 9b08bfa
Show file tree
Hide file tree
Showing 29 changed files with 153 additions and 13 deletions.
2 changes: 1 addition & 1 deletion code/_helpers/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
swapped = TRUE

/// Creates and "centers" organ image for later use inside radial menu.
/proc/agjust_organ_image(obj/item/organ/O)
/proc/adjust_organ_image(obj/item/organ/O)
var/image/I = image(icon = O.icon, icon_state = O.icon_state)
I.CopyOverlays(O)
I.pixel_y = -5
Expand Down
20 changes: 20 additions & 0 deletions code/datums/surgery/steps/bone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
blood_level = BLOODY_HANDS
shock_level = 20

failure_sound = 'sound/effects/bonebreak1.ogg'

/datum/surgery_step/bone/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && !BP_IS_ROBOTIC(parent_organ) && parent_organ.open() >= SURGERY_RETRACTED)

Expand All @@ -19,6 +21,9 @@
/obj/item/tape_roll = 75
)

preop_sound = 'sound/surgery/bonegel.ogg'
success_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/bone/glue_bone/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.stage == 0)

Expand Down Expand Up @@ -62,6 +67,9 @@
/obj/item/wrench = 75
)

preop_sound = 'sound/surgery/bonesetter.ogg'
success_sound = 'sound/surgery/bonesetter.ogg'

/datum/surgery_step/bone/mend_bone/check_zone(mob/living/carbon/human/target, target_zone)
return (..() && target_zone != BP_HEAD)

Expand Down Expand Up @@ -105,6 +113,9 @@
/obj/item/wrench = 75
)

preop_sound = 'sound/surgery/bonesetter.ogg'
success_sound = 'sound/surgery/bonesetter.ogg'

/datum/surgery_step/bone/mend_skull/check_zone(mob/living/carbon/human/target, target_zone)
return (..() && target_zone == BP_HEAD)

Expand Down Expand Up @@ -145,6 +156,9 @@
/obj/item/wrench = 75
)

preop_sound = 'sound/surgery/bonesetter.ogg'
success_sound = 'sound/surgery/bonesetter.ogg'

/datum/surgery_step/bone/set_bone/check_zone(mob/living/carbon/human/target, target_zone)
return (..() && target_zone != BP_HEAD)

Expand Down Expand Up @@ -198,6 +212,9 @@
/obj/item/tape_roll = 75
)

preop_sound = 'sound/surgery/bonegel.ogg'
success_sound = 'sound/surgery/organ1.ogg'

/datum/surgery_step/bone/postset_bone/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.stage == 2)

Expand Down Expand Up @@ -234,6 +251,9 @@
/obj/item/bonesetter/bone_mender = 100
)

preop_sound = 'sound/surgery/bonesetter.ogg'
success_sound = 'sound/surgery/organ1.ogg'

/datum/surgery_step/bone/mender/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.stage <= 5)

Expand Down
16 changes: 16 additions & 0 deletions code/datums/surgery/steps/face.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
/obj/item/material/shard = 50
)

preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/scalpel2.ogg'
failure_sound = 'sound/weapons/bladeslice.ogg'

/datum/surgery_step/face/cut_face/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return target.surgery_status.face == 0

Expand Down Expand Up @@ -73,6 +77,10 @@
/obj/item/device/assembly/mousetrap = 10
)

preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat.ogg'
failure_sound = 'sound/surgery/hatchet.ogg'

/datum/surgery_step/face/mend_vocal/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && target.surgery_status.face == 1)

Expand Down Expand Up @@ -109,6 +117,10 @@
/obj/item/material/kitchen/utensil/fork = 75
)

preop_sound = 'sound/surgery/retractor1.ogg'
success_sound = 'sound/surgery/retractor.ogg'
failure_sound = 'sound/weapons/bladeslice.ogg'

/datum/surgery_step/face/fix_face/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && target.surgery_status.face == 2)

Expand Down Expand Up @@ -151,6 +163,10 @@
/obj/item/hothands = 20
)

preop_sound = 'sound/surgery/cautery1.ogg'
success_sound = 'sound/surgery/cautery2.ogg'
failure_sound = 'sound/surgery/cautery.ogg'

/datum/surgery_step/face/cauterize/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && target.surgery_status.face > 0)

Expand Down
32 changes: 31 additions & 1 deletion code/datums/surgery/steps/generic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
duration = CAUTERIZE_DURATION
check_stump = FALSE

preop_sound = 'sound/surgery/cautery1.ogg'
success_sound = 'sound/surgery/cautery2.ogg'
failure_sound = 'sound/surgery/cautery.ogg'

/datum/surgery_step/generic/cauterize/check_zone(mob/living/carbon/human/target, target_zone)
return (..() && target_zone != BP_MOUTH)

Expand Down Expand Up @@ -92,6 +96,9 @@
*/
/datum/surgery_step/generic/cut
duration = CUT_DURATION
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/scalpel2.ogg'
failure_sound = 'sound/weapons/bladeslice.ogg'

/datum/surgery_step/generic/cut/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && !parent_organ.open())
Expand Down Expand Up @@ -126,7 +133,6 @@
"You have made an incision on [target]'s [parent_organ] with \the [tool]."
)
parent_organ.createwound(CUT, parent_organ.min_broken_damage / 2, 1)
playsound(target.loc, 'sound/weapons/bladeslice.ogg', 15, 1)

/datum/surgery_step/generic/cut/default/failure(obj/item/organ/external/parent_organ, obj/item/organ/target_organ, mob/living/carbon/human/target, obj/item/tool, mob/user)
announce_failure(user,
Expand All @@ -153,6 +159,10 @@
/obj/item/melee/energy/sword/one_hand = 50
)

preop_sound = 'sound/surgery/cautery1.ogg'
success_sound = 'sound/surgery/cautery2.ogg'
failure_sound = 'sound/surgery/cautery.ogg'

/datum/surgery_step/generic/cut/laser/initiate(obj/item/organ/external/parent_organ, obj/item/organ/target_organ, mob/living/carbon/human/target, obj/item/tool, mob/user)
announce_preop(user,
"[user] starts the bloodless incision on [target]'s [parent_organ] with \the [tool].",
Expand Down Expand Up @@ -197,6 +207,10 @@
/obj/item/scalpel/manager = 100
)

preop_sound = 'sound/surgery/scalpel.ogg'
success_sound = 'sound/surgery/retractor.ogg'
failure_sound = 'sound/effects/fighting/crunch2.ogg'

/datum/surgery_step/generic/incision_manager/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && (parent_organ.open() == SURGERY_CLOSED || parent_organ.open() == SURGERY_OPEN))

Expand Down Expand Up @@ -252,6 +266,10 @@
/obj/item/device/assembly/mousetrap = 20
)

preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat.ogg'
failure_sound = 'sound/surgery/hatchet.ogg'

/datum/surgery_step/generic/clamp_bleeders/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.open() && !parent_organ.clamped())

Expand Down Expand Up @@ -301,6 +319,10 @@
priority = 1
duration = RETRACT_DURATION

preop_sound = 'sound/surgery/retractor1.ogg'
success_sound = 'sound/surgery/retractor.ogg'
failure_sound = 'sound/surgery/retractor2.ogg'

/datum/surgery_step/generic/retract_skin/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.open() == SURGERY_OPEN)

Expand Down Expand Up @@ -351,6 +373,14 @@
/obj/item/material/hatchet = 75
)

preop_sound = list(
/obj/item/circular_saw = 'sound/surgery/saw.ogg',
/obj/item/material/knife = 'sound/surgery/scalpel1.ogg',
/obj/item/material/hatchet = 'sound/surgery/hatchet.ogg',
)
success_sound = 'sound/surgery/organ2.ogg'
failure_sound = 'sound/effects/fighting/circsawhit.ogg'

/datum/surgery_step/generic/saw/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.open() == SURGERY_RETRACTED)

Expand Down
18 changes: 16 additions & 2 deletions code/datums/surgery/steps/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
/obj/item/stack/rods = 50
)

preop_sound = 'sound/surgery/surgicaldrill.ogg'
success_sound = 'sound/surgery/organ2.ogg'
failure_sound = 'sound/surgery/organ1.ogg'

/datum/surgery_step/cavity/make_space/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && !parent_organ.cavity)

Expand Down Expand Up @@ -76,6 +80,10 @@
/obj/item/weldingtool = 25
)

preop_sound = 'sound/surgery/cautery1.ogg'
success_sound = 'sound/surgery/cautery2.ogg'
failure_sound = 'sound/surgery/cautery.ogg'

/datum/surgery_step/cavity/close_space/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return (..() && parent_organ.cavity)

Expand Down Expand Up @@ -108,6 +116,10 @@
/obj/item = 100
)

preop_sound = 'sound/surgery/organ1.ogg'
success_sound = 'sound/surgery/organ2.ogg'
failure_sound = 'sound/effects/fighting/crunch1.ogg'

/datum/surgery_step/cavity/place_item/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
. = ..()
if(!.)
Expand Down Expand Up @@ -183,6 +195,10 @@
/obj/item/material/kitchen/utensil/fork = 20
)

preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/effects/squelch1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/cavity/implant_removal/initiate(obj/item/organ/external/parent_organ, obj/item/organ/target_organ, mob/living/carbon/human/target, obj/item/tool, mob/user)
announce_preop(user,
"[user] starts poking around inside [target]'s [parent_organ] with \the [tool].",
Expand Down Expand Up @@ -237,7 +253,6 @@
wound.embedded_objects -= implanted_item
break

playsound(target.loc, 'sound/effects/squelch1.ogg', 15, 1)
BITSET(target.hud_updateflag, IMPLOYAL_HUD)

implanted_item.dropInto(target.loc)
Expand All @@ -258,6 +273,5 @@
for(var/obj/item/implant/I in parent_organ.implants)
if(prob(10 + 100 - get_tool_quality(tool)))
user.visible_message("Something beeps inside [target]'s [parent_organ]!")
playsound(I.loc, 'sound/items/countdown.ogg', 75, 1, -3)
spawn(25)
I.activate()
18 changes: 11 additions & 7 deletions code/datums/surgery/steps/internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
delicate = TRUE
shock_level = 40
priority = 2
preop_sound = 'sound/surgery/hemostat1.ogg'
success_sound = 'sound/surgery/hemostat1.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/internal/pick_target_organ(atom/user, mob/living/carbon/human/target, target_zone)
return target.surgery_status.operated_organs[get_parent_zone(target_zone)]
Expand Down Expand Up @@ -41,7 +44,7 @@
continue

if(O.status & ORGAN_CUT_AWAY)
attachable_organs[O] = agjust_organ_image(O)
attachable_organs[O] = adjust_organ_image(O)

var/obj/item/organ/preselected_organ = ..()
if(istype(preselected_organ))
Expand Down Expand Up @@ -110,7 +113,7 @@
continue

if(!(O.status & ORGAN_CUT_AWAY))
attached_organs[O] = agjust_organ_image(O)
attached_organs[O] = adjust_organ_image(O)

var/obj/item/organ/preselected_organ = ..()
if(istype(preselected_organ))
Expand Down Expand Up @@ -170,7 +173,7 @@
var/obj/item/organ/external/parent_organ = target.get_organ(target_zone)
for(var/obj/item/organ/internal/O in parent_organ.implants)
if(O.status & ORGAN_CUT_AWAY)
removable_organs[O] = agjust_organ_image(O)
removable_organs[O] = adjust_organ_image(O)

var/obj/item/organ/preselected_organ = ..()
if(istype(preselected_organ))
Expand Down Expand Up @@ -223,6 +226,9 @@
/obj/item/organ/internal = 100
)

preop_sound = 'sound/effects/squelch1.ogg'
success_sound = 'sound/effects/squelch2.ogg'

/datum/surgery_step/internal/replace_organ/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
. = ..()
if(!.)
Expand Down Expand Up @@ -300,8 +306,6 @@
log_debug("[user] ([user.ckey]) replaced organ [O], which didn't have ORGAN_CUT_AWAY set, in [target] ([target.ckey])")
O.status |= ORGAN_CUT_AWAY

playsound(target.loc, 'sound/effects/squelch1.ogg', 15, TRUE)

/datum/surgery_step/internal/replace_organ/failure(obj/item/organ/external/parent_organ, obj/item/organ/target_organ, mob/living/carbon/human/target, obj/item/tool, mob/user)
announce_failure(user,
"[user]'s hand slips, damaging \the [tool]!",
Expand Down Expand Up @@ -341,7 +345,7 @@
if(!I.surface_accessible && parent_organ.open() < (parent_organ.encased ? SURGERY_ENCASED : SURGERY_RETRACTED))
continue

damaged_organs[I] = agjust_organ_image(I)
damaged_organs[I] = adjust_organ_image(I)

var/obj/item/organ/internal/preselected_organ = ..()
if(istype(preselected_organ))
Expand Down Expand Up @@ -688,7 +692,7 @@
continue

if(!(O.status & ORGAN_CUT_AWAY) && (O.status & ORGAN_DEAD) && O.parent_organ == parent_organ.organ_tag)
dead_organs[O] = agjust_organ_image(O)
dead_organs[O] = adjust_organ_image(O)

var/obj/item/organ/internal/preselected_organ = ..()
if(istype(preselected_organ))
Expand Down
2 changes: 2 additions & 0 deletions code/datums/surgery/steps/limb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
delicate = TRUE
shock_level = 40
priority = 3 // Must be higher than /datum/surgery_step/internal.
preop_sound = 'sound/surgery/scalpel1.ogg'
success_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/limb/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
return TRUE
Expand Down
17 changes: 17 additions & 0 deletions code/datums/surgery/steps/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
/obj/item/gun/energy/plasmacutter = 30
)

preop_sound = list(
/obj/item/weldingtool = 'sound/items/Welder.ogg',
/obj/item/circular_saw = 'sound/surgery/saw.ogg',
/obj/item/gun/energy/plasmacutter = 'sound/items/Welder2.ogg',
)
success_sound = 'sound/surgery/organ2.ogg'
failure_sound = 'sound/surgery/organ1.ogg'

/datum/surgery_step/powersuit/check_zone(mob/living/carbon/human/target, target_zone)
return (..() && target_zone == BP_CHEST)

Expand Down Expand Up @@ -72,6 +80,9 @@
/obj/item/reagent_containers/vessel/bucket = 50
)

success_sound = 'sound/effects/spray2.ogg'
failure_sound = 'sound/effects/spray3.ogg'

/datum/surgery_step/sterilize/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
. = ..()
if(!.)
Expand Down Expand Up @@ -147,6 +158,9 @@
/obj/item/tape_roll = 50
)

success_sound = 'sound/surgery/fixovein.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/fix_tendon/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
. = ..()
if(!.)
Expand Down Expand Up @@ -201,6 +215,9 @@
/obj/item/tape_roll = 50
)

success_sound = 'sound/surgery/fixovein.ogg'
failure_sound = 'sound/surgery/organ2.ogg'

/datum/surgery_step/fix_vein/check_parent_organ(obj/item/organ/external/parent_organ, mob/living/carbon/human/target, obj/item/tool, atom/user)
. = ..()
if(!.)
Expand Down
Loading

0 comments on commit 9b08bfa

Please sign in to comment.