diff --git a/code/datums/looping_sounds/misc_sounds.dm b/code/datums/looping_sounds/misc_sounds.dm new file mode 100644 index 000000000000..6411b3f51f4a --- /dev/null +++ b/code/datums/looping_sounds/misc_sounds.dm @@ -0,0 +1,3 @@ +/datum/looping_sound/looping_launch_announcement_alarm + mid_sounds = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1) + start_sound = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1) diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index 4fe102270537..d72e0871af72 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -319,6 +319,9 @@ .["door_status"] = is_remote ? list() : shuttle.get_door_data() .["has_flyby_skill"] = skillcheck(user, SKILL_PILOT, SKILL_PILOT_EXPERT) + // Launch Alarm Variables + .["playing_launch_announcement_alarm"] = shuttle.playing_launch_announcement_alarm + .["destinations"] = list() // add flight .["destinations"] += list( @@ -381,6 +384,7 @@ msg_admin_niche(log) log_interact(user, msg = "[log]") shuttle.send_for_flyby() + stop_playing_launch_announcement_alarm() return TRUE update_equipment(is_optimised, FALSE) @@ -410,6 +414,7 @@ var/log = "[key_name(user)] launched the dropship [src.shuttleId] on transport." msg_admin_niche(log) log_interact(user, msg = "[log]") + stop_playing_launch_announcement_alarm() return TRUE if("button-push") playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1) @@ -469,6 +474,23 @@ if("cancel-flyby") if(shuttle.in_flyby && shuttle.timer && shuttle.timeLeft(1) >= DROPSHIP_WARMUP_TIME) shuttle.setTimer(DROPSHIP_WARMUP_TIME) + if("play_launch_announcement_alarm") + if (shuttle.mode != SHUTTLE_IDLE && shuttle.mode != SHUTTLE_RECHARGING) + to_chat(usr, SPAN_WARNING("The Launch Announcement Alarm is designed to tell people that you're going to take off soon.")) + return + shuttle.alarm_sound_loop.start() + shuttle.playing_launch_announcement_alarm = TRUE + return + if ("stop_playing_launch_announcement_alarm") + stop_playing_launch_announcement_alarm() + return + +/obj/structure/machinery/computer/shuttle/dropship/flight/proc/stop_playing_launch_announcement_alarm() + var/obj/docking_port/mobile/marine_dropship/shuttle = SSshuttle.getShuttle(shuttleId) + + shuttle.alarm_sound_loop.stop() + shuttle.playing_launch_announcement_alarm = FALSE + return /obj/structure/machinery/computer/shuttle/dropship/flight/lz1 icon = 'icons/obj/structures/machinery/computer.dmi' diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 7bbdb214d34b..85fc38bf5f1b 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -343,6 +343,9 @@ var/rechargeTime = 0 //time spent after arrival before being able to launch again var/prearrivalTime = 0 //delay after call time finishes for sound effects, explosions, etc. + var/playing_launch_announcement_alarm = FALSE // FALSE = off ; TRUE = on + var/datum/looping_sound/looping_launch_announcement_alarm/alarm_sound_loop + var/landing_sound = 'sound/effects/engine_landing.ogg' var/ignition_sound = 'sound/effects/engine_startup.ogg' /// Default shuttle audio ambience while flying @@ -383,6 +386,7 @@ /obj/docking_port/mobile/Destroy(force) if(force) + QDEL_NULL(alarm_sound_loop) SSshuttle.mobile -= src destination = null previous = null @@ -410,6 +414,14 @@ initial_engines = count_engines() current_engines = initial_engines + //Launch Announcement Alarm variables setup + alarm_sound_loop = new(src) + alarm_sound_loop.mid_length = 20 + alarm_sound_loop.extra_range = 30 + alarm_sound_loop.volume = 100 + alarm_sound_loop.is_sound_projecting = TRUE + alarm_sound_loop.falloff_distance = 7 + #ifdef DOCKING_PORT_HIGHLIGHT highlight("#0f0") #endif diff --git a/colonialmarines.dme b/colonialmarines.dme index 293b69c60d1c..a4ff7cf7c9ab 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -553,6 +553,7 @@ #include "code\datums\langchat\langchat.dm" #include "code\datums\looping_sounds\_looping_sound.dm" #include "code\datums\looping_sounds\item_sounds.dm" +#include "code\datums\looping_sounds\misc_sounds.dm" #include "code\datums\origin\civilian.dm" #include "code\datums\origin\origin.dm" #include "code\datums\origin\upp.dm" diff --git a/sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg b/sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg new file mode 100644 index 000000000000..9fe0b4c11da1 Binary files /dev/null and b/sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg differ diff --git a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx index 65a67524f5b4..bbb7fea96d2c 100644 --- a/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx +++ b/tgui/packages/tgui/interfaces/DropshipFlightControl.tsx @@ -23,6 +23,8 @@ interface DropshipNavigationProps extends NavigationProps { primary_lz?: string; automated_control: AutomatedControl; has_flyby_skill: 0 | 1; + + playing_launch_announcement_alarm: boolean; } const DropshipDoorControl = (_, context) => { @@ -42,7 +44,10 @@ const DropshipDoorControl = (_, context) => { + ); +}; + +const PlayLaunchAnnouncementAlarm = (_, context) => { + const { act } = useBackend(context); + return ( + + ); +}; + +const LaunchAnnouncementAlarm = (_, context) => { + const { data, act } = useBackend(context); + const [siteselection, setSiteSelection] = useSharedState( + context, + 'target_site', + undefined + ); + return ( +
+ ) : ( + + ) + } + /> + ); +}; + const RenderScreen = (props, context) => { const { data } = useBackend(context); return ( @@ -292,6 +344,7 @@ const RenderScreen = (props, context) => { )} {data.door_status.length > 0 && } + {} ); };