Add verb to toggle species speech sounds

This commit is contained in:
TheGreatKitsune
2022-12-13 13:12:05 -06:00
parent 02092ee913
commit 2a446b926f
9 changed files with 49 additions and 17 deletions
@@ -0,0 +1,20 @@
/mob/living/carbon/human/verb/hide_nutrition()
set name = "Show/Hide Nutrition Levels"
set category = "IC"
set desc = "Allow other player to see your current nutrition level or not."
nutrition_hidden = !nutrition_hidden
to_chat(src, "Players will [nutrition_hidden ? "no longer" : "now"] see your nutrition levels.")
/mob/living/carbon/human/proc/toggle_speech_sounds()
set name = "Toggle Species Speech Sounds"
set desc = "Toggle if your species defined speech sound has a chance of playing on a Say"
set category = "IC"
if(stat)
to_chat(src, "<span class='warning'>You must be awake and standing to perform this action!</span>")
return
speech_sound_enabled = !speech_sound_enabled
to_chat(src, "You will [speech_sound_enabled ? "now" : "no longer"] have a chance to play your species defined speech sound on a Say.")
return TRUE
@@ -9,4 +9,6 @@
vore_icon_bellies = list("stomach", "taur belly")
var/struggle_anim_stomach = FALSE
var/struggle_anim_taur = FALSE
var/hide_headset = FALSE
var/hide_headset = FALSE
var/speech_sound_enabled = TRUE
var/nutrition_hidden = FALSE
@@ -0,0 +1,5 @@
/datum/species/vox
speech_chance = 50 // As long as we're making the option to disable it, might as well bump up the chances when it is enabled
inherent_verbs = list(
/mob/living/carbon/human/proc/toggle_speech_sounds
)
@@ -2,6 +2,7 @@
//speech sounds
var/list/speech_sounds = list()
var/speech_chance = 75 //mobs can be a bit more emotive than carbon/humans
var/speech_sound_enabled = TRUE
//vars for vore_icons toggle control
var/vore_icons_cache = null // null by default. Going from ON to OFF should store vore_icons val here, OFF to ON reset as null
@@ -34,8 +35,22 @@
update_icon()
/mob/living/simple_mob/verb/toggle_speech_sounds()
set name = "Toggle Species Speech Sounds"
set desc = "Toggle if your species defined speech sound has a chance of playing on a Say"
set category = "IC"
if(stat)
to_chat(src, "<span class='warning'>You must be awake and standing to perform this action!</span>")
return
speech_sound_enabled = !speech_sound_enabled
to_chat(src, "You will [speech_sound_enabled ? "now" : "no longer"] have a chance to play your species defined speech sound on a Say.")
return TRUE
/mob/living/simple_mob/handle_speech_sound()
if(speech_sounds && speech_sounds.len && prob(speech_chance))
if(speech_sound_enabled && speech_sounds && speech_sounds.len && prob(speech_chance))
var/list/returns[2]
returns[1] = sound(pick(speech_sounds))
returns[2] = 50
@@ -82,6 +97,3 @@
// This from original living.dm update_transforms too
handle_status_indicators()
@@ -87,7 +87,7 @@
var/datum/action/innate/xeno_ch/xeno_corrode/corrode_action = new
var/datum/action/innate/xeno_ch/xeno_pounce/pounce_action = new
var/datum/action/innate/xeno_ch/xeno_spin/spin_action = new
can_be_drop_prey = FALSE //CHOMP Add
/mob/living/simple_mob/xeno_ch/Initialize()
@@ -99,6 +99,7 @@
. = ..()
faction = "neutral"
verbs |= /mob/living/simple_mob/xeno_ch/proc/xeno_build
verbs |= /mob/living/simple_mob/verb/toggle_speech_sounds
build_action.Grant(src)