Finishes work on sounds.

This commit is contained in:
Neerti
2018-12-20 20:19:00 -05:00
parent 5a983ef9f5
commit c2a2590c44
35 changed files with 246 additions and 55 deletions

View File

@@ -9,6 +9,9 @@
#define WEATHER_WINDY "windy" #define WEATHER_WINDY "windy"
#define WEATHER_HOT "hot" #define WEATHER_HOT "hot"
#define WEATHER_BLOOD_MOON "blood moon" // For admin fun or cult later on. #define WEATHER_BLOOD_MOON "blood moon" // For admin fun or cult later on.
#define WEATHER_EMBERFALL "emberfall" // More adminbuse, from TG. Harmless.
#define WEATHER_ASH_STORM "ash storm" // Ripped from TG, like the above. Less harmless.
#define WEATHER_FALLOUT "fallout" // Modified emberfall, actually harmful. Admin only.
#define MOON_PHASE_NEW_MOON "new moon" #define MOON_PHASE_NEW_MOON "new moon"
#define MOON_PHASE_WAXING_CRESCENT "waxing crescent" #define MOON_PHASE_WAXING_CRESCENT "waxing crescent"

View File

@@ -10,6 +10,7 @@ SUBSYSTEM_DEF(mapping)
/datum/controller/subsystem/mapping/Initialize(timeofday) /datum/controller/subsystem/mapping/Initialize(timeofday)
if(subsystem_initialized) if(subsystem_initialized)
return return
world.max_z_changed() // This is to set up the player z-level list, maxz hasn't actually changed (probably)
maploader = new() maploader = new()
load_map_templates() load_map_templates()

View File

