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 5 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
2 changes: 1 addition & 1 deletion 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 Down
20 changes: 16 additions & 4 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved

/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,26 +96,31 @@ 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
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
21 changes: 16 additions & 5 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved

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 +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")
Expand All @@ -592,13 +598,18 @@

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
}
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved

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
11 changes: 11 additions & 0 deletions code/modules/mob/living/silicon/decoy/decoy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
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)
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
}
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved

Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
/mob/living/silicon/decoy/say(message) //General communication across the ship.
if(stat || !message)
return FALSE
Expand Down