Skip to content

Commit

Permalink
Merge pull request tgstation#10364 from HippieStation/upstream-pr-169…
Browse files Browse the repository at this point in the history
…9347-experimental

[MIRROR] reworks emote sound code & adds screaming (Which only works if the code forces it. *scream wont make a sound)
  • Loading branch information
Jujumatic committed Feb 20, 2019
2 parents 1c5bf4c + c03a17e commit 317a3c2
Show file tree
Hide file tree
Showing 21 changed files with 151 additions and 121 deletions.
22 changes: 12 additions & 10 deletions code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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())
Expand Down Expand Up @@ -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)
15 changes: 7 additions & 8 deletions code/modules/mob/living/carbon/alien/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@
message_alien = "hisses."
message_larva = "hisses softly."

/datum/emote/living/alien/hiss/run_emote(mob/user, params)
. = ..()
if(. && isalienadult(user))
playsound(user.loc, "hiss", 40, 1, 1)
/datum/emote/living/alien/hiss/get_sound(mob/living/user)
if(isalienadult(user))
return "hiss"

/datum/emote/living/alien/roar
key = "roar"
key_third_person = "roars"
message_alien = "roars."
message_larva = "softly roars."
emote_type = EMOTE_AUDIBLE
vary = TRUE

/datum/emote/living/alien/roar/run_emote(mob/user, params)
. = ..()
if(. && isalienadult(user))
playsound(user.loc, 'sound/voice/hiss5.ogg', 40, 1, 1)
/datum/emote/living/alien/roar/get_sound(mob/living/user)
if(isalienadult(user))
return 'sound/voice/hiss5.ogg'
22 changes: 10 additions & 12 deletions code/modules/mob/living/carbon/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,17 @@
muzzle_ignore = TRUE
restraint_check = TRUE
emote_type = EMOTE_AUDIBLE
vary = TRUE

/datum/emote/living/carbon/clap/run_emote(mob/living/user, params)
. = ..()
if (.)
if (ishuman(user))
// Need hands to clap
if (!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM))
return
var/clap = pick('sound/misc/clap1.ogg',
'sound/misc/clap2.ogg',
'sound/misc/clap3.ogg',
'sound/misc/clap4.ogg')
playsound(user, clap, 50, 1, -1)
/datum/emote/living/carbon/clap/get_sound(mob/living/user)
if(ishuman(user))
if(!user.get_bodypart(BODY_ZONE_L_ARM) || !user.get_bodypart(BODY_ZONE_R_ARM))
return
else
return pick('sound/misc/clap1.ogg',
'sound/misc/clap2.ogg',
'sound/misc/clap3.ogg',
'sound/misc/clap4.ogg')

/datum/emote/living/carbon/gnarl
key = "gnarl"
Expand Down
26 changes: 26 additions & 0 deletions code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,32 @@
message = "mumbles!"
emote_type = EMOTE_AUDIBLE

/* hippie start -- Removed in favor of a /living/scream for borgs too,and with our sounds
/datum/emote/living/carbon/human/scream
key = "scream"
key_third_person = "screams"
message = "screams!"
emote_type = EMOTE_AUDIBLE
only_forced_audio = TRUE
vary = TRUE
/datum/emote/living/carbon/human/scream/get_sound(mob/living/user)
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
if(!H.mind?.miming)
return
if(ishumanbasic(H) || iscatperson(H))
if(user.gender == FEMALE)
return pick('sound/voice/human/femalescream_1.ogg', 'sound/voice/human/femalescream_2.ogg', 'sound/voice/human/femalescream_3.ogg', 'sound/voice/human/femalescream_4.ogg', 'sound/voice/human/femalescream_5.ogg')
else
if(prob(1))
return 'sound/voice/human/wilhelm_scream.ogg'
return pick('sound/voice/human/malescream_1.ogg', 'sound/voice/human/malescream_2.ogg', 'sound/voice/human/malescream_3.ogg', 'sound/voice/human/malescream_4.ogg', 'sound/voice/human/malescream_5.ogg')
else if(ismoth(H))
return 'sound/voice/moth/scream_moth.ogg'
hippie end */

