diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index 3d0c8fca142d..4d94ae05f8c9 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,40 @@ 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) + 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)