@@ -1,47 +1,76 @@
/datum/looping_sound/outside_blizzard /datum/looping_sound/outside_blizzard
mid_sounds = list( mid_sounds = list(
'sound/effects/weather/snowstorm/outside/active_mid1.ogg'=1, 'sound/effects/weather/snowstorm/outside/active_mid1.ogg' = 1,
'sound/effects/weather/snowstorm/outside/active_mid1.ogg'=1, 'sound/effects/weather/snowstorm/outside/active_mid1.ogg' = 1,
'sound/effects/weather/snowstorm/outside/active_mid1.ogg'=1 'sound/effects/weather/snowstorm/outside/active_mid1.ogg' = 1
) )
mid_length = 80 mid_length = 8 SECONDS
start_sound = 'sound/effects/weather/snowstorm/outside/active_start.ogg' start_sound = 'sound/effects/weather/snowstorm/outside/active_start.ogg'
start_length = 130 start_length = 13 SECONDS
end_sound = 'sound/effects/weather/snowstorm/outside/active_end.ogg' end_sound = 'sound/effects/weather/snowstorm/outside/active_end.ogg'
volume = 80 volume = 80
/datum/looping_sound/inside_blizzard /datum/looping_sound/inside_blizzard
mid_sounds = list( mid_sounds = list(
'sound/effects/weather/snowstorm/inside/active_mid1.ogg'=1, 'sound/effects/weather/snowstorm/inside/active_mid1.ogg' = 1,
'sound/effects/weather/snowstorm/inside/active_mid2.ogg'=1, 'sound/effects/weather/snowstorm/inside/active_mid2.ogg' = 1,
'sound/effects/weather/snowstorm/inside/active_mid3.ogg'=1 'sound/effects/weather/snowstorm/inside/active_mid3.ogg' = 1
) )
mid_length = 80 mid_length = 8 SECONDS
start_sound = 'sound/effects/weather/snowstorm/inside/active_start.ogg' start_sound = 'sound/effects/weather/snowstorm/inside/active_start.ogg'
start_length = 130 start_length = 13 SECONDS
end_sound = 'sound/effects/weather/snowstorm/inside/active_end.ogg' end_sound = 'sound/effects/weather/snowstorm/inside/active_end.ogg'
volume = 60 volume = 60
/datum/looping_sound/outside_snow /datum/looping_sound/outside_snow
mid_sounds = list( mid_sounds = list(
'sound/effects/weather/snowstorm/outside/weak_mid1.ogg'=1, 'sound/effects/weather/snowstorm/outside/weak_mid1.ogg' = 1,
'sound/effects/weather/snowstorm/outside/weak_mid2.ogg'=1, 'sound/effects/weather/snowstorm/outside/weak_mid2.ogg' = 1,
'sound/effects/weather/snowstorm/outside/weak_mid3.ogg'=1 'sound/effects/weather/snowstorm/outside/weak_mid3.ogg' = 1
) )
mid_length = 80 mid_length = 8 SECONDS
start_sound = 'sound/effects/weather/snowstorm/outside/weak_start.ogg' start_sound = 'sound/effects/weather/snowstorm/outside/weak_start.ogg'
start_length = 130 start_length = 13 SECONDS
end_sound = 'sound/effects/weather/snowstorm/outside/weak_end.ogg' end_sound = 'sound/effects/weather/snowstorm/outside/weak_end.ogg'
volume = 50 volume = 50
/datum/looping_sound/inside_snow /datum/looping_sound/inside_snow
mid_sounds = list( mid_sounds = list(
'sound/effects/weather/snowstorm/inside/weak_mid1.ogg'=1, 'sound/effects/weather/snowstorm/inside/weak_mid1.ogg' = 1,
'sound/effects/weather/snowstorm/inside/weak_mid2.ogg'=1, 'sound/effects/weather/snowstorm/inside/weak_mid2.ogg' = 1,
'sound/effects/weather/snowstorm/inside/weak_mid3.ogg'=1 'sound/effects/weather/snowstorm/inside/weak_mid3.ogg' = 1
) )
mid_length = 80 mid_length = 8 SECONDS
start_sound = 'sound/effects/weather/snowstorm/inside/weak_start.ogg' start_sound = 'sound/effects/weather/snowstorm/inside/weak_start.ogg'
start_length = 130 start_length = 13 SECONDS
end_sound = 'sound/effects/weather/snowstorm/inside/weak_end.ogg' end_sound = 'sound/effects/weather/snowstorm/inside/weak_end.ogg'
volume = 30 volume = 30
/datum/looping_sound/wind
mid_sounds = list(
'sound/effects/weather/wind/wind_2_1.ogg' = 1,
'sound/effects/weather/wind/wind_2_2.ogg' = 1,
'sound/effects/weather/wind/wind_3_1.ogg' = 1,
'sound/effects/weather/wind/wind_4_1.ogg' = 1,
'sound/effects/weather/wind/wind_4_2.ogg' = 1,
'sound/effects/weather/wind/wind_5_1.ogg' = 1
)
mid_length = 10 SECONDS // The lengths for the files vary, but the longest is ten seconds, so this will make it sound like intermittent wind.
volume = 50
// Don't have special sounds so we just make it quieter indoors.
/datum/looping_sound/wind/indoors
volume = 30
/datum/looping_sound/rain
mid_sounds = list(
'sound/effects/weather/acidrain_mid.ogg' = 1
)
mid_length = 15 SECONDS // The lengths for the files vary, but the longest is ten seconds, so this will make it sound like intermittent wind.
start_sound = 'sound/effects/weather/acidrain_start.ogg'
start_length = 13 SECONDS
end_sound = 'sound/effects/weather/acidrain_end.ogg'
volume = 50
/datum/looping_sound/rain/indoors
volume = 30

View File

@@ -44,7 +44,7 @@ var/global/list/narsie_list = list()
..() ..()
if(announce) if(announce)
world << "<font size='15' color='red'><b>[uppertext(name)] HAS RISEN</b></font>" world << "<font size='15' color='red'><b>[uppertext(name)] HAS RISEN</b></font>"
world << sound('sound/effects/wind/wind_5_1.ogg') world << sound('sound/effects/weather/wind/wind_5_1.ogg')
narsie_spawn_animation() narsie_spawn_animation()

View File

