Skip to content

Commit

Permalink
add: добавил операцию, по смене голоса (#278)
Browse files Browse the repository at this point in the history
Добавление vocal_cords_surgery.


## Что этот PR делает

Добавляет операцию, по изменению голоса

## Почему это хорошо для игры

потому что на ОФФах этого нет, а мы добавим :pepecopium:

## Изображения изменений
к сожалению нет :ratge:

## Тестирование
Нет :Clueless: , но Фурриор одобрил
## Changelog

🆑
add: добавил операцию, по смене голоса
/🆑

---------

Co-authored-by: dj-34 <[email protected]>
Co-authored-by: Furior <[email protected]>
  • Loading branch information
3 people committed Oct 22, 2023
1 parent d09f1af commit 2958f02
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions modular_ss220/text_to_speech/code/tts_seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 2958f02

Please sign in to comment.