Simple Animals Ghostears Tweak (#10130)

This commit is contained in:
Geeves
2020-10-03 13:42:26 +02:00
committed by GitHub
parent 511f0d3ec5
commit 148ccde236
5 changed files with 22 additions and 13 deletions

View File

@@ -155,7 +155,7 @@ proc/get_radio_key_from_channel(var/channel)
return "asks"
return verb
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="")
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/ghost_hearing = GHOSTS_ALL_HEAR)
if(stat)
if(stat == DEAD)
return say_dead(message)
@@ -271,7 +271,7 @@ proc/get_radio_key_from_channel(var/channel)
italics = 1
sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
get_mobs_and_objs_in_view_fast(T, message_range, listening, listening_obj)
get_mobs_and_objs_in_view_fast(T, message_range, listening, listening_obj, ghost_hearing)
var/list/hear_clients = list()

View File

@@ -364,11 +364,13 @@
/mob/living/simple_animal/proc/speak_audio()
return
/mob/living/simple_animal/proc/visible_emote(var/act_desc, var/log_emote=1)
custom_emote(VISIBLE_MESSAGE, act_desc, log_emote)
/mob/living/simple_animal/proc/visible_emote(var/act_desc)
var/can_ghosts_hear = client ? GHOSTS_ALL_HEAR : ONLY_GHOSTS_IN_VIEW
custom_emote(VISIBLE_MESSAGE, act_desc, can_ghosts_hear)
/mob/living/simple_animal/proc/audible_emote(var/act_desc)
custom_emote(AUDIBLE_MESSAGE, act_desc)
var/can_ghosts_hear = client ? GHOSTS_ALL_HEAR : ONLY_GHOSTS_IN_VIEW
custom_emote(AUDIBLE_MESSAGE, act_desc, can_ghosts_hear)
/*
mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
@@ -603,7 +605,8 @@ mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
sound_chance = prob(50)
make_noise(sound_chance)
..(message, null, verb)
var/can_ghosts_hear = client ? GHOSTS_ALL_HEAR : ONLY_GHOSTS_IN_VIEW
..(message, null, verb, ghost_hearing = can_ghosts_hear)
/mob/living/simple_animal/do_animate_chat(var/message, var/datum/language/language, var/small, var/list/show_to, var/duration, var/list/message_override)
INVOKE_ASYNC(src, /atom/movable/proc/animate_chat, pick(speak), language, small, show_to, duration)

View File

@@ -110,7 +110,7 @@
// self_message (optional) is what the src mob sees e.g. "You do something!"
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
/mob/visible_message(var/message, var/self_message, var/blind_message, var/range = world.view)
/mob/visible_message(var/message, var/self_message, var/blind_message, var/range = world.view, var/show_observers = TRUE)
var/list/messageturfs = list() //List of turfs we broadcast to.
var/list/messagemobs = list() //List of living mobs nearby who can hear it, and distant ghosts who've chosen to hear it
for (var/turf in view(range, get_turf(src)))
@@ -124,7 +124,7 @@
continue
if (!M.client || istype(M, /mob/abstract/new_player))
continue
if((get_turf(M) in messageturfs) || (isobserver(M) && (M.client.prefs.toggles & CHAT_GHOSTSIGHT)))
if((get_turf(M) in messageturfs) || (show_observers && isobserver(M) && (M.client.prefs.toggles & CHAT_GHOSTSIGHT)))
messagemobs += M
for(var/A in messagemobs)
@@ -175,7 +175,7 @@
// self_message (optional) is what the src mob hears.
// deaf_message (optional) is what deaf people will see.
// hearing_distance (optional) is the range, how many tiles away the message can be heard.
/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message)
/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/ghost_hearing = GHOSTS_ALL_HEAR)
var/range = world.view
if(hearing_distance)
@@ -185,7 +185,7 @@
var/list/mobs = list()
var/list/objs = list()
get_mobs_and_objs_in_view_fast(T, range, mobs, objs)
get_mobs_and_objs_in_view_fast(T, range, mobs, objs, ghost_hearing)
for(var/m in mobs)