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
+4 -4
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)