reworks emote sound code & adds screaming (Which only works if the code forces it. *scream wont make a sound) (#42216)

* done

* adds moth scream

* Update code/datums/emotes.dm

Co-Authored-By: Qustinnus <Floydje123@hotmail.com>

* Update code/datums/emotes.dm

Co-Authored-By: Qustinnus <Floydje123@hotmail.com>

* Update code/datums/emotes.dm

Co-Authored-By: Qustinnus <Floydje123@hotmail.com>

* Update code/datums/emotes.dm

Co-Authored-By: Qustinnus <Floydje123@hotmail.com>

* 1

* fixed

* fixed

* wew
This commit is contained in:
Qustinnus
2019-01-11 19:43:03 +01:00
committed by Jordan Brown
parent 5e335f99ab
commit 31c19654e0
19 changed files with 72 additions and 47 deletions
+12 -10
View File
@@ -20,8 +20,13 @@
var/list/mob_type_blacklist_typecache //Types that are NOT allowed to use that emote
var/list/mob_type_ignore_stat_typecache
var/stat_allowed = CONSCIOUS
var/sound //Sound to play when emote is called
var/vary = FALSE //used for the honk borg emote
var/only_forced_audio = FALSE //can only code call this event instead of the player.
var/static/list/emote_list = list()
/datum/emote/New()
if(key_third_person)
emote_list[key_third_person] = src
@@ -59,6 +64,10 @@
user.log_message(msg, LOG_EMOTE)
msg = "<b>[user]</b> " + msg
var/tmp_sound = get_sound(user)
if(tmp_sound && (!only_forced_audio || !intentional))
playsound(user, tmp_sound, 50, vary)
for(var/mob/M in GLOB.dead_mob_list)
if(!M.client || isnewplayer(M))
continue
@@ -71,6 +80,9 @@
else
user.visible_message(msg)
/datum/emote/proc/get_sound(mob/living/user)
return sound //by default just return this var.
/datum/emote/proc/replace_pronoun(mob/user, message)
if(findtext(message, "their"))
message = replacetext(message, "their", user.p_their())
@@ -138,13 +150,3 @@
var/mob/living/L = user
if(L.has_trait(TRAIT_EMOTEMUTE))
return FALSE
/datum/emote/sound
var/sound //Sound to play when emote is called
var/vary = FALSE //used for the honk borg emote
mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon)
/datum/emote/sound/run_emote(mob/user, params)
. = ..()
if(.)
playsound(user.loc, sound, 50, vary)