mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] Surgery sound fix attempt 2 [MDB IGNORE] (#13024)
* Surgery sound fix attempt 2 (#66018) When performing surgery steps that require a saw, using ghetto tools would play the saw.sound despite the tools not having any motors. This pr fixes that and adds some framework for future conversion of preop_sound to list() for fixing future similar cases * Surgery sound fix attempt 2 Co-authored-by: FinancialGoose <92416224+TheBoondock@users.noreply.github.com>
This commit is contained in:
co-authored by
FinancialGoose
parent
3e64621cb4
commit
1fecff4ec5
@@ -134,7 +134,14 @@
|
||||
/obj/item/knife/butcher = 25,
|
||||
/obj/item = 20) //20% success (sort of) with any sharp item with a force>=10
|
||||
time = 54
|
||||
preop_sound = 'sound/surgery/saw.ogg'
|
||||
preop_sound = list(
|
||||
/obj/item/circular_saw = 'sound/surgery/saw.ogg',
|
||||
/obj/item/melee/arm_blade = 'sound/surgery/scalpel1.ogg',
|
||||
/obj/item/fireaxe = 'sound/surgery/scalpel1.ogg',
|
||||
/obj/item/hatchet = 'sound/surgery/scalpel1.ogg',
|
||||
/obj/item/knife/butcher = 'sound/surgery/scalpel1.ogg',
|
||||
/obj/item = 'sound/surgery/scalpel1.ogg',
|
||||
)
|
||||
success_sound = 'sound/surgery/organ2.ogg'
|
||||
|
||||
/datum/surgery_step/saw/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
|
||||
@@ -148,7 +148,15 @@
|
||||
/datum/surgery_step/proc/play_preop_sound(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
|
||||
if(!preop_sound)
|
||||
return
|
||||
playsound(get_turf(target), preop_sound, 75, TRUE, falloff_exponent = 12, falloff_distance = 1)
|
||||
var/sound_file_use
|
||||
if(islist(preop_sound))
|
||||
for(var/typepath in preop_sound)//iterate and assign subtype to a list, works best if list is arranged from subtype first and parent last
|
||||
if(istype(tool, typepath))
|
||||
sound_file_use = preop_sound[typepath]
|
||||
break
|
||||
else
|
||||
sound_file_use = preop_sound
|
||||
playsound(get_turf(target), sound_file_use, 75, TRUE, falloff_exponent = 12, falloff_distance = 1)
|
||||
|
||||
/datum/surgery_step/proc/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = TRUE)
|
||||
SEND_SIGNAL(user, COMSIG_MOB_SURGERY_STEP_SUCCESS, src, target, target_zone, tool, surgery, default_display_results)
|
||||
|
||||
Reference in New Issue
Block a user