From cccd4c969e309d0a1343e9b061ba96246a777c1d Mon Sep 17 00:00:00 2001 From: Guinea Date: Sat, 2 Dec 2023 13:34:59 -0500 Subject: [PATCH 1/3] Added launch alarm for PR #4976 --- code/modules/shuttle/computer.dm | 33 +++++++++++++++---- .../shuttle/shuttles/crashable/lifeboats.dm | 2 ++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index 3d0c8fca142d..174aa8938e7c 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -281,6 +281,8 @@ icon_state = "terminal" req_access = list() breakable = FALSE + ///If true, the lifeboat is in the process of launching, and so the code will not allow another launch. + var/launch_initiated = FALSE /obj/structure/machinery/computer/shuttle/lifeboat/attack_hand(mob/user) . = ..() @@ -293,23 +295,42 @@ switch(lifeboat.mode) if(SHUTTLE_IDLE) if(!istype(user, /mob/living/carbon/human)) - to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting confirmation of the evacuation order\".")) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Unauthorized access. Please inform your supervisor\".")) return var/mob/living/carbon/human/human_user = user - if(!(ACCESS_MARINE_COMMAND in human_user.wear_id?.access)) - to_chat(user, SPAN_NOTICE("[src]'s screen says \"Awaiting confirmation of the evacuation order\".")) + if(!(ACCESS_MARINE_SENIOR in human_user.wear_id?.access) && !(ACCESS_MARINE_DROPSHIP in human_user.wear_id?.access)) + to_chat(user, SPAN_NOTICE("[src]'s screen says \"Unauthorized access. Please inform your supervisor\".")) return if(SShijack.current_progress < SShijack.early_launch_required_progress) to_chat(user, SPAN_NOTICE("[src]'s screen says \"Unable to launch, fuel insufficient\".")) return - if(tgui_alert(user, "Early launch the lifeboat?", "Confirm", list("Yes", "No"), 10 SECONDS) == "Yes") - to_chat(user, SPAN_NOTICE("[src]'s screen blinks and says \"Early launch accepted\".")) - lifeboat.evac_launch() + if(launch_initiated) + to_chat(user, SPAN_NOTICE("[src]'s screen blinks and says \"Launch sequence already initiated\".")) return + var/response = tgui_alert(user, "Launch the lifeboat?", "Confirm", list("Yes", "No", "Emergency Launch"), 10 SECONDS) + if(launch_initiated) + to_chat(user, SPAN_NOTICE("[src]'s screen blinks and says \"Launch sequence already initiated\".")) + return + switch(response) + if ("Yes") + launch_initiated = TRUE + to_chat(user, "[src]'s screen blinks and says \"Launch command accepted\".") + shipwide_ai_announcement("Launch command received. [lifeboat.id == MOBILE_SHUTTLE_LIFEBOAT_PORT ? "Port" : "Starboard"] Lifeboat doors will close in 10 seconds.") + addtimer(CALLBACK(lifeboat, TYPE_PROC_REF(/obj/docking_port/mobile/crashable/lifeboat, evac_launch)), 10 SECONDS) + lifeboat.alarm_sound_loop.start() + lifeboat.playing_launch_announcement_alarm=TRUE + return + if ("Emergency Launch") + launch_initiated = TRUE + to_chat(user, "[src]'s screen blinks and says \"Emergency Launch command accepted\".") + lifeboat.evac_launch() + shipwide_ai_announcement("Emergency Launch command received. Launching [lifeboat.id == MOBILE_SHUTTLE_LIFEBOAT_PORT ? "Port" : "Starboard"] Lifeboat.") + return + if(SHUTTLE_IGNITING) to_chat(user, SPAN_NOTICE("[src]'s screen says \"Engines firing\".")) if(SHUTTLE_CALL) diff --git a/code/modules/shuttle/shuttles/crashable/lifeboats.dm b/code/modules/shuttle/shuttles/crashable/lifeboats.dm index 11b376563d64..25d1aeb6efb7 100644 --- a/code/modules/shuttle/shuttles/crashable/lifeboats.dm +++ b/code/modules/shuttle/shuttles/crashable/lifeboats.dm @@ -47,6 +47,8 @@ set_mode(SHUTTLE_IGNITING) on_ignition() setTimer(ignitionTime) + alarm_sound_loop.stop() + playing_launch_announcement_alarm = FALSE /obj/docking_port/mobile/crashable/lifeboat/crash_check() . = ..() From baf2678b85993a716ce89bd17396f0d6962bfea5 Mon Sep 17 00:00:00 2001 From: fordmichigan <149270317+fordmichigan@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:20:56 -0500 Subject: [PATCH 2/3] Update code/modules/shuttle/computer.dm Co-authored-by: zzzmike <85382350+zzzmike@users.noreply.github.com> --- code/modules/shuttle/computer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index 174aa8938e7c..3e8c4cfff1b3 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -322,7 +322,7 @@ shipwide_ai_announcement("Launch command received. [lifeboat.id == MOBILE_SHUTTLE_LIFEBOAT_PORT ? "Port" : "Starboard"] Lifeboat doors will close in 10 seconds.") addtimer(CALLBACK(lifeboat, TYPE_PROC_REF(/obj/docking_port/mobile/crashable/lifeboat, evac_launch)), 10 SECONDS) lifeboat.alarm_sound_loop.start() - lifeboat.playing_launch_announcement_alarm=TRUE + lifeboat.playing_launch_announcement_alarm = TRUE return if ("Emergency Launch") launch_initiated = TRUE From 4891d79955fbf4a3272acfde82b9b6e18e7dd8ef Mon Sep 17 00:00:00 2001 From: Guinea Date: Wed, 6 Dec 2023 19:29:34 -0500 Subject: [PATCH 3/3] fixed error --- code/modules/shuttle/computer.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index 6c648f0e8a2e..cad5458e80e1 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -324,7 +324,7 @@ lifeboat.alarm_sound_loop.start() lifeboat.playing_launch_announcement_alarm = TRUE return - + if ("Emergency Launch") launch_initiated = TRUE to_chat(user, "[src]'s screen blinks and says \"Emergency Launch command accepted\".")