From 0095d9e2040bc27094893920665643db3db67621 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 21 Dec 2023 18:58:53 -0500 Subject: [PATCH 1/7] ARES Apollo Check proc --- code/game/machinery/ARES/ARES_procs.dm | 12 ++++++++++-- code/game/machinery/ARES/ARES_step_triggers.dm | 4 ++-- code/modules/admin/tabs/event_tab.dm | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 06b082e3c5e2..109058dba3c6 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -103,12 +103,20 @@ GLOBAL_LIST_INIT(maintenance_categories, list( 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)) 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()) + return FALSE + if(!ares_can_apollo()){ + return FALSE + } if(!speaker) speaker = "Unknown" var/datum/ares_datacore/datacore = GLOB.ares_datacore 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..477a6c0144f0 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -598,7 +598,7 @@ 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.")) From fd09d2534c1afa23900a406410ac226596c736d1 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 21 Dec 2023 19:27:16 -0500 Subject: [PATCH 2/7] Ares Death Consequence --- code/game/bioscans.dm | 2 +- code/game/machinery/ARES/ARES_procs.dm | 18 +++++++++++------- code/modules/admin/tabs/event_tab.dm | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index ff6e00ec430e..50bcab969443 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 diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 109058dba3c6..af09d9cc2763 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -77,6 +77,13 @@ 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,14 +96,14 @@ 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()) @@ -104,7 +111,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list( return FALSE //CPU not found or is broken /proc/ares_can_apollo() - if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore)) + 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()) @@ -112,11 +119,8 @@ GLOBAL_LIST_INIT(maintenance_categories, list( return TRUE /proc/log_ares_apollo(speaker, message) - if(!ares_can_log()) - return FALSE - if(!ares_can_apollo()){ + if(!ares_can_log() || !ares_can_apollo()) return FALSE - } if(!speaker) speaker = "Unknown" var/datum/ares_datacore/datacore = GLOB.ares_datacore diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 477a6c0144f0..9f6d8586262e 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -597,7 +597,6 @@ if(!input) return FALSE - var/datum/ares_link/link = GLOB.ares_link 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") From 3b93e8a172fde20a75a3f10d5a94428fe62f5f46 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 21 Dec 2023 20:26:04 -0500 Subject: [PATCH 3/7] ARES alive check --- code/modules/admin/tabs/event_tab.dm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 9f6d8586262e..78c5f2cc9ef1 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -570,7 +570,13 @@ 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 +585,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,7 +598,13 @@ 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 From 228da107b789773ec8d77815a184cccecf05a76c Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Thu, 21 Dec 2023 20:49:31 -0500 Subject: [PATCH 4/7] ARES Death Rattle --- code/modules/mob/living/silicon/decoy/decoy.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index bc7271554352..7c6c1b110a6e 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -47,11 +47,22 @@ /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) return ..() +/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) +} + /mob/living/silicon/decoy/say(message) //General communication across the ship. if(stat || !message) return FALSE From 49730667a38a8b5a5b962dc757944d55def35837 Mon Sep 17 00:00:00 2001 From: Ben10083 Date: Fri, 22 Dec 2023 15:22:01 -0500 Subject: [PATCH 5/7] Suggested Changes --- code/game/bioscans.dm | 4 ++-- code/game/machinery/ARES/ARES_procs.dm | 14 ++++++++++---- code/modules/admin/tabs/event_tab.dm | 13 ++++++------- code/modules/mob/living/silicon/decoy/decoy.dm | 10 +--------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 50bcab969443..32da968e56b1 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -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() || (!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 af09d9cc2763..ffcea5406856 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -77,12 +77,11 @@ GLOBAL_LIST_INIT(maintenance_categories, list( // ------ ARES Logging Procs ------ // -/proc/ares_is_active(){ +/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] @@ -126,8 +125,8 @@ GLOBAL_LIST_INIT(maintenance_categories, list( 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)) @@ -237,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/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 78c5f2cc9ef1..839dea7b2334 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -572,10 +572,9 @@ to_chat(src, "Only administrators may use this command.") return FALSE - if(!ares_is_active()){ + 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) @@ -600,10 +599,9 @@ to_chat(src, "Only administrators may use this command.") return FALSE - if(!ares_is_active()){ + 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) @@ -1018,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 7c6c1b110a6e..3c2d65bd4180 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -49,20 +49,12 @@ return FALSE //ARES sends out last messages - ares_final_words(); + 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) return ..() -/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) -} - /mob/living/silicon/decoy/say(message) //General communication across the ship. if(stat || !message) return FALSE From 6560edb767a37ffe7c97d24003c39d9cec9fd2ff Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 25 Dec 2023 13:25:17 -0500 Subject: [PATCH 6/7] oops :3 --- code/game/bioscans.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 32da968e56b1..6676e31f3c1f 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -124,7 +124,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan failed. \n\nInvestigation into Bioscan subsystem recommended." log_ares_bioscan(name, input, forced) - if(ares_can_interface() || (!ares_can_interface() && 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 From e41ea1671a3dd4ca471e8fc0db6c7cf35d41dc18 Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 25 Dec 2023 13:27:46 -0500 Subject: [PATCH 7/7] forgor to compile --- code/game/bioscans.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/bioscans.dm b/code/game/bioscans.dm index 6676e31f3c1f..5be3c9fbe3fd 100644 --- a/code/game/bioscans.dm +++ b/code/game/bioscans.dm @@ -124,7 +124,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new) var/name = "[MAIN_AI_SYSTEM] Bioscan Status" var/input = "Bioscan failed. \n\nInvestigation into Bioscan subsystem recommended." log_ares_bioscan(name, input, forced) - if(ares_can_interface() || 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