diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index ff6e00ec430e..5be3c9fbe3fd 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -111,7 +111,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) /datum/bioscan_data/proc/ares_can_bioscan() var/datum/ares_link/link = GLOB.ares_link - if(!istype(link)) + if(!istype(link) || !ares_is_active()) return FALSE if(link.processor_bioscan && !link.processor_bioscan.inoperable()) return TRUE @@ -123,8 +123,8 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) message_admins("An ARES Bioscan has failed.") var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan failed. \n\nInvestigation into Bioscan subsystem recommended." - log_ares_bioscan(name, input) - if(ares_can_interface()) + log_ares_bioscan(name, input, forced) + if(ares_can_interface() || forced) marine_announcement(input, name, 'sound/misc/interference.ogg', logging = ARES_LOG_NONE) return //Adjust the randomness there so everyone gets the same thing diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 06b082e3c5e2..ffcea5406856 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -77,6 +77,12 @@ GLOBAL_LIST_INIT(maintenance_categories, list( // ------ ARES Logging Procs ------ // +/proc/ares_is_active() + for(var/mob/living/silicon/decoy/ship_ai/ai in GLOB.ai_mob_list) + if(ai.stat == DEAD) + return FALSE //ARES dead, most other systems also die with it + return TRUE + /proc/ares_apollo_talk(broadcast_message) var/datum/language/apollo/apollo = GLOB.all_languages[LANGUAGE_APOLLO] for(var/mob/living/silicon/decoy/ship_ai/ai in GLOB.ai_mob_list) @@ -89,33 +95,38 @@ GLOBAL_LIST_INIT(maintenance_categories, list( /proc/ares_can_interface() var/obj/structure/machinery/ares/processor/interface/processor = GLOB.ares_link.processor_interface - if(!istype(GLOB.ares_link)) + if(!istype(GLOB.ares_link) || !ares_is_active()) return FALSE if(processor && !processor.inoperable()) return TRUE return FALSE //interface processor not found or is broken /proc/ares_can_log() - if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore)) + if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore) || !ares_is_active()) return FALSE var/obj/structure/machinery/ares/cpu/central_processor = GLOB.ares_link.central_processor if(central_processor && !central_processor.inoperable()) return TRUE return FALSE //CPU not found or is broken -/proc/log_ares_apollo(speaker, message) - if(!ares_can_log()) +/proc/ares_can_apollo() + if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore) || !ares_is_active()) return FALSE var/datum/ares_link/link = GLOB.ares_link if(!link.processor_apollo || link.processor_apollo.inoperable()) return FALSE + return TRUE + +/proc/log_ares_apollo(speaker, message) + if(!ares_can_log() || !ares_can_apollo()) + return FALSE if(!speaker) speaker = "Unknown" var/datum/ares_datacore/datacore = GLOB.ares_datacore datacore.apollo_log.Add("[worldtime2text()]: [speaker], '[message]'") -/proc/log_ares_bioscan(title, input) - if(!ares_can_log()) +/proc/log_ares_bioscan(title, input, forced = FALSE) + if(!ares_can_log() && !forced) return FALSE var/datum/ares_datacore/datacore = GLOB.ares_datacore datacore.records_bioscan.Add(new /datum/ares_record/bioscan(title, input)) @@ -225,6 +236,13 @@ GLOBAL_LIST_INIT(maintenance_categories, list( conversation.conversation += "[MAIN_AI_SYSTEM] at [worldtime2text()], '[text]'" // ------ End ARES Interface Procs ------ // +/proc/ares_final_words() + //APOLLO + ares_apollo_talk("APOLLO sub-system shutting down. STOP CODE: 0x000000f4|CRITICAL_PROCESS_DIED") + + //GENERAL CREW + shipwide_ai_announcement("A Problem has been detected and the [MAIN_AI_SYSTEM] system has been shutdown. \nTechnical Information: \n\n*** STOP CODE: 0x000000f4|CRITICAL_PROCESS_DIED\n\nPossible caused by: Rapid Unscheduled Disassembly\nContact an AI Service Technician for further assistance.", title = ":(", ares_logging = null) + /obj/structure/machinery/computer/working_joe/get_ares_access(obj/item/card/id/card) if(ACCESS_ARES_DEBUG in card.access) return APOLLO_ACCESS_DEBUG diff --git a/code/game/machinery/ARES/ARES_step_triggers.dm b/code/game/machinery/ARES/ARES_step_triggers.dm index fdf7b26b2e65..2c6d605bcc9b 100644 --- a/code/game/machinery/ARES/ARES_step_triggers.dm +++ b/code/game/machinery/ARES/ARES_step_triggers.dm @@ -69,7 +69,7 @@ broadcast_message = "ALERT: Unauthorized movement detected in [area_name]!" var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) return FALSE to_chat(passer, SPAN_BOLDWARNING("You hear a soft beeping sound as you cross the threshold.")) @@ -154,7 +154,7 @@ var/broadcast_message = get_broadcast(passer, idcard, failure) var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) return FALSE to_chat(passer, SPAN_BOLDWARNING("You hear a harsh buzzing sound as you cross the threshold!")) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 830717ef91b9..839dea7b2334 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -570,7 +570,12 @@ if(!admin_holder || !(admin_holder.rights & R_MOD)) to_chat(src, "Only administrators may use this command.") - return + return FALSE + + if(!ares_is_active()) + to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is destroyed, and cannot talk!")) + return FALSE + var/input = input(usr, "This is a standard message from the ship's AI. It uses Almayer General channel and won't be heard by humans without access to Almayer General channel (headset or intercom). Check with online staff before you send this. Do not use html.", "What?", "") as message|null if(!input) return FALSE @@ -579,7 +584,7 @@ var/prompt = tgui_alert(src, "ARES interface processor is offline or destroyed, send the message anyways?", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt == "No") to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is not responding. It's interface processor may be offline or destroyed.")) - return + return FALSE ai_announcement(input) message_admins("[key_name_admin(src)] has created an AI comms report") @@ -592,13 +597,17 @@ if(!admin_holder || !(admin_holder.rights & R_MOD)) to_chat(src, "Only administrators may use this command.") - return + return FALSE + + if(!ares_is_active()) + to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is destroyed, and cannot talk!")) + return FALSE + var/input = tgui_input_text(usr, "This is a broadcast from the ship AI to Working Joes and Maintenance Drones. Do not use html.", "What?", "") if(!input) return FALSE - var/datum/ares_link/link = GLOB.ares_link - if(link.processor_apollo.inoperable()) + if(!ares_can_apollo()) var/prompt = tgui_alert(src, "ARES APOLLO processor is offline or destroyed, send the message anyways?", "Choose.", list("Yes", "No"), 20 SECONDS) if(prompt != "Yes") to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is not responding. It's APOLLO processor may be offline or destroyed.")) @@ -1007,10 +1016,11 @@ if("Xeno") GLOB.bioscan_data.qm_bioscan(variance) if("Marine") - var/force_check = tgui_alert(usr, "Do you wish to force ARES to display the bioscan?", "Display force", list("Yes", "No"), 20 SECONDS) var/force_status = FALSE - if(force_check == "Yes") - force_status = TRUE + if(!ares_can_interface()) //proc checks if ARES is dead or if ARES cannot do announcements + var/force_check = tgui_alert(usr, "ARES is currently unable to properly display and/or perform the Bioscan, do you wish to force ARES to display the bioscan?", "Display force", list("Yes", "No"), 20 SECONDS) + if(force_check == "Yes") + force_status = TRUE GLOB.bioscan_data.ares_bioscan(force_status, variance) if("Yautja") GLOB.bioscan_data.yautja_bioscan() diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index bc7271554352..3c2d65bd4180 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -47,6 +47,9 @@ /mob/living/silicon/decoy/death(cause, gibbed, deathmessage = "sparks up and falls silent...") if(stat == DEAD) return FALSE + + //ARES sends out last messages + ares_final_words() icon_state = "hydra-off" var/datum/cause_data/cause_data = create_cause_data("rapid unscheduled disassembly", src, src) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(explosion), loc, -1, 0, 8, 12, TRUE, FALSE, 0, cause_data), 2 SECONDS)