Skip to content

Commit

Permalink
jesus christ get me out of saycode
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeStylaLT committed Jan 7, 2025
1 parent 27f3114 commit 9f143b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/modules/mapping/space_management/multiz_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
. = list(center_z)
var/other_z = center_z
var/offset
while((offset = SSmapping.multiz_levels[other_z]["[DOWN]"]))
while((offset = SSmapping.multiz_levels[other_z][Z_LEVEL_DOWN]))
other_z -= offset
if(other_z in .)
break // no infinite loops
. += other_z
other_z = center_z
while((offset = SSmapping.multiz_levels[other_z]["[UP]"]))
while((offset = SSmapping.multiz_levels[other_z][Z_LEVEL_UP]))
other_z += offset
if(other_z in .)
break // no infinite loops
Expand Down
22 changes: 21 additions & 1 deletion code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,20 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
var/static/list/eavesdropping_modes = list(MODE_WHISPER = TRUE, MODE_WHISPER_CRIT = TRUE)
var/eavesdrop_range = 0
var/Zs_too = FALSE
var/listener_has_ceiling = TRUE
var/speaker_has_ceiling = TRUE

var/turf/speaker_turf = get_turf(src)
var/ceiling_turf = GET_TURF_ABOVE(speaker_turf)
if(ceiling_turf)
if(istransparentturf(ceiling_turf))
speaker_has_ceiling = FALSE
if(eavesdropping_modes[message_mode])
eavesdrop_range = EAVESDROP_EXTRA_RANGE
if(message_mode != MODE_WHISPER)
Zs_too = TRUE
if(say_test(message) == "2") //CIT CHANGE - ditto
message_range += 10
Zs_too = TRUE
// AZURE EDIT: thaumaturgical loudness (from orisons)
if (has_status_effect(/datum/status_effect/thaumaturgy))
spans |= SPAN_REALLYBIG
Expand Down Expand Up @@ -345,9 +353,21 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
var/rendered = compose_message(src, message_language, message, , spans, message_mode)
for(var/_AM in listening)
var/atom/movable/AM = _AM
var/turf/listener_turf = get_turf(_AM)
var/listener_ceiling = GET_TURF_ABOVE(listener_turf)
if(listener_ceiling)
if(istransparentturf(listener_ceiling))
listener_has_ceiling = FALSE
if(!Zs_too && !isobserver(AM))
if(AM.z != src.z)
continue
if(Zs_too)
if(AM.z < src.z && listener_has_ceiling) //Listener is below the speaker and has a ceiling above them
continue
if(AM.z > src.z && speaker_has_ceiling) //Listener is above the speaker and the speaker has a ceiling above
continue
if(listener_has_ceiling && speaker_has_ceiling && AM.z != src.z) //Both have a ceiling, on different z-levels -- no hearing at all
continue
if(eavesdrop_range && get_dist(source, AM) > message_range && !(the_dead[AM]))
AM.Hear(eavesrendered, src, message_language, eavesdropping, , spans, message_mode, original_message)
else
Expand Down

0 comments on commit 9f143b0

Please sign in to comment.