Add an equivalent to balloon_alert_to_viewers, but for hearing (#95376)

This commit is contained in:
Cody Brittain
2026-03-17 17:28:27 -04:00
committed by GitHub
parent 2ba464b013
commit 965c4a40a9
9 changed files with 23 additions and 9 deletions
+2 -2
View File
@@ -47,12 +47,12 @@
var/turf/user_turf = get_turf(user)
var/atom/movable/dragged = user.pulling
user.forceMove(destination_turf)
user_turf.balloon_alert_to_viewers("(pop)")
user_turf.balloon_alert_to_hearers("*pop*")
if(dragged)
var/turf/dragged_turf = get_turf(dragged)
dragged.forceMove(destination_turf)
user.start_pulling(dragged, force = TRUE)
dragged_turf.balloon_alert_to_viewers("(pop)")
dragged_turf.balloon_alert_to_hearers("*pop*")
to_chat(list(user, dragged), span_notice("You blink and find yourself in <b>[get_area_name(destination_turf)]</b>."))
user.emote("blink")
@@ -75,7 +75,7 @@
if (explode_timer)
return
explode_timer = addtimer(CALLBACK(src, PROC_REF(explode), source), 0.5 SECONDS)
source.balloon_alert_to_viewers("beep")
source.balloon_alert_to_hearers("*beep*")
playsound(parent, triggered_sound, 50, FALSE)
return
+1 -1
View File
@@ -259,7 +259,7 @@
var/atom/atom_parent = parent
usb_cable.forceMove(atom_parent.drop_location())
usb_cable.balloon_alert_to_viewers("snap")
usb_cable.balloon_alert_to_hearers("*snap*")
physical_object = null
attached_circuit = null
@@ -34,7 +34,7 @@
/turf/open/misc/snow,
))
if(severity < required_strength)
balloon_alert_to_viewers("crack!")
balloon_alert_to_hearers("*crack*")
playsound(source = src, soundin = SFX_HULL_CREAKING, vol = 50, vary = TRUE, pressure_affected = FALSE, ignore_walls = TRUE)
return //return ominous sounds when we're under the threshold.
+1 -1
View File
@@ -353,7 +353,7 @@
*/
/turf/open/lava/proc/drop_contents_into_lava()
SIGNAL_HANDLER
balloon_alert_to_viewers("[pick("splash","pshhhh","hiss","blorble")]!")
balloon_alert_to_hearers("[pick("splash","pshhhh","hiss","blorble")]!")
playsound(src, 'sound/items/match_strike.ogg', 15, TRUE)
for(var/atom/movable/each_content as anything in contents)
on_atom_inited(src, each_content)
@@ -34,6 +34,20 @@
balloon_alert(hearer, (hearer == src && self_message) || message)
/// Create balloon alerts (text that floats up) to everything within range.
/// Will only display to people who can hear.
/atom/proc/balloon_alert_to_hearers(message, self_message, hearing_distance = DEFAULT_MESSAGE_RANGE, list/ignored_mobs)
SHOULD_NOT_SLEEP(TRUE)
var/list/hearers = get_hearers_in_view(hearing_distance, src, RECURSIVE_CONTENTS_CLIENT_MOBS)
hearers -= ignored_mobs
for (var/mob/hearer in hearers)
if(HAS_TRAIT(hearer, TRAIT_DEAF))
continue
balloon_alert(hearer, (hearer == src && self_message) || message)
// Do not use.
// MeasureText blocks. I have no idea for how long.
// I would've made the maptext_height update on its own, but I don't know
+1 -1
View File
@@ -224,7 +224,7 @@
return !user.contains(src)
/obj/item/gun/proc/shoot_with_empty_chamber(mob/living/user as mob|obj)
balloon_alert_to_viewers("*click*")
balloon_alert_to_hearers("*click*")
playsound(src, dry_fire_sound, dry_fire_sound_volume, TRUE)
/obj/item/gun/proc/fire_sounds()
@@ -472,7 +472,7 @@
/obj/item/gun/ballistic/automatic/battle_rifle/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0)
if(chambered.loaded_projectile && prob(75) && (emp_malfunction || degradation_stage == degradation_stage_max))
balloon_alert_to_viewers("*click*")
balloon_alert_to_hearers("*click*")
playsound(src, dry_fire_sound, dry_fire_sound_volume, TRUE)
return
@@ -615,7 +615,7 @@
/datum/component/construction/mecha/honker/custom_action(obj/item/I, mob/living/user, diff)
if(istype(I, /obj/item/bikehorn))
playsound(parent, 'sound/items/bikehorn.ogg', 50, TRUE)
user.balloon_alert_to_viewers("HONK!")
user.balloon_alert_to_hearers("*HONK*")
return TRUE
return ..()