@@ -206,7 +206,7 @@ var/list/sacrificed = list()
if(cultists.len >= 9) if(cultists.len >= 9)
if(!narsie_cometh)//so we don't initiate Hell more than one time. if(!narsie_cometh)//so we don't initiate Hell more than one time.
world << "<font size='15' color='red'><b>THE VEIL HAS BEEN SHATTERED!</b></font>" world << "<font size='15' color='red'><b>THE VEIL HAS BEEN SHATTERED!</b></font>"
world << sound('sound/effects/wind/wind_5_1.ogg') world << sound('sound/effects/weather/wind/wind_5_1.ogg')
SetUniversalState(/datum/universal_state/hell) SetUniversalState(/datum/universal_state/hell)
narsie_cometh = 1 narsie_cometh = 1

View File

@@ -74,6 +74,17 @@ var/list/flooring_types
'sound/effects/footstep/snow4.ogg', 'sound/effects/footstep/snow4.ogg',
'sound/effects/footstep/snow5.ogg')) 'sound/effects/footstep/snow5.ogg'))
/decl/flooring/snow
name = "water"
desc = "A layer of many tiny bits of frozen water. It's hard to tell how deep it is."
icon = 'icons/turf/snow_new.dmi'
icon_base = "snow"
footstep_sounds = list("human" = list(
'sound/effects/footstep/snow1.ogg',
'sound/effects/footstep/snow2.ogg',
'sound/effects/footstep/snow3.ogg',
'sound/effects/footstep/snow4.ogg',
'sound/effects/footstep/snow5.ogg'))
/decl/flooring/snow/snow2 /decl/flooring/snow/snow2
name = "snow" name = "snow"

View File

