diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm
index ab2ba54431..0af06dc005 100644
--- a/code/controllers/subsystem/mapping.dm
+++ b/code/controllers/subsystem/mapping.dm
@@ -18,6 +18,8 @@ SUBSYSTEM_DEF(mapping)
var/list/shuttle_templates = list()
var/list/shelter_templates = list()
+ var/list/areas_in_z = list()
+
var/loading_ruins = FALSE
/datum/controller/subsystem/mapping/PreInit()
diff --git a/code/datums/looping_sounds/weather.dm b/code/datums/looping_sounds/weather.dm
new file mode 100644
index 0000000000..1867a097d3
--- /dev/null
+++ b/code/datums/looping_sounds/weather.dm
@@ -0,0 +1,47 @@
+/datum/looping_sound/active_outside_ashstorm
+ mid_sounds = list(
+ 'sound/weather/ashstorm/outside/active_mid1.ogg'=1,
+ 'sound/weather/ashstorm/outside/active_mid1.ogg'=1,
+ 'sound/weather/ashstorm/outside/active_mid1.ogg'=1
+ )
+ mid_length = 80
+ start_sound = 'sound/weather/ashstorm/outside/active_start.ogg'
+ start_length = 130
+ end_sound = 'sound/weather/ashstorm/outside/active_end.ogg'
+ volume = 80
+
+/datum/looping_sound/active_inside_ashstorm
+ mid_sounds = list(
+ 'sound/weather/ashstorm/inside/active_mid1.ogg'=1,
+ 'sound/weather/ashstorm/inside/active_mid2.ogg'=1,
+ 'sound/weather/ashstorm/inside/active_mid3.ogg'=1
+ )
+ mid_length = 80
+ start_sound = 'sound/weather/ashstorm/inside/active_start.ogg'
+ start_length = 130
+ end_sound = 'sound/weather/ashstorm/inside/active_end.ogg'
+ volume = 80
+
+/datum/looping_sound/weak_outside_ashstorm
+ mid_sounds = list(
+ 'sound/weather/ashstorm/outside/weak_mid1.ogg'=1,
+ 'sound/weather/ashstorm/outside/weak_mid2.ogg'=1,
+ 'sound/weather/ashstorm/outside/weak_mid3.ogg'=1
+ )
+ mid_length = 80
+ start_sound = 'sound/weather/ashstorm/outside/weak_start.ogg'
+ start_length = 130
+ end_sound = 'sound/weather/ashstorm/outside/weak_end.ogg'
+ volume = 50
+
+/datum/looping_sound/weak_inside_ashstorm
+ mid_sounds = list(
+ 'sound/weather/ashstorm/inside/weak_mid1.ogg'=1,
+ 'sound/weather/ashstorm/inside/weak_mid2.ogg'=1,
+ 'sound/weather/ashstorm/inside/weak_mid3.ogg'=1
+ )
+ mid_length = 80
+ start_sound = 'sound/weather/ashstorm/inside/weak_start.ogg'
+ start_length = 130
+ end_sound = 'sound/weather/ashstorm/inside/weak_end.ogg'
+ volume = 50
\ No newline at end of file
diff --git a/code/datums/weather/weather_types/ash_storm.dm b/code/datums/weather/weather_types/ash_storm.dm
index a1dc9ece69..14133c6a11 100644
--- a/code/datums/weather/weather_types/ash_storm.dm
+++ b/code/datums/weather/weather_types/ash_storm.dm
@@ -5,18 +5,15 @@
telegraph_message = "An eerie moan rises on the wind. Sheets of burning ash blacken the horizon. Seek shelter."
telegraph_duration = 300
- telegraph_sound = 'sound/lavaland/ash_storm_windup.ogg'
telegraph_overlay = "light_ash"
weather_message = "Smoldering clouds of scorching ash billow down around you! Get inside!"
weather_duration_lower = 600
weather_duration_upper = 1200
- weather_sound = 'sound/lavaland/ash_storm_start.ogg'
weather_overlay = "ash_storm"
end_message = "The shrieking wind whips away the last of the ash and falls to its usual murmur. It should be safe to go outside now."
end_duration = 300
- end_sound = 'sound/lavaland/ash_storm_end.ogg'
end_overlay = "light_ash"
area_type = /area/lavaland/surface/outdoors
@@ -26,6 +23,53 @@
probability = 90
+ var/datum/looping_sound/active_outside_ashstorm/sound_ao = new(list(), FALSE, TRUE)
+ var/datum/looping_sound/active_inside_ashstorm/sound_ai = new(list(), FALSE, TRUE)
+ var/datum/looping_sound/weak_outside_ashstorm/sound_wo = new(list(), FALSE, TRUE)
+ var/datum/looping_sound/weak_inside_ashstorm/sound_wi = new(list(), FALSE, TRUE)
+
+/datum/weather/ash_storm/telegraph()
+ . = ..()
+ var/list/inside_areas = list()
+ var/list/outside_areas = list()
+ var/list/eligible_areas = SSmapping.areas_in_z["[target_z]"]
+ for(var/i in 1 to eligible_areas.len)
+ var/area/place = eligible_areas[i]
+ if(place.outdoors)
+ outside_areas += place
+ else
+ inside_areas += place
+ CHECK_TICK
+
+ sound_ao.output_atoms = outside_areas
+ sound_ai.output_atoms = inside_areas
+ sound_wo.output_atoms = outside_areas
+ sound_wi.output_atoms = inside_areas
+
+ sound_wo.start()
+ sound_wi.start()
+
+/datum/weather/ash_storm/start()
+ . = ..()
+ sound_wo.stop()
+ sound_wi.stop()
+
+ sound_ao.start()
+ sound_ai.start()
+
+/datum/weather/ash_storm/wind_down()
+ . = ..()
+ sound_ao.stop()
+ sound_ai.stop()
+
+ sound_wo.start()
+ sound_wi.start()
+
+/datum/weather/ash_storm/end()
+ . = ..()
+ sound_wo.stop()
+ sound_wi.stop()
+
/datum/weather/ash_storm/proc/is_ash_immune(mob/living/L)
if(ismecha(L.loc)) //Mechs are immune
return TRUE
@@ -50,7 +94,6 @@
desc = "A passing ash storm blankets the area in harmless embers."
weather_message = "Gentle embers waft down around you like grotesque snow. The storm seems to have passed you by..."
- weather_sound = 'sound/lavaland/ash_storm_windup.ogg'
weather_overlay = "light_ash"
end_message = "The emberfall slows, stops. Another layer of hardened soot to the basalt beneath your feet."
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 2d372d4c33..3b5e5d5d68 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -132,6 +132,22 @@ GLOBAL_LIST_EMPTY(teleportlocs)
if(!IS_DYNAMIC_LIGHTING(src))
add_overlay(/obj/effect/fullbright)
+ if(contents.len)
+ var/list/areas_in_z = SSmapping.areas_in_z
+ var/z
+ for(var/i in 1 to contents.len)
+ var/atom/thing = contents[i]
+ if(!thing)
+ continue
+ z = thing.z
+ break
+ if(!z)
+ WARNING("No z found for [src]")
+ return
+ if(!areas_in_z["[z]"])
+ areas_in_z["[z]"] = list()
+ areas_in_z["[z]"] += src
+
/area/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
diff --git a/sound/lavaland/ash_storm_end.ogg b/sound/lavaland/ash_storm_end.ogg
deleted file mode 100644
index f9b01453dd..0000000000
Binary files a/sound/lavaland/ash_storm_end.ogg and /dev/null differ
diff --git a/sound/lavaland/ash_storm_start.ogg b/sound/lavaland/ash_storm_start.ogg
deleted file mode 100644
index 4b9bebffd0..0000000000
Binary files a/sound/lavaland/ash_storm_start.ogg and /dev/null differ
diff --git a/sound/lavaland/ash_storm_windup.ogg b/sound/lavaland/ash_storm_windup.ogg
deleted file mode 100644
index a9f0fa3270..0000000000
Binary files a/sound/lavaland/ash_storm_windup.ogg and /dev/null differ
diff --git a/sound/weather/ashstorm/inside/active_end.ogg b/sound/weather/ashstorm/inside/active_end.ogg
new file mode 100644
index 0000000000..959bf5773e
Binary files /dev/null and b/sound/weather/ashstorm/inside/active_end.ogg differ
diff --git a/sound/weather/ashstorm/inside/active_mid1.ogg b/sound/weather/ashstorm/inside/active_mid1.ogg
new file mode 100644
index 0000000000..95244cd2b7
Binary files /dev/null and b/sound/weather/ashstorm/inside/active_mid1.ogg differ
diff --git a/sound/weather/ashstorm/inside/active_mid2.ogg b/sound/weather/ashstorm/inside/active_mid2.ogg
new file mode 100644
index 0000000000..a45584b9f3
Binary files /dev/null and b/sound/weather/ashstorm/inside/active_mid2.ogg differ
diff --git a/sound/weather/ashstorm/inside/active_mid3.ogg b/sound/weather/ashstorm/inside/active_mid3.ogg
new file mode 100644
index 0000000000..be2e672fa0
Binary files /dev/null and b/sound/weather/ashstorm/inside/active_mid3.ogg differ
diff --git a/sound/weather/ashstorm/inside/active_start.ogg b/sound/weather/ashstorm/inside/active_start.ogg
new file mode 100644
index 0000000000..3efab12ef2
Binary files /dev/null and b/sound/weather/ashstorm/inside/active_start.ogg differ
diff --git a/sound/weather/ashstorm/inside/weak_end.ogg b/sound/weather/ashstorm/inside/weak_end.ogg
new file mode 100644
index 0000000000..416b75a9b8
Binary files /dev/null and b/sound/weather/ashstorm/inside/weak_end.ogg differ
diff --git a/sound/weather/ashstorm/inside/weak_mid1.ogg b/sound/weather/ashstorm/inside/weak_mid1.ogg
new file mode 100644
index 0000000000..d3211c6b5f
Binary files /dev/null and b/sound/weather/ashstorm/inside/weak_mid1.ogg differ
diff --git a/sound/weather/ashstorm/inside/weak_mid2.ogg b/sound/weather/ashstorm/inside/weak_mid2.ogg
new file mode 100644
index 0000000000..b6491a7afb
Binary files /dev/null and b/sound/weather/ashstorm/inside/weak_mid2.ogg differ
diff --git a/sound/weather/ashstorm/inside/weak_mid3.ogg b/sound/weather/ashstorm/inside/weak_mid3.ogg
new file mode 100644
index 0000000000..95238c72d4
Binary files /dev/null and b/sound/weather/ashstorm/inside/weak_mid3.ogg differ
diff --git a/sound/weather/ashstorm/inside/weak_start.ogg b/sound/weather/ashstorm/inside/weak_start.ogg
new file mode 100644
index 0000000000..59abf1937d
Binary files /dev/null and b/sound/weather/ashstorm/inside/weak_start.ogg differ
diff --git a/sound/weather/ashstorm/outside/active_end.ogg b/sound/weather/ashstorm/outside/active_end.ogg
new file mode 100644
index 0000000000..95149d846c
Binary files /dev/null and b/sound/weather/ashstorm/outside/active_end.ogg differ
diff --git a/sound/weather/ashstorm/outside/active_mid1.ogg b/sound/weather/ashstorm/outside/active_mid1.ogg
new file mode 100644
index 0000000000..189528ab56
Binary files /dev/null and b/sound/weather/ashstorm/outside/active_mid1.ogg differ
diff --git a/sound/weather/ashstorm/outside/active_mid2.ogg b/sound/weather/ashstorm/outside/active_mid2.ogg
new file mode 100644
index 0000000000..92317f2e0a
Binary files /dev/null and b/sound/weather/ashstorm/outside/active_mid2.ogg differ
diff --git a/sound/weather/ashstorm/outside/active_mid3.ogg b/sound/weather/ashstorm/outside/active_mid3.ogg
new file mode 100644
index 0000000000..34846bfd42
Binary files /dev/null and b/sound/weather/ashstorm/outside/active_mid3.ogg differ
diff --git a/sound/weather/ashstorm/outside/active_start.ogg b/sound/weather/ashstorm/outside/active_start.ogg
new file mode 100644
index 0000000000..8b3acf1a15
Binary files /dev/null and b/sound/weather/ashstorm/outside/active_start.ogg differ
diff --git a/sound/weather/ashstorm/outside/weak_end.ogg b/sound/weather/ashstorm/outside/weak_end.ogg
new file mode 100644
index 0000000000..55db2fc356
Binary files /dev/null and b/sound/weather/ashstorm/outside/weak_end.ogg differ
diff --git a/sound/weather/ashstorm/outside/weak_mid1.ogg b/sound/weather/ashstorm/outside/weak_mid1.ogg
new file mode 100644
index 0000000000..56faa9ad26
Binary files /dev/null and b/sound/weather/ashstorm/outside/weak_mid1.ogg differ
diff --git a/sound/weather/ashstorm/outside/weak_mid2.ogg b/sound/weather/ashstorm/outside/weak_mid2.ogg
new file mode 100644
index 0000000000..0c836ad220
Binary files /dev/null and b/sound/weather/ashstorm/outside/weak_mid2.ogg differ
diff --git a/sound/weather/ashstorm/outside/weak_mid3.ogg b/sound/weather/ashstorm/outside/weak_mid3.ogg
new file mode 100644
index 0000000000..f2cbfb0f4b
Binary files /dev/null and b/sound/weather/ashstorm/outside/weak_mid3.ogg differ
diff --git a/sound/weather/ashstorm/outside/weak_start.ogg b/sound/weather/ashstorm/outside/weak_start.ogg
new file mode 100644
index 0000000000..1ac59c36f0
Binary files /dev/null and b/sound/weather/ashstorm/outside/weak_start.ogg differ
diff --git a/tgstation.dme b/tgstation.dme
index 71fe026012..8d0ede73a2 100755
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -386,6 +386,7 @@
#include "code\datums\looping_sounds\item_sounds.dm"
#include "code\datums\looping_sounds\looping_sound.dm"
#include "code\datums\looping_sounds\machinery_sounds.dm"
+#include "code\datums\looping_sounds\weather.dm"
#include "code\datums\martial\boxing.dm"
#include "code\datums\martial\cqc.dm"
#include "code\datums\martial\krav_maga.dm"