diff --git a/code/__DEFINES/dcs/signals/signals_client.dm b/code/__DEFINES/dcs/signals/signals_client.dm
index 36a60c153d0f..e3da9d31ba97 100644
--- a/code/__DEFINES/dcs/signals/signals_client.dm
+++ b/code/__DEFINES/dcs/signals/signals_client.dm
@@ -27,3 +27,6 @@
/// Called when something is removed from a client's screen : /client/proc/remove_from_screen(screen_remove)
#define COMSIG_CLIENT_SCREEN_REMOVE "client_screen_remove"
+
+/// From movement.dm: /atom/movable/proc/Moved(atom/oldloc, direction, Forced = FALSE)
+#define COMSIG_CLIENT_MOB_MOVED "client_mob_moved"
diff --git a/code/datums/diseases/black_goo.dm b/code/datums/diseases/black_goo.dm
index 6fb74bc82bd4..056034d32fb2 100644
--- a/code/datums/diseases/black_goo.dm
+++ b/code/datums/diseases/black_goo.dm
@@ -155,7 +155,7 @@
human.remove_language(LANGUAGE_ENGLISH) // You lose the ability to understand english. Language processing is handled in the mind not the body.
var/datum/species/zombie/zombie_species = GLOB.all_species[SPECIES_ZOMBIE]
zombie_species.handle_alert_ghost(human)
- playsound(human.loc, 'sound/hallucinations/wail.ogg', 25, 1)
+ playsound(human, 'sound/hallucinations/wail.ogg', 25, 1)
human.jitteriness = 0
human.set_species(SPECIES_ZOMBIE)
stage = 4
diff --git a/code/datums/soundOutput.dm b/code/datums/soundOutput.dm
index 6ebc32c7e41f..ccbda3cc0a8f 100644
--- a/code/datums/soundOutput.dm
+++ b/code/datums/soundOutput.dm
@@ -4,6 +4,8 @@
var/list/soundscape_playlist = list() //Updated on changing areas
var/ambience = null //The file currently being played as ambience
var/status_flags = 0 //For things like ear deafness, psychodelic effects, and other things that change how all sounds behave
+ var/list/current_sounds = list()
+ var/list/source_sounds = list()
/// Currently applied environmental reverb.
VAR_PROTECTED/owner_environment = SOUND_ENVIRONMENT_NONE
@@ -13,18 +15,56 @@
qdel(src)
return
owner = client
- RegisterSignal(owner.mob, COMSIG_MOVABLE_MOVED, PROC_REF(on_mob_moved))
- RegisterSignal(owner.mob, COMSIG_MOB_LOGOUT, PROC_REF(on_mob_logout))
+ RegisterSignal(owner, COMSIG_CLIENT_MOB_MOVED, PROC_REF(on_mob_moved))
RegisterSignal(owner, COMSIG_CLIENT_MOB_LOGGED_IN, PROC_REF(on_client_mob_logged_in))
return ..()
/datum/soundOutput/Destroy()
- UnregisterSignal(owner.mob, list(COMSIG_MOVABLE_MOVED, COMSIG_MOB_LOGOUT))
+ UnregisterSignal(owner, COMSIG_CLIENT_MOB_MOVED)
UnregisterSignal(owner, COMSIG_CLIENT_MOB_LOGGED_IN)
owner = null
return ..()
-/datum/soundOutput/proc/process_sound(datum/sound_template/T)
+#define SMOOTHING 8 // [1, 32], 32 Means best sound most lag 1 Means worst sound least lag
+
+/datum/soundOutput/proc/update_sounds(atom/user, direction)
+ SIGNAL_HANDLER
+ for(var/channel in current_sounds)
+ for(var/i in 0 to round(32/SMOOTHING))
+ i = i * SMOOTHING
+ switch(direction)
+ if(1)
+ process_sound(current_sounds[channel], TRUE, 0, -1+i/32)
+ if(2)
+ process_sound(current_sounds[channel], TRUE, 0, 1-i/32)
+ if(4)
+ process_sound(current_sounds[channel], TRUE, -1+i/32, 0)
+ if(8)
+ process_sound(current_sounds[channel], TRUE, 1-i/32, 0)
+
+/datum/soundOutput/proc/update_sounds_from_source(datum/source, atom/oldloc, direction, Forced)
+ SIGNAL_HANDLER
+ for(var/channel in source_sounds)
+ if(source_sounds[channel] == source)
+ var/datum/sound_template/template = current_sounds[channel]
+ for(var/i in 0 to round(32/SMOOTHING))
+ i = i * SMOOTHING
+ switch(direction)
+ if(1)
+ process_sound(template, TRUE, 0, 1-i/32)
+ if(2)
+ process_sound(template, TRUE, 0, -1+i/32)
+ if(4)
+ process_sound(template, TRUE, 1-i/32, 0)
+ if(8)
+ process_sound(template, TRUE, -1+i/32, 0)
+ break
+
+/datum/soundOutput/proc/remove_sound(channel)
+ current_sounds -= channel
+ source_sounds -= channel
+
+/datum/soundOutput/proc/process_sound(datum/sound_template/T, update=FALSE, offset_x = 0, offset_y = 0)
var/sound/S = sound(T.file, T.wait, T.repeat)
S.volume = owner.volume_preferences[T.volume_cat] * T.volume
if(T.channel == 0)
@@ -33,8 +73,27 @@
S.channel = T.channel
S.frequency = T.frequency
S.falloff = T.falloff
- S.status = T.status
- if(T.x && T.y && T.z)
+ S.params = list("on-end" = ".soundend [S.channel]")
+
+ if(!update)
+ S.status = T.status
+ else
+ S.status = SOUND_UPDATE
+
+ var/positional_sound = TRUE
+ var/turf/source_turf
+ if(T.source && !QDELETED(T.source))
+ source_turf = get_turf(T.source)
+
+ if(!update && istype(T.source, /atom/movable) && T.source != owner.mob)
+ source_sounds[num2text(T.channel)] = T.source
+ RegisterSignal(T.source, COMSIG_MOVABLE_MOVED, PROC_REF(update_sounds_from_source))
+ else if (T.x && T.y && T.z)
+ source_turf = locate(T.x, T.y, T.z)
+ else
+ positional_sound = FALSE
+
+ if(positional_sound)
var/turf/owner_turf = get_turf(owner.mob)
if(owner_turf)
// We're in an interior and sound came from outside
@@ -46,16 +105,29 @@
return // Invalid location
S.falloff /= 2
owner_turf = candidate
- S.x = T.x - owner_turf.x
+ S.x = source_turf.x - owner_turf.x + offset_x
S.y = 0
- S.z = T.y - owner_turf.y
+ S.z = source_turf.y - owner_turf.y + offset_y
S.y += T.y_s_offset
S.x += T.x_s_offset
- S.echo = SOUND_ECHO_REVERB_ON //enable environment reverb for positional sounds
+ S.echo = SOUND_ECHO_REVERB_ON
+
+ if(!update && T.source && T.source != owner.mob)
+ current_sounds[num2text(S.channel)] = T
+
if(owner.mob.ear_deaf > 0)
- S.status |= SOUND_MUTE
+ S.status |= SOUND_MUTE
- sound_to(owner,S)
+ sound_to(owner, S)
+
+/client/verb/sound_ended(channel as num)
+ set name = ".soundend"
+
+ soundOutput.remove_sound(num2text(channel))
+
+/datum/soundOutput/proc/on_client_mob_logged_in(datum/source, mob/new_mob)
+ SIGNAL_HANDLER //COMSIG_CLIENT_MOB_LOGGED_IN
+ update_mob_environment_override()
/datum/soundOutput/proc/update_ambience(area/target_area, ambience_override, force_update = FALSE)
var/status_flags = SOUND_STREAM
@@ -165,19 +237,10 @@
src.owner_environment = new_environment
-/datum/soundOutput/proc/on_mob_moved(datum/source, atom/oldloc, direction, Forced)
- SIGNAL_HANDLER //COMSIG_MOVABLE_MOVED
+/datum/soundOutput/proc/on_mob_moved(atom/source, direction)
+ SIGNAL_HANDLER //COMSIG_CLIENT_MOB_MOVED
update_area_environment()
-
-/datum/soundOutput/proc/on_mob_logout(datum/source)
- SIGNAL_HANDLER //COMSIG_MOB_LOGOUT
- UnregisterSignal(owner.mob, list(COMSIG_MOVABLE_MOVED, COMSIG_MOB_LOGOUT))
-
-/datum/soundOutput/proc/on_client_mob_logged_in(datum/source, mob/new_mob)
- SIGNAL_HANDLER //COMSIG_CLIENT_MOB_LOGGED_IN
- RegisterSignal(owner.mob, COMSIG_MOVABLE_MOVED, PROC_REF(on_mob_moved))
- RegisterSignal(owner.mob, COMSIG_MOB_LOGOUT, PROC_REF(on_mob_logout))
- update_mob_environment_override()
+ update_sounds(source, direction)
/client/proc/adjust_volume_prefs(volume_key, prompt = "", channel_update = 0)
volume_preferences[volume_key] = (tgui_input_number(src, prompt, "Volume", volume_preferences[volume_key]*100)) / 100
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index 563c4b89c590..a3a030470d18 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -452,7 +452,7 @@
/obj/structure/machinery/bot/mulebot/proc/load(atom/movable/C)
if((wires & WIRE_LOADCHECK) && !istype(C,/obj/structure/closet/crate))
src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.")
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 0)
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 25, 0)
return // if not emagged, only allow crates to be loaded
//I'm sure someone will come along and ask why this is here... well people were dragging screen items onto the mule, and that was not cool.
@@ -636,25 +636,25 @@
mode = 4
if(blockcount == 3)
src.visible_message("[src] makes an annoyed buzzing sound", "You hear an electronic buzzing sound.")
- playsound(src.loc, 'sound/machines/buzz-two.ogg', 25, 0)
+ playsound(src, 'sound/machines/buzz-two.ogg', 25, 0)
if(blockcount > 5) // attempt 5 times before recomputing
// find new path excluding blocked turf
src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.")
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 0)
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 25, 0)
spawn(2)
calc_path(next)
if(length(path) > 0)
src.visible_message("[src] makes a delighted ping!", "You hear a ping.")
- playsound(src.loc, 'sound/machines/ping.ogg', 25, 0)
+ playsound(src, 'sound/machines/ping.ogg', 25, 0)
mode = 4
mode =6
return
return
else
src.visible_message("[src] makes an annoyed buzzing sound", "You hear an electronic buzzing sound.")
- playsound(src.loc, 'sound/machines/buzz-two.ogg', 25, 0)
+ playsound(src, 'sound/machines/buzz-two.ogg', 25, 0)
mode = 5
return
else
@@ -671,11 +671,11 @@
blockcount = 0
mode = 4
src.visible_message("[src] makes a delighted ping!", "You hear a ping.")
- playsound(src.loc, 'sound/machines/ping.ogg', 25, 0)
+ playsound(src, 'sound/machines/ping.ogg', 25, 0)
else
src.visible_message("[src] makes a sighing buzz.", "You hear an electronic buzzing sound.")
- playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 25, 0)
+ playsound(src, 'sound/machines/buzz-sigh.ogg', 25, 0)
mode = 7
//if(6)
@@ -720,7 +720,7 @@
/obj/structure/machinery/bot/mulebot/proc/at_target()
if(!reached_target)
src.visible_message("[src] makes a chiming sound!", "You hear a chime.")
- playsound(src.loc, 'sound/machines/chime.ogg', 25, 0)
+ playsound(src, 'sound/machines/chime.ogg', 25, 0)
reached_target = 1
if(load) // if loaded, unload at target
@@ -770,7 +770,7 @@
// when mulebot is in the same loc
/obj/structure/machinery/bot/mulebot/proc/RunOver(mob/living/carbon/human/H)
src.visible_message(SPAN_DANGER("[src] drives over [H]!"))
- playsound(src.loc, 'sound/effects/splat.ogg', 25, 1)
+ playsound(src, 'sound/effects/splat.ogg', 25, 1)
var/damage = rand(5,15)
H.apply_damage(2*damage, BRUTE, "head")
diff --git a/code/game/sound.dm b/code/game/sound.dm
index 549564cf8ee9..f936e7517dc9 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -18,6 +18,7 @@
var/z
var/y_s_offset // Vertical sound offset
var/x_s_offset // Horizontal sound offset
+ var/atom/source
/proc/get_free_channel()
var/static/cur_chan = 1
@@ -72,6 +73,7 @@
S.x = turf_source.x
S.y = turf_source.y
S.z = turf_source.z
+ S.source = source
if(!SSinterior)
SSsound.queue(S)
diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm
index 76ebbed06de6..32cb615bf0b1 100644
--- a/code/modules/mob/living/carbon/human/human_abilities.dm
+++ b/code/modules/mob/living/carbon/human/human_abilities.dm
@@ -347,7 +347,7 @@ CULT
H.put_in_any_hand_if_possible(new /obj/item/device/flashlight, FALSE, TRUE)
- playsound(H.loc, 'sound/voice/scream_horror1.ogg', 25)
+ playsound(H, 'sound/voice/scream_horror1.ogg', 25)
H.visible_message(SPAN_HIGHDANGER("[H] puts on their robes."), SPAN_WARNING("You put on your robes."))
for(var/datum/action/human_action/activable/cult/obtain_equipment/O in H.actions)
diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm
index c95efd8a2995..090a1672b518 100644
--- a/code/modules/mob/living/carbon/human/say.dm
+++ b/code/modules/mob/living/carbon/human/say.dm
@@ -160,7 +160,7 @@
if(M != src)
M.show_message(SPAN_NOTICE("[src] talks into [length(used_radios) ? used_radios[1] : "the radio."]"), SHOW_MESSAGE_VISIBLE)
if(ishumansynth_strict(src))
- playsound(src.loc, 'sound/effects/radiostatic.ogg', 15, 1)
+ playsound(src, 'sound/effects/radiostatic.ogg', 15, 1)
italics = 1
message_range = 2
diff --git a/code/modules/mob/living/carbon/human/species/zombie.dm b/code/modules/mob/living/carbon/human/species/zombie.dm
index 4e8a0b5e98e2..4823463240a5 100644
--- a/code/modules/mob/living/carbon/human/species/zombie.dm
+++ b/code/modules/mob/living/carbon/human/species/zombie.dm
@@ -80,9 +80,9 @@
/datum/species/zombie/handle_unique_behavior(mob/living/carbon/human/zombie)
if(prob(5))
- playsound(zombie.loc, basic_moan, 15, basic_variance)
+ playsound(zombie, basic_moan, 15, basic_variance)
else if(prob(5))
- playsound(zombie.loc, rare_moan, 15, rare_variance)
+ playsound(zombie, rare_moan, 15, rare_variance)
/datum/species/zombie/handle_death(mob/living/carbon/human/zombie, gibbed)
set waitfor = FALSE
diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm
index 09b99871e936..2da22826273f 100644
--- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm
+++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm
@@ -136,7 +136,7 @@
if(hugger.stat != DEAD)
hugger.die()
- playsound(xeno.loc, pick(xeno.screech_sound_effect_list), 75, 0, status = 0)
+ playsound(xeno, pick(xeno.screech_sound_effect_list), 75, 0, status = 0)
xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] emits an ear-splitting guttural roar!"))
xeno.create_shriekwave(14) //Adds the visual effect. Wom wom wom, 14 shriekwaves
diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm
index 9a87f10d74a3..91fec9fcdb35 100644
--- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm
@@ -293,9 +293,9 @@
human.disable_lights()
human.disable_special_items()
if(ishuman_strict(human))
- playsound(loc, human.gender == "male" ? 'sound/misc/facehugged_male.ogg' : 'sound/misc/facehugged_female.ogg' , 25, 0)
+ playsound(human, human.gender == "male" ? 'sound/misc/facehugged_male.ogg' : 'sound/misc/facehugged_female.ogg' , 25, 0)
else if(isyautja(human))
- playsound(loc, 'sound/voice/pred_facehugged.ogg', 65, FALSE)
+ playsound(human, 'sound/voice/pred_facehugged.ogg', 65, FALSE)
if(!sterile)
if(!human.species || !(human.species.flags & IS_SYNTHETIC)) //synthetics aren't paralyzed
human.apply_effect(MIN_IMPREGNATION_TIME * 0.5 * knockout_mod, PARALYZE) //THIS MIGHT NEED TWEAKS
@@ -435,7 +435,7 @@
stat = DEAD
flags_inventory &= ~CANTSTRIP
visible_message("[icon2html(src, viewers(src))] \The [src] curls up into a ball!")
- playsound(src.loc, 'sound/voice/alien_facehugger_dies.ogg', 25, 1)
+ playsound(src, 'sound/voice/alien_facehugger_dies.ogg', 25, 1)
if(ismob(loc)) //Make it fall off the person so we can update their icons. Won't update if they're in containers thou
var/mob/holder_mob = loc
diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
index e93b4fd8a472..04ffe54f2881 100644
--- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
+++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
@@ -319,7 +319,7 @@
if (pounceAction.freeze_self)
if(pounceAction.freeze_play_sound)
- playsound(loc, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1)
+ playsound(src, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1)
ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce"))
pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze_pounce)), pounceAction.freeze_time, TIMER_STOPPABLE)
pounceAction.additional_effects(M)
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm
index 87657af5ce7a..f370d5e7f8cc 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm
@@ -138,7 +138,7 @@
R.take_damage_type(40 / A.acid_delay, "acid", src)
visible_message(SPAN_XENOWARNING("[src] vomits globs of vile stuff at \the [O]. It sizzles under the bubbling mess of acid!"), \
SPAN_XENOWARNING("We vomit globs of vile stuff at [O]. It sizzles under the bubbling mess of acid!"), null, 5)
- playsound(loc, "sound/bullets/acid_impact1.ogg", 25)
+ playsound(O, "sound/bullets/acid_impact1.ogg", 25)
QDEL_IN(A, 20)
return
@@ -158,7 +158,7 @@
attack_log += text("\[[time_stamp()]\] Spat acid on [O]")
visible_message(SPAN_XENOWARNING("[src] vomits globs of vile stuff all over [O]. It begins to sizzle and melt under the bubbling mess of acid!"), \
SPAN_XENOWARNING("We vomit globs of vile stuff all over [O]. It begins to sizzle and melt under the bubbling mess of acid!"), null, 5)
- playsound(loc, "sound/bullets/acid_impact1.ogg", 25)
+ playsound(O, "sound/bullets/acid_impact1.ogg", 25)
/proc/unroot_human(mob/living/carbon/H, trait_source)
if (!isxeno_human(H))
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm
index 8117eade469a..cc2361a42120 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm
@@ -45,7 +45,7 @@
COMSIG_LIVING_FLAMER_FLAMED,
), PROC_REF(flamer_crossed_immune))
add_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow"))
- playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25)
+ playsound(src, 'sound/effects/burrowing_b.ogg', 25)
update_icons()
addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS))
burrow_timer = world.time + 90 // How long we can be burrowed
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm
index 014cb3d2f24b..a446e11033fb 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm
@@ -757,7 +757,7 @@
if(xeno.ammo.spit_windup)
spitting = TRUE
if(xeno.ammo.pre_spit_warn)
- playsound(xeno.loc,"alien_drool", 55, 1)
+ playsound(xeno, "alien_drool", 55, 1)
to_chat(xeno, SPAN_WARNING("We begin to prepare a large spit!"))
xeno.visible_message(SPAN_WARNING("[xeno] prepares to spit a massive glob!"),\
SPAN_WARNING("We begin to spit [xeno.ammo.name]!"))
@@ -775,7 +775,7 @@
xeno.visible_message(SPAN_XENOWARNING("[xeno] spits at [atom]!"), \
SPAN_XENOWARNING("We spit [xeno.ammo.name] at [atom]!") )
- playsound(xeno.loc, sound_to_play, 25, 1)
+ playsound(xeno, sound_to_play, 25, 1)
var/obj/projectile/proj = new (current_turf, create_cause_data(xeno.ammo.name, xeno))
proj.generate_bullet(xeno.ammo)
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm
index 3ec4855f9c3a..13ef448bbeb5 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm
@@ -10,7 +10,7 @@
if(!check_and_use_plasma_owner())
return
- playsound(xeno.loc, pick(predalien_roar), 75, 0, status = 0)
+ playsound(xeno, pick(predalien_roar), 75, 0, status = 0)
xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] emits a guttural roar!"))
xeno.create_shriekwave(7) //Adds the visual effect. Wom wom wom, 7 shriekwaves
for(var/mob/living/carbon/carbon in view(7, xeno))
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/runner/runner_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/runner/runner_powers.dm
index f5e090bc7e4b..37e5083ab924 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/runner/runner_powers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/runner/runner_powers.dm
@@ -126,7 +126,7 @@
multitile_vehicle.take_damage_type(20 / acid.acid_delay, "acid", src)
visible_message(SPAN_XENOWARNING("[src] vomits globs of vile stuff at [multitile_vehicle]. It sizzles under the bubbling mess of acid!"), \
SPAN_XENOWARNING("We vomit globs of vile stuff at [multitile_vehicle]. It sizzles under the bubbling mess of acid!"), null, 5)
- playsound(loc, "sound/bullets/acid_impact1.ogg", 25)
+ playsound(affected_atom, "sound/bullets/acid_impact1.ogg", 25)
QDEL_IN(acid, 20)
return
@@ -135,7 +135,7 @@
visible_message(SPAN_XENOWARNING("[src] vomits globs of vile stuff all over [affected_atom]. It begins to sizzle and melt under the bubbling mess of acid!"), \
SPAN_XENOWARNING("We vomit globs of vile stuff all over [affected_atom]. It begins to sizzle and melt under the bubbling mess of acid!"), null, 5)
- playsound(loc, "sound/bullets/acid_impact1.ogg", 25)
+ playsound(affected_atom, "sound/bullets/acid_impact1.ogg", 25)
/datum/action/xeno_action/activable/acider_for_the_hive/use_ability(atom/affected_atom)
diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/sentinel/sentinel_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/sentinel/sentinel_powers.dm
index 1ed8863c231a..b966e7497beb 100644
--- a/code/modules/mob/living/carbon/xenomorph/abilities/sentinel/sentinel_powers.dm
+++ b/code/modules/mob/living/carbon/xenomorph/abilities/sentinel/sentinel_powers.dm
@@ -18,7 +18,7 @@
xeno.visible_message(SPAN_XENOWARNING("[xeno] spits at [target]!"), \
SPAN_XENOWARNING("You spit at [target]!") )
var/sound_to_play = pick(1, 2) == 1 ? 'sound/voice/alien_spitacid.ogg' : 'sound/voice/alien_spitacid2.ogg'
- playsound(xeno.loc, sound_to_play, 25, 1)
+ playsound(xeno, sound_to_play, 25, 1)
xeno.ammo = GLOB.ammo_list[/datum/ammo/xeno/toxin]
var/obj/projectile/projectile = new /obj/projectile(current_turf, create_cause_data(initial(xeno.caste_type), xeno))
@@ -50,7 +50,7 @@
xeno.visible_message(SPAN_XENOWARNING("[xeno] spits at [target]!"), \
SPAN_XENOWARNING("You spit at [target]!") )
var/sound_to_play = pick(1, 2) == 1 ? 'sound/voice/alien_spitacid.ogg' : 'sound/voice/alien_spitacid2.ogg'
- playsound(xeno.loc, sound_to_play, 25, 1)
+ playsound(xeno, sound_to_play, 25, 1)
xeno.ammo = GLOB.ammo_list[/datum/ammo/xeno/toxin/shotgun]
var/obj/projectile/projectile = new /obj/projectile(current_turf, create_cause_data(initial(xeno.caste_type), xeno))
diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
index 9d42eb982d2e..aedb1a4c48df 100644
--- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
+++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
@@ -237,7 +237,7 @@
return FALSE
// Otherwise, ""roar""!
- playsound(loc, "alien_roar_larva", 15)
+ playsound(src, "alien_roar_larva", 15)
return TRUE
/mob/living/carbon/xenomorph/facehugger/get_status_tab_items()
diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm
index 8dc427e2c55e..b846bfd5b356 100644
--- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm
+++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm
@@ -176,7 +176,7 @@
return FALSE
// Otherwise, ""roar""!
- playsound(loc, "alien_roar_larva", 15)
+ playsound(src, "alien_roar_larva", 15)
return TRUE
/mob/living/carbon/xenomorph/larva/is_xeno_grabbable()
diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
index 40ffbd55086e..4189c70780f0 100644
--- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
+++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
@@ -399,7 +399,7 @@
if(!should_block_game_interaction(src))//so admins can safely spawn Queens in Thunderdome for tests.
xeno_message(SPAN_XENOANNOUNCE("A new Queen has risen to lead the Hive! Rejoice!"),3,hivenumber)
notify_ghosts(header = "New Queen", message = "A new Queen has risen.", source = src, action = NOTIFY_ORBIT)
- playsound(loc, 'sound/voice/alien_queen_command.ogg', 75, 0)
+ playsound(src, 'sound/voice/alien_queen_command.ogg', 75, 0)
set_resin_build_order(GLOB.resin_build_order_drone)
for(var/datum/action/xeno_action/action in actions)
// Also update the choose_resin icon since it resets
@@ -522,7 +522,7 @@
if(stat != DEAD)
if(++breathing_counter >= rand(22, 27)) //Increase the breathing variable each tick. Play it at random intervals.
- playsound(loc, pick('sound/voice/alien_queen_breath1.ogg', 'sound/voice/alien_queen_breath2.ogg'), 15, 1, 4)
+ playsound(src, pick('sound/voice/alien_queen_breath1.ogg', 'sound/voice/alien_queen_breath2.ogg'), 15, 1, 4)
breathing_counter = 0 //Reset the counter
if(observed_xeno)
diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm
index 1657d078ffda..d3178ff4c203 100644
--- a/code/modules/mob/living/carbon/xenomorph/life.dm
+++ b/code/modules/mob/living/carbon/xenomorph/life.dm
@@ -225,7 +225,7 @@
if(ishuman(M))
if(world.time > devour_timer - 50 && world.time < devour_timer - 30)
to_chat(src, SPAN_WARNING("We're about to regurgitate [M]..."))
- playsound(loc, 'sound/voice/alien_drool1.ogg', 50, 1)
+ playsound(src, 'sound/voice/alien_drool1.ogg', 50, 1)
var/mob/living/carbon/human/H = M
if(world.time > devour_timer || (H.stat == DEAD && !H.chestburst))
regurgitate(H)
diff --git a/code/modules/mob/living/carbon/xenomorph/say.dm b/code/modules/mob/living/carbon/xenomorph/say.dm
index 9f99cdb45455..8c7457f55ee8 100644
--- a/code/modules/mob/living/carbon/xenomorph/say.dm
+++ b/code/modules/mob/living/carbon/xenomorph/say.dm
@@ -76,7 +76,7 @@
if(forced)
if(speaking_noise)
- playsound(loc, speaking_noise, 25, 1)
+ playsound(src, speaking_noise, 25, 1)
..(message, speaking, verb, null, null, message_range, null)
else
hivemind_talk(message)
diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/carrier/eggsac.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/carrier/eggsac.dm
index 61c03803841b..67537a41a780 100644
--- a/code/modules/mob/living/carbon/xenomorph/strains/castes/carrier/eggsac.dm
+++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/carrier/eggsac.dm
@@ -24,7 +24,7 @@
carrier.recalculate_pheromones()
if(carrier.huggers_cur)
- playsound(carrier.loc, 'sound/voice/alien_facehugger_dies.ogg', 25, TRUE)
+ playsound(carrier, 'sound/voice/alien_facehugger_dies.ogg', 25, TRUE)
carrier.huggers_cur = 0
carrier.huggers_max = 0
carrier.update_hugger_overlays()
@@ -80,7 +80,7 @@
my_egg.start_unstoppable_decay()
M.visible_message(SPAN_XENOWARNING("[M] throes as its eggsac bursts into a mess of acid!"))
- playsound(M.loc, 'sound/effects/alien_egg_burst.ogg', 25, TRUE)
+ playsound(M, 'sound/effects/alien_egg_burst.ogg', 25, TRUE)
///Remove all references to src in eggs_sustained
/datum/behavior_delegate/carrier_eggsac/Destroy()
diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm
index 272bc289b2ec..19fcea1c4bd6 100644
--- a/code/modules/mob/living/simple_animal/friendly/cat.dm
+++ b/code/modules/mob/living/simple_animal/friendly/cat.dm
@@ -62,7 +62,7 @@
if((src.loc) && isturf(src.loc))
if(stat != DEAD)
if(++miaow_counter >= rand(20, 30)) //Increase the meow variable each tick. Play it at random intervals.
- playsound(loc, "cat_meow", 15, 1, 4)
+ playsound(src, "cat_meow", 15, 1, 4)
miaow_counter = 0 //Reset the counter
if(!stat && !resting && !buckled)
for(var/mob/prey in view(1,src))
diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm
index 3f9a51355292..38febcbfa9fc 100644
--- a/code/modules/mob/living/simple_animal/hostile/alien.dm
+++ b/code/modules/mob/living/simple_animal/hostile/alien.dm
@@ -137,7 +137,7 @@
/mob/living/simple_animal/hostile/alien/proc/roar_emote()
visible_message("The [name] roars!")
- playsound(loc, "alien_roar", 40)
+ playsound(src, "alien_roar", 40)
/mob/living/simple_animal/hostile/alien/death(cause, gibbed, deathmessage = "lets out a waning guttural screech, green blood bubbling from its maw. The caustic acid starts melting the body away...")
. = ..()
diff --git a/code/modules/movement/movement.dm b/code/modules/movement/movement.dm
index e12a5b439296..d889f6e342ba 100644
--- a/code/modules/movement/movement.dm
+++ b/code/modules/movement/movement.dm
@@ -92,6 +92,10 @@
/atom/movable/proc/Moved(atom/oldloc, direction, Forced = FALSE)
SEND_SIGNAL(src, COMSIG_MOVABLE_MOVED, oldloc, direction, Forced)
+ if(ismob(src))
+ var/mob/moved = src
+ if(moved.client)
+ SEND_SIGNAL(moved.client, COMSIG_CLIENT_MOB_MOVED, direction)
for(var/datum/dynamic_light_source/light as anything in hybrid_light_sources)
light.source_atom.update_light()
if(!isturf(loc))