/datum/emote/living/carbon/human/pale
key = "pale"
message = "goes pale for a second."
Expand Down
13 changes: 7 additions & 6 deletions code/modules/mob/living/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,22 @@
message = "laughs."
message_mime = "laughs silently!"
emote_type = EMOTE_AUDIBLE
vary = TRUE

/datum/emote/living/laugh/can_run_emote(mob/living/user, status_check = TRUE)
. = ..()
if(. && iscarbon(user))
var/mob/living/carbon/C = user
return !C.silent

/datum/emote/living/laugh/run_emote(mob/user, params)
. = ..()
if(. && ishuman(user))
/datum/emote/living/laugh/get_sound(mob/living/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.dna.species.id == "human" && (!H.mind || !H.mind.miming))
if(user.gender == FEMALE)
playsound(H, 'sound/voice/human/womanlaugh.ogg', 50, 1)
return 'sound/voice/human/womanlaugh.ogg'
else
playsound(H, pick('sound/voice/human/manlaugh1.ogg', 'sound/voice/human/manlaugh2.ogg'), 50, 1)
return pick('sound/voice/human/manlaugh1.ogg', 'sound/voice/human/manlaugh2.ogg')

/datum/emote/living/look
key = "look"
Expand Down Expand Up @@ -475,12 +475,13 @@

to_chat(user, message)

/datum/emote/sound/beep
/datum/emote/beep
key = "beep"
key_third_person = "beeps"
message = "beeps."
message_param = "beeps at %t."
sound = 'sound/machines/twobeep.ogg'
mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon)

/datum/emote/living/circle
key = "circle"
Expand Down
18 changes: 9 additions & 9 deletions code/modules/mob/living/silicon/robot/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mob_type_allowed_typecache = list(/mob/living/silicon)
emote_type = EMOTE_AUDIBLE

/datum/emote/sound/silicon
/datum/emote/silicon
mob_type_allowed_typecache = list(/mob/living/silicon)
emote_type = EMOTE_AUDIBLE

Expand All @@ -11,50 +11,50 @@
key_third_person = "boops"
message = "boops."

/datum/emote/sound/silicon/buzz
/datum/emote/silicon/buzz
key = "buzz"
key_third_person = "buzzes"
message = "buzzes."
message_param = "buzzes at %t."
sound = 'sound/machines/buzz-sigh.ogg'

/datum/emote/sound/silicon/buzz2
/datum/emote/silicon/buzz2
key = "buzz2"
message = "buzzes twice."
sound = 'sound/machines/buzz-two.ogg'

/datum/emote/sound/silicon/chime
/datum/emote/silicon/chime
key = "chime"
key_third_person = "chimes"
message = "chimes."
sound = 'sound/machines/chime.ogg'

/datum/emote/sound/silicon/honk
/datum/emote/silicon/honk
key = "honk"
key_third_person = "honks"
message = "honks."
vary = TRUE
sound = 'sound/items/bikehorn.ogg'

/datum/emote/sound/silicon/ping
/datum/emote/silicon/ping
key = "ping"
key_third_person = "pings"
message = "pings."
message_param = "pings at %t."
sound = 'sound/machines/ping.ogg'

/datum/emote/sound/silicon/chime
/datum/emote/silicon/chime
key = "chime"
key_third_person = "chimes"
message = "chimes."
sound = 'sound/machines/chime.ogg'

/datum/emote/sound/silicon/sad
/datum/emote/silicon/sad
key = "sad"
message = "plays a sad trombone..."
sound = 'sound/misc/sadtrombone.ogg'

/datum/emote/sound/silicon/warn
/datum/emote/silicon/warn
key = "warn"
message = "blares an alarm!"
sound = 'sound/machines/warning-buzzer.ogg'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/datum/emote/sound/gorilla
/datum/emote/gorilla
mob_type_allowed_typecache = /mob/living/simple_animal/hostile/gorilla
mob_type_blacklist_typecache = list()

/datum/emote/sound/gorilla/ooga
/datum/emote/gorilla/ooga
key = "ooga"
key_third_person = "oogas"
message = "oogas."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,3 @@
user.gib() //can you belive I forgot to put this here?? yeah you need to see the message BEFORE you gib
priority_announce("What the fuck was that?!", "General Alert")
qdel(B)

Loading

0 comments on commit 317a3c2

Please sign in to comment.