Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added launch alarm for PR #4976 #5105

Merged
merged 9 commits into from
Dec 7, 2023
33 changes: 27 additions & 6 deletions code/modules/shuttle/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand All @@ -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
fordmichigan marked this conversation as resolved.
Show resolved Hide resolved
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)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/shuttle/shuttles/crashable/lifeboats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
. = ..()
Expand Down