From 2958f02d2afcd071d3e0e6c8e71752be23a0eccf Mon Sep 17 00:00:00 2001 From: Lime-7 <142225267+Lime-7@users.noreply.github.com> Date: Sun, 15 Oct 2023 02:41:44 +0700 Subject: [PATCH] =?UTF-8?q?add:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8E,=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D1=81=D0=BC=D0=B5=D0=BD=D0=B5=20=D0=B3=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D1=81=D0=B0=20(#278)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавление vocal_cords_surgery. ## Что этот PR делает Добавляет операцию, по изменению голоса ## Почему это хорошо для игры потому что на ОФФах этого нет, а мы добавим :pepecopium: ## Изображения изменений к сожалению нет :ratge: ## Тестирование Нет :Clueless: , но Фурриор одобрил ## Changelog :cl: add: добавил операцию, по смене голоса /:cl: --------- Co-authored-by: dj-34 Co-authored-by: Furior <68264134+Furrior@users.noreply.github.com> --- modular_ss220/text_to_speech/code/tts_seed.dm | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/modular_ss220/text_to_speech/code/tts_seed.dm b/modular_ss220/text_to_speech/code/tts_seed.dm index 9118207d2776..1110b2ea1b77 100644 --- a/modular_ss220/text_to_speech/code/tts_seed.dm +++ b/modular_ss220/text_to_speech/code/tts_seed.dm @@ -60,3 +60,78 @@ set desc = "Express yourself!" set category = "Subsystems" change_voice() + +/** +* Surgery to change the voice of TTS. +* Below are the operations for organics and IPC. +*/ + +// Surgery for organics +/datum/surgery/vocal_cords_surgery + name = "Vocal Cords Tuning Surgery" + steps = list( + /datum/surgery_step/generic/cut_open, + /datum/surgery_step/generic/retract_skin, + /datum/surgery_step/tune_vocal_cords, + /datum/surgery_step/generic/cauterize + ) + possible_locs = list(BODY_ZONE_PRECISE_MOUTH) + + +/datum/surgery/vocal_cords_surgery/can_start(mob/user, mob/living/carbon/target) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(!H.check_has_mouth()) + return FALSE + return TRUE + +/datum/surgery_step/tune_vocal_cords + name = "tune vocal cords" + allowed_tools = list(/obj/item/scalpel = 100, /obj/item/kitchen/knife = 50, /obj/item/wirecutters = 35) + time = 6 SECONDS + var/target_vocal = "vocal cords" + +/datum/surgery_step/tune_vocal_cords/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] begins to tune [target]'s vocals.", span_notice("You begin to tune [target]'s vocals...")) + ..() + +/datum/surgery_step/tune_vocal_cords/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + target.change_voice(user, TRUE) + user.visible_message("[user] tunes [target]'s vocals completely!", span_notice("You tune [target]'s vocals completely.")) + return TRUE + +/datum/surgery_step/tune_vocal_cords/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + var/obj/item/organ/external/head/head = target.get_organ(target_zone) + user.visible_message(span_warning("[user]'s hand slips, tearing [target_vocal] in [target]'s throat with [tool]!"), \ + span_warning("Your hand slips, tearing [target_vocal] in [target]'s throat with [tool]!")) + target.tts_seed = SStts220.get_random_seed(target) + target.apply_damage(10, BRUTE, head, sharp = TRUE) + return FALSE + +// Surgery for IPC +/datum/surgery/vocal_cords_surgery/ipc + name = "Microphone Setup Operation" + steps = list( + /datum/surgery_step/robotics/external/unscrew_hatch, + /datum/surgery_step/robotics/external/open_hatch, + /datum/surgery_step/tune_vocal_cords/ipc, + /datum/surgery_step/robotics/external/close_hatch + ) + requires_organic_bodypart = FALSE + +/datum/surgery/vocal_cords_surgery/ipc/can_start(mob/user, mob/living/carbon/target) + if(!ishuman(target)) + return FALSE + + var/mob/living/carbon/human/H = target + var/obj/item/organ/external/head/affected = H.get_organ(user.zone_selected) + if(!affected) + return FALSE + if(!affected.is_robotic()) + return FALSE + return TRUE + +/datum/surgery_step/tune_vocal_cords/ipc + name = "microphone setup" + allowed_tools = list(/obj/item/multitool = 100, /obj/item/screwdriver = 55, /obj/item/scalpel = 25, /obj/item/kitchen/knife = 20) + target_vocal = "microphone"