Merge pull request #5841 from Anewbe/voice_changer

Voice changer tweaks and fixes
This commit is contained in:
Atermonera
2019-01-16 19:50:54 -08:00
committed by Novacat
parent 713e33054e
commit 20604f2952
3 changed files with 56 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
/obj/item/voice_changer
name = "voice changer"
desc = "A voice scrambling module. If you can see this, report it as a bug on the tracker."
var/voice //If set and item is present in mask/suit, this name will be used for the wearer's speech.
var/active
var/voice = null //If set and item is present in mask/suit, this name will be used for the wearer's speech.
var/active = TRUE
/obj/item/clothing/mask/gas/voice
name = "gas mask"
@@ -15,7 +15,7 @@
set src in usr
changer.active = !changer.active
usr << "<span class='notice'>You [changer.active ? "enable" : "disable"] the voice-changing module in \the [src].</span>"
to_chat(usr, "<span class='notice'>You [changer.active ? "enable" : "disable"] the voice-changing module in \the [src].</span>")
/obj/item/clothing/mask/gas/voice/verb/Set_Voice(name as text)
set category = "Object"
@@ -24,7 +24,14 @@
var/voice = sanitize(name, MAX_NAME_LEN)
if(!voice || !length(voice)) return
changer.voice = voice
usr << "<span class='notice'>You are now mimicking <B>[changer.voice]</B>.</span>"
to_chat(usr, "<span class='notice'>You are now mimicking <B>[changer.voice]</B>.</span>")
/obj/item/clothing/mask/gas/voice/verb/Reset_Voice()
set category = "Object"
set src in usr
changer.voice = null
to_chat(usr, "<span class='notice'>You have reset your voice changer's mimicry feature.</span>")
/obj/item/clothing/mask/gas/voice/New()
..()

View File

@@ -83,13 +83,16 @@
// todo: fix this shit
if(rig.speech && rig.speech.voice_holder && rig.speech.voice_holder.active && rig.speech.voice_holder.voice)
voice_sub = rig.speech.voice_holder.voice
else
if(!voice_sub) // If the rig has a voice changer, then we use that. Otherwise, use this
for(var/obj/item/gear in list(wear_mask,wear_suit,head))
if(!gear)
continue
var/obj/item/voice_changer/changer = locate() in gear
if(changer && changer.active && changer.voice)
voice_sub = changer.voice
if(changer && changer.active)
if(changer.voice)
voice_sub = changer.voice
else
voice_sub = get_id_name()
if(voice_sub)
return voice_sub
if(mind && mind.changeling && mind.changeling.mimicing)

View File

@@ -0,0 +1,39 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
#################################
# Your name.
author: Anewbe
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Voice changing masks no longer give up when you put on a hardsuit."
- tweak: "Mask voice changers start on."
- tweak: "Mask voice changers that do not have a set voice will now default to your worn ID's name."
- tweak: "Mask voice changers now have a verb to reset their name."