@@ -32,22 +32,22 @@
"Beach" = new/datum/holodeck_program(/area/holodeck/source_beach), "Beach" = new/datum/holodeck_program(/area/holodeck/source_beach),
"Desert" = new/datum/holodeck_program(/area/holodeck/source_desert, "Desert" = new/datum/holodeck_program(/area/holodeck/source_desert,
list( list(
'sound/effects/wind/wind_2_1.ogg', 'sound/effects/weather/wind/wind_2_1.ogg',
'sound/effects/wind/wind_2_2.ogg', 'sound/effects/weather/wind/wind_2_2.ogg',
'sound/effects/wind/wind_3_1.ogg', 'sound/effects/weather/wind/wind_3_1.ogg',
'sound/effects/wind/wind_4_1.ogg', 'sound/effects/weather/wind/wind_4_1.ogg',
'sound/effects/wind/wind_4_2.ogg', 'sound/effects/weather/wind/wind_4_2.ogg',
'sound/effects/wind/wind_5_1.ogg' 'sound/effects/weather/wind/wind_5_1.ogg'
) )
), ),
"Snowfield" = new/datum/holodeck_program(/area/holodeck/source_snowfield, "Snowfield" = new/datum/holodeck_program(/area/holodeck/source_snowfield,
list( list(
'sound/effects/wind/wind_2_1.ogg', 'sound/effects/weather/wind/wind_2_1.ogg',
'sound/effects/wind/wind_2_2.ogg', 'sound/effects/weather/wind/wind_2_2.ogg',
'sound/effects/wind/wind_3_1.ogg', 'sound/effects/weather/wind/wind_3_1.ogg',
'sound/effects/wind/wind_4_1.ogg', 'sound/effects/weather/wind/wind_4_1.ogg',
'sound/effects/wind/wind_4_2.ogg', 'sound/effects/weather/wind/wind_4_2.ogg',
'sound/effects/wind/wind_5_1.ogg' 'sound/effects/weather/wind/wind_5_1.ogg'
) )
), ),
"Space" = new/datum/holodeck_program(/area/holodeck/source_space, "Space" = new/datum/holodeck_program(/area/holodeck/source_space,

View File

@@ -14,7 +14,7 @@
var/sun_position = 0 // 0 means midnight, 1 means noon. var/sun_position = 0 // 0 means midnight, 1 means noon.
var/list/sun = list("range","brightness","color","lum_r","lum_g","lum_b") var/list/sun = list("range","brightness","color","lum_r","lum_g","lum_b")
var/list/datum/lighting_corner/sunlit_corners = list() var/list/datum/lighting_corner/sunlit_corners = list()
var/expected_z_levels = list() var/list/expected_z_levels = list()
var/turf/unsimulated/wall/planetary/planetary_wall_type = /turf/unsimulated/wall/planetary var/turf/unsimulated/wall/planetary/planetary_wall_type = /turf/unsimulated/wall/planetary

View File

@@ -121,7 +121,10 @@ var/datum/planet/sif/planet_sif = null
WEATHER_RAIN = new /datum/weather/sif/rain(), WEATHER_RAIN = new /datum/weather/sif/rain(),
WEATHER_STORM = new /datum/weather/sif/storm(), WEATHER_STORM = new /datum/weather/sif/storm(),
WEATHER_HAIL = new /datum/weather/sif/hail(), WEATHER_HAIL = new /datum/weather/sif/hail(),
WEATHER_BLOOD_MOON = new /datum/weather/sif/blood_moon() WEATHER_BLOOD_MOON = new /datum/weather/sif/blood_moon(),
WEATHER_EMBERFALL = new /datum/weather/sif/emberfall(),
WEATHER_ASH_STORM = new /datum/weather/sif/ash_storm(),
WEATHER_FALLOUT = new /datum/weather/sif/fallout()
) )
roundstart_weather_chances = list( roundstart_weather_chances = list(
WEATHER_CLEAR = 30, WEATHER_CLEAR = 30,
@@ -269,6 +272,8 @@ var/datum/planet/sif/planet_sif = null
transition_messages = list( transition_messages = list(
"The sky is dark, and rain falls down upon you." "The sky is dark, and rain falls down upon you."
) )
// outdoor_sounds_type = /datum/looping_sound/rain
// indoor_sounds_type = /datum/looping_sound/rain/indoors
/datum/weather/sif/rain/process_effects() /datum/weather/sif/rain/process_effects()
..() ..()
@@ -314,6 +319,8 @@ var/datum/planet/sif/planet_sif = null
"Loud thunder is heard in the distance.", "Loud thunder is heard in the distance.",
"A bright flash heralds the approach of a storm." "A bright flash heralds the approach of a storm."
) )
// outdoor_sounds_type = /datum/looping_sound/rain
// indoor_sounds_type = /datum/looping_sound/rain/indoors
transition_chances = list( transition_chances = list(
@@ -439,6 +446,10 @@ var/datum/planet/sif/planet_sif = null
if(show_message) if(show_message)
to_chat(H, effect_message) to_chat(H, effect_message)
// These never happen naturally, and are for adminbuse.
// A culty weather.
/datum/weather/sif/blood_moon /datum/weather/sif/blood_moon
name = "blood moon" name = "blood moon"
light_modifier = 0.5 light_modifier = 0.5
@@ -451,3 +462,103 @@ var/datum/planet/sif/planet_sif = null
transition_messages = list( transition_messages = list(
"The sky turns blood red!" "The sky turns blood red!"
) )
outdoor_sounds_type = /datum/looping_sound/wind
indoor_sounds_type = /datum/looping_sound/wind/indoors
// Ash and embers fall forever, such as from a volcano or something.
/datum/weather/sif/emberfall
name = "emberfall"
icon_state = "ashfall_light"
light_modifier = 0.7
light_color = "#880000"
temp_high = 293.15 // 20c
temp_low = 283.15 // 10c
flight_failure_modifier = 20
transition_chances = list(
WEATHER_EMBERFALL = 100
)
observed_message = "Soot, ash, and embers float down from above."
transition_messages = list(
"Gentle embers waft down around you like grotesque snow."
)
outdoor_sounds_type = /datum/looping_sound/wind
indoor_sounds_type = /datum/looping_sound/wind/indoors
// Like the above but a lot more harmful.
/datum/weather/sif/ash_storm
name = "ash storm"
icon_state = "ashfall_heavy"
light_modifier = 0.1
light_color = "#FF0000"
temp_high = 323.15 // 50c
temp_low = 313.15 // 40c
flight_failure_modifier = 50
transition_chances = list(
WEATHER_ASH_STORM = 100
)
observed_message = "All that can be seen is black smoldering ash."
transition_messages = list(
"Smoldering clouds of scorching ash billow down around you!"
)
// Lets recycle.
outdoor_sounds_type = /datum/looping_sound/outside_blizzard
indoor_sounds_type = /datum/looping_sound/inside_blizzard
/datum/weather/sif/ash_storm/process_effects()
..()
for(var/thing in living_mob_list)
var/mob/living/L = thing
if(L.z in holder.our_planet.expected_z_levels)
var/turf/T = get_turf(L)
if(!T.outdoors)
continue // They're indoors, so no need to burn them with ash.
L.inflict_heat_damage(rand(1, 3))
// Totally radical.
/datum/weather/sif/fallout
name = "fallout"
icon_state = "fallout"
light_modifier = 0.7
light_color = "#008800"
flight_failure_modifier = 30
transition_chances = list(
WEATHER_FALLOUT = 100
)
observed_message = "Radioactive soot and ash rains down from the heavens."
transition_messages = list(
"Radioactive soot and ash start to float down around you, contaminating whatever they touch."
)
outdoor_sounds_type = /datum/looping_sound/wind
indoor_sounds_type = /datum/looping_sound/wind/indoors
var/direct_rad_low = RAD_LEVEL_LOW
var/direct_rad_high = RAD_LEVEL_MODERATE
var/fallout_rad_low = RAD_LEVEL_HIGH
var/fallout_rad_high = RAD_LEVEL_VERY_HIGH
/datum/weather/sif/fallout/process_effects()
..()
for(var/thing in living_mob_list)
var/mob/living/L = thing
if(L.z in holder.our_planet.expected_z_levels)
irradiate_nearby_turf(L)
var/turf/T = get_turf(L)
if(!T.outdoors)
continue // They're indoors, so no need to irradiate them with fallout.
L.rad_act(rand(direct_rad_low, direct_rad_high))
// This makes random tiles near people radioactive for awhile.
// Tiles far away from people are left alone, for performance.
/datum/weather/sif/fallout/proc/irradiate_nearby_turf(mob/living/L)
if(!istype(L))
return
var/list/turfs = RANGE_TURFS(world.view, L)
var/turf/T = pick(turfs) // We get one try per tick.
if(!istype(T))
return
if(T.outdoors)
radiation_repository.radiate(T, rand(fallout_rad_low, fallout_rad_high))

View File

@@ -13,8 +13,6 @@
var/atom/movable/weather_visuals/visuals = null var/atom/movable/weather_visuals/visuals = null
var/atom/movable/weather_visuals/special/special_visuals = null var/atom/movable/weather_visuals/special/special_visuals = null
var/list/clients_in_zlevels = list()
/datum/weather_holder/New(var/source) /datum/weather_holder/New(var/source)
..() ..()
our_planet = source our_planet = source
@@ -35,7 +33,10 @@
next_weather_shift = world.time + rand(current_weather.timer_low_bound, current_weather.timer_high_bound) MINUTES next_weather_shift = world.time + rand(current_weather.timer_low_bound, current_weather.timer_high_bound) MINUTES
if(new_weather != old_weather) if(new_weather != old_weather)
if(istype(old_weather)) // At roundstart this is null. if(istype(old_weather)) // At roundstart this is null.
old_weather.process_sounds() // Ensure that people who should hear the ending sound will hear it.
old_weather.stop_sounds() old_weather.stop_sounds()
current_weather.process_sounds() // Same story, make sure the starting sound is heard.
current_weather.start_sounds() current_weather.start_sounds()
show_transition_message() show_transition_message()
@@ -166,21 +167,33 @@
return return
/datum/weather/proc/process_sounds() /datum/weather/proc/process_sounds()
for(var/i in holder.clients_in_zlevels) if(!outdoor_sounds && !indoor_sounds) // No point bothering if we have no sounds.
var/client/C = i return
var/mob/M = C.mob
for(var/z_level in 1 to world.maxz)
for(var/a in GLOB.players_by_zlevel[z_level])
var/mob/M = a
// Check if the mob left the z-levels we control. If so, make the sounds stop for them.
if(!(z_level in holder.our_planet.expected_z_levels))
hear_indoor_sounds(M, FALSE)
hear_outdoor_sounds(M, FALSE)
continue
// Otherwise they should hear some sounds, depending on if they're inside or not.
var/turf/T = get_turf(M) var/turf/T = get_turf(M)
if(T.outdoors) if(istype(T))
if(outdoor_sounds) if(T.outdoors) // Mob is currently outdoors.
outdoor_sounds.output_atoms |= C hear_outdoor_sounds(M, TRUE)
if(indoor_sounds) hear_indoor_sounds(M, FALSE)
indoor_sounds.output_atoms -= C
else // Mob is currently indoors.
hear_outdoor_sounds(M, FALSE)
hear_indoor_sounds(M, TRUE)
else else
if(outdoor_sounds) hear_indoor_sounds(M, FALSE)
outdoor_sounds.output_atoms -= C hear_outdoor_sounds(M, FALSE)
if(indoor_sounds)
indoor_sounds.output_atoms |= C
/datum/weather/proc/start_sounds() /datum/weather/proc/start_sounds()
if(outdoor_sounds) if(outdoor_sounds)
@@ -194,6 +207,30 @@
if(indoor_sounds) if(indoor_sounds)
indoor_sounds.stop() indoor_sounds.stop()
// Stop everything just in case.
for(var/z_level in 1 to world.maxz)
for(var/a in GLOB.players_by_zlevel[z_level])
hear_indoor_sounds(a, FALSE)
hear_outdoor_sounds(a, FALSE)
// Adds or removes someone from the outdoor list.
/datum/weather/proc/hear_outdoor_sounds(mob/M, adding)
if(!outdoor_sounds)
return
if(adding)
outdoor_sounds.output_atoms |= M
return
outdoor_sounds.output_atoms -= M
// Ditto, for indoors.
/datum/weather/proc/hear_indoor_sounds(mob/M, adding)
if(!indoor_sounds)
return
if(adding)
indoor_sounds.output_atoms |= M
return
indoor_sounds.output_atoms -= M
// All this does is hold the weather icon. // All this does is hold the weather icon.
/atom/movable/weather_visuals /atom/movable/weather_visuals
icon = 'icons/effects/weather.dmi' icon = 'icons/effects/weather.dmi'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -258,8 +258,7 @@
expected_z_levels = list( expected_z_levels = list(
Z_LEVEL_SURFACE, Z_LEVEL_SURFACE,
Z_LEVEL_SURFACE_MINE, Z_LEVEL_SURFACE_MINE,
Z_LEVEL_SURFACE_WILD, Z_LEVEL_SURFACE_WILD
Z_LEVEL_TRANSIT
) )
//Suit Storage Units //Suit Storage Units

View File

@@ -2602,7 +2602,7 @@
#include "code\ZAS\Zone.dm" #include "code\ZAS\Zone.dm"
#include "interface\interface.dm" #include "interface\interface.dm"
#include "interface\skin.dmf" #include "interface\skin.dmf"
#include "maps\example\example.dm" #include "maps\southern_cross\southern_cross.dm"
#include "maps\submaps\space_submaps\space.dm" #include "maps\submaps\space_submaps\space.dm"
#include "maps\submaps\surface_submaps\mountains\mountains.dm" #include "maps\submaps\surface_submaps\mountains\mountains.dm"
#include "maps\submaps\surface_submaps\mountains\mountains_areas.dm" #include "maps\submaps\surface_submaps\mountains\mountains_areas.dm"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.