diff --git a/code/modules/shuttle/mobile_port/mobile_port.dm b/code/modules/shuttle/mobile_port/mobile_port.dm index 26f3187ee907f..df929ffbb58e9 100644 --- a/code/modules/shuttle/mobile_port/mobile_port.dm +++ b/code/modules/shuttle/mobile_port/mobile_port.dm @@ -654,6 +654,14 @@ // This previously was played from each door at max volume, and was one of the worst things I had ever seen. // Now it's instead played from the nearest engine if close, or the first engine in the list if far since it doesn't really matter. // Or a door if for some reason the shuttle has no engine, fuck oh hi daniel fuck it + + // BANDASTATION ADDITION START - Allow shuttles to override the default sound paths + var/custom_sound = get_custom_sound(phase) + var/original_selected_sound = selected_sound + if(custom_sound) + selected_sound = custom_sound + // BANDASTATION ADDITION END - Allow shuttles to override the default sound paths + var/range = (engine_coeff * max(width, height)) var/long_range = range * 2.5 var/atom/distant_source @@ -671,6 +679,7 @@ for(var/mob/zlevel_mobs as anything in SSmobs.clients_by_zlevel[z]) var/dist_far = get_dist(zlevel_mobs, distant_source) if(dist_far <= long_range && dist_far > range) + selected_sound = original_selected_sound // BANDASTATION ADDITION - Allow shuttles to override the default sound paths zlevel_mobs.playsound_local(distant_source, "sound/runtime/hyperspace/[selected_sound]_distance.ogg", 100) else if(dist_far <= range) var/source @@ -683,7 +692,18 @@ if(dist_near < closest_dist) source = engines closest_dist = dist_near - zlevel_mobs.playsound_local(source, "sound/runtime/hyperspace/[selected_sound].ogg", 100) + + // BANDASTATION ADDITION START - Allow shuttles to override the default sound paths + if(custom_sound) + zlevel_mobs.playsound_local(source, selected_sound, 100) + else + zlevel_mobs.playsound_local(source, "sound/runtime/hyperspace/[selected_sound].ogg", 100) + // BANDASTATION ADDITION END - Allow shuttles to override the default sound paths + +// BANDASTATION ADDITION START - Allow shuttles to override the default sound paths +/obj/docking_port/mobile/proc/get_custom_sound(phase) + return null +// BANDASTATION ADDITION END - Allow shuttles to override the default sound paths // Losing all initial engines should get you 2 // Adding another set of engines at 0.5 time diff --git a/modular_bandastation/aesthetics_sounds/_aesthetics_sounds.dme b/modular_bandastation/aesthetics_sounds/_aesthetics_sounds.dme index bcc4d4dfa2430..2d37c9a9eb73c 100644 --- a/modular_bandastation/aesthetics_sounds/_aesthetics_sounds.dme +++ b/modular_bandastation/aesthetics_sounds/_aesthetics_sounds.dme @@ -2,3 +2,4 @@ #include "code/antagonists_intro.dm" #include "code/closet.dm" +#include "code/shuttle.dm" diff --git a/modular_bandastation/aesthetics_sounds/code/shuttle.dm b/modular_bandastation/aesthetics_sounds/code/shuttle.dm new file mode 100644 index 0000000000000..478875facfd01 --- /dev/null +++ b/modular_bandastation/aesthetics_sounds/code/shuttle.dm @@ -0,0 +1,56 @@ +/obj/docking_port/mobile + /// Tracks whether the hyperspace warmup sound has been played during the shuttle's ignition phase + var/sound_played_start = FALSE + /// Tracks whether the hyperspace end sound has been played during the shuttle's call or landing phase + var/sound_played_end = FALSE + /// Custom sound for shuttle's HYPERSPACE_WARMUP. Doesn't include emergency & arrival shuttles + var/custom_hyperspace_warmup_sound = 'modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_mini.ogg' + /// Custom sound for shuttle's HYPERSPACE_END. Doesn't include emergency & arrival shuttles + var/custom_hyperspace_end_sound = 'modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_end_new.ogg' + +/obj/docking_port/mobile/get_custom_sound(phase) + if(shuttle_id != "emergency" && shuttle_id != "arrival") + switch(phase) + if(HYPERSPACE_WARMUP) + return custom_hyperspace_warmup_sound + if(HYPERSPACE_END) + return custom_hyperspace_end_sound + return ..() + +/obj/docking_port/mobile/check() + . = ..() + // We already have in core sounds for emergency & arrival shuttles + if(shuttle_id != "emergency" && shuttle_id != "arrival") + switch(mode) + if(SHUTTLE_IGNITING) + if(!sound_played_start) + var/list/areas = list() + for(var/area/shuttle/S in shuttle_areas) + areas += S + // Check if there are 2 seconds or less left before SHUTTLE_IGNITING ends + if(timeLeft(1) <= 3 SECONDS) + sound_played_start = TRUE + hyperspace_sound(HYPERSPACE_WARMUP, areas) + + if(SHUTTLE_CALL) + if(!sound_played_end) + var/turf/destination_turf = get_turf(destination) + var/list/areas = list() + for(var/area/shuttle/S in shuttle_areas) + areas += S + // Check if there are 2 seconds or less left before SHUTTLE_CALL ends + if(timeLeft(1) <= 2 SECONDS) + sound_played_end = TRUE + hyperspace_sound(HYPERSPACE_END, areas) + // Call shuttle arrival sound on destination (docking) point + if(!destination_turf) + stack_trace("Destination turf is invalid. Sound not played.") + return + playsound(destination_turf, 'modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_end_new.ogg', vol = 100, vary = TRUE, pressure_affected = FALSE) + + if(SHUTTLE_IDLE) + // Our sounds should be played once + if(sound_played_start) + sound_played_start = FALSE + if(sound_played_end) + sound_played_end = FALSE diff --git a/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_begin_new.ogg b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_begin_new.ogg new file mode 100644 index 0000000000000..a3c03f88a3f0b Binary files /dev/null and b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_begin_new.ogg differ diff --git a/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_end_new.ogg b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_end_new.ogg new file mode 100644 index 0000000000000..8f8629e581f76 Binary files /dev/null and b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_end_new.ogg differ diff --git a/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_mini.ogg b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_mini.ogg new file mode 100644 index 0000000000000..5f28bc8cb423c Binary files /dev/null and b/modular_bandastation/aesthetics_sounds/sound/shuttle/hyperspace_mini.ogg differ