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

ARES Death and Consequences; The Prequel #5275

Merged
merged 10 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/game/bioscans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
30 changes: 24 additions & 6 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/ARES/ARES_step_triggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand Down Expand Up @@ -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!"))
Expand Down
26 changes: 18 additions & 8 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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."))
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/silicon/decoy/decoy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down