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

Project ARES: Nerve Gas Control #5643

Merged
merged 22 commits into from
Apr 16, 2024
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
3 changes: 2 additions & 1 deletion code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// High Command, can read the deletion log.
#define ARES_ACCESS_HIGH 9
#define ARES_ACCESS_WY_COMMAND 10
/// Debugging. Allows me to view everything without using a high command rank. Unlikely to stay in a full merge.
/// Debugging. Allows me to view everything without using a high command rank.
#define ARES_ACCESS_DEBUG 11

#define ARES_RECORD_ANNOUNCE "Announcement Record"
Expand Down Expand Up @@ -78,6 +78,7 @@
/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
#define COOLDOWN_ARES_VENT 60 SECONDS

/// Time until someone can respawn as Working Joe
#define JOE_JOIN_DEAD_TIME (15 MINUTES)
85 changes: 56 additions & 29 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
data["active_ref"] = active_ref
data["conversations"] = logged_convos

data["security_vents"] = link.get_ares_vents()

return data

/obj/structure/machinery/computer/ares_console/ui_status(mob/user, datum/ui_state/state)
Expand All @@ -227,19 +229,19 @@
. = ..()
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(.)
return

playsound(src, "keyboard_alt", 15, 1)
var/mob/living/carbon/human/operator = ui.user
var/mob/user = ui.user
var/playsound = TRUE

switch (action)
if("go_back")
if(!last_menu)
return to_chat(operator, SPAN_WARNING("Error, no previous page detected."))
return to_chat(user, SPAN_WARNING("Error, no previous page detected."))
var/temp_holder = current_menu
current_menu = last_menu
last_menu = temp_holder

if("login")
var/mob/living/carbon/human/operator = user
var/obj/item/card/id/idcard = operator.get_active_hand()
if(istype(idcard))
authentication = get_ares_access(idcard)
Expand All @@ -250,22 +252,22 @@
authentication = get_ares_access(idcard)
last_login = idcard.registered_name
else
to_chat(operator, SPAN_WARNING("You require an ID card to access this terminal!"))
to_chat(user, SPAN_WARNING("You require an ID card to access this terminal!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(authentication)
datacore.interface_access_list += "[last_login] at [worldtime2text()], Access Level [authentication] - [ares_auth_to_text(authentication)]."
current_menu = "main"

if("sudo")
var/new_user = tgui_input_text(operator, "Enter Sudo Username", "Sudo User", encode = FALSE)
var/new_user = tgui_input_text(user, "Enter Sudo Username", "Sudo User", encode = FALSE)
if(new_user)
if(new_user == sudo_holder)
last_login = sudo_holder
sudo_holder = null
return FALSE
if(new_user == last_login)
to_chat(operator, SPAN_WARNING("Already remote logged in as this user."))
to_chat(user, SPAN_WARNING("Already remote logged in as this user."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
sudo_holder = last_login
Expand Down Expand Up @@ -331,6 +333,9 @@
if("page_tech")
last_menu = current_menu
current_menu = "tech_log"
if("page_core_sec")
last_menu = current_menu
current_menu = "core_security"

// -- Delete Button -- //
if("delete_record")
Expand Down Expand Up @@ -388,9 +393,9 @@
datacore.records_talking -= conversation

if("message_ares")
var/message = tgui_input_text(operator, "What do you wish to say to ARES?", "ARES Message", encode = FALSE)
var/message = tgui_input_text(user, "What do you wish to say to ARES?", "ARES Message", encode = FALSE)
if(message)
message_ares(message, operator, params["active_convo"])
message_ares(message, user, params["active_convo"])

if("read_record")
var/datum/ares_record/deleted_talk/conversation = locate(params["record"])
Expand All @@ -403,93 +408,115 @@
// -- Emergency Buttons -- //
if("general_quarters")
if(!COOLDOWN_FINISHED(datacore, ares_quarters_cooldown))
to_chat(operator, SPAN_WARNING("It has not been long enough since the last General Quarters call!"))
to_chat(user, SPAN_WARNING("It has not been long enough since the last General Quarters call!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level < SEC_LEVEL_RED)
set_security_level(SEC_LEVEL_RED, no_sound = TRUE, announce = FALSE)
shipwide_ai_announcement("ATTENTION! GENERAL QUARTERS. ALL HANDS, MAN YOUR BATTLESTATIONS.", MAIN_AI_SYSTEM, 'sound/effects/GQfullcall.ogg')
log_game("[key_name(operator)] has called for general quarters via ARES.")
message_admins("[key_name_admin(operator)] has called for general quarters via ARES.")
log_game("[key_name(user)] has called for general quarters via ARES.")
message_admins("[key_name_admin(user)] has called for general quarters via ARES.")
log_ares_security("General Quarters", "[last_login] has called for general quarters via ARES.")
COOLDOWN_START(datacore, ares_quarters_cooldown, 10 MINUTES)
. = TRUE

if("evacuation_start")
if(GLOB.security_level < SEC_LEVEL_RED)
to_chat(operator, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
to_chat(user, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

if(SShijack.evac_admin_denied)
to_chat(operator, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
to_chat(user, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

if(!SShijack.initiate_evacuation())
to_chat(operator, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
to_chat(user, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

log_game("[key_name(operator)] has called for an emergency evacuation via ARES.")
message_admins("[key_name_admin(operator)] has called for an emergency evacuation via ARES.")
log_game("[key_name(user)] has called for an emergency evacuation via ARES.")
message_admins("[key_name_admin(user)] has called for an emergency evacuation via ARES.")
log_ares_security("Initiate Evacuation", "[last_login] has called for an emergency evacuation via ARES.")
. = TRUE

if("distress")
if(!SSticker.mode)
return FALSE //Not a game mode?
if(world.time < DISTRESS_TIME_LOCK)
to_chat(operator, SPAN_WARNING("You have been here for less than six minutes... what could you possibly have done!"))
to_chat(user, SPAN_WARNING("You have been here for less than six minutes... what could you possibly have done!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(datacore, ares_distress_cooldown))
to_chat(operator, SPAN_WARNING("The distress launcher is cooling down!"))
to_chat(user, SPAN_WARNING("The distress launcher is cooling down!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level == SEC_LEVEL_DELTA)
to_chat(operator, SPAN_WARNING("The ship is already undergoing self destruct procedures!"))
to_chat(user, SPAN_WARNING("The ship is already undergoing self destruct procedures!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level < SEC_LEVEL_RED)
to_chat(operator, SPAN_WARNING("The ship must be under red alert to launch a distress beacon!"))
to_chat(user, SPAN_WARNING("The ship must be under red alert to launch a distress beacon!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
SSticker.mode.request_ert(operator, TRUE)
to_chat(operator, SPAN_NOTICE("A distress beacon request has been sent to USCM High Command."))
SSticker.mode.request_ert(user, TRUE)
to_chat(user, SPAN_NOTICE("A distress beacon request has been sent to USCM High Command."))
COOLDOWN_START(datacore, ares_distress_cooldown, COOLDOWN_COMM_REQUEST)
return TRUE

if("nuclearbomb")
if(!SSticker.mode)
return FALSE //Not a game mode?
if(world.time < NUCLEAR_TIME_LOCK)
to_chat(operator, SPAN_WARNING("It is too soon to request Nuclear Ordnance!"))
to_chat(user, SPAN_WARNING("It is too soon to request Nuclear Ordnance!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(datacore, ares_nuclear_cooldown))
to_chat(operator, SPAN_WARNING("The ordnance request frequency is garbled, wait for reset!"))
to_chat(user, SPAN_WARNING("The ordnance request frequency is garbled, wait for reset!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level == SEC_LEVEL_DELTA || SSticker.mode.is_in_endgame)
to_chat(operator, SPAN_WARNING("The mission has failed catastrophically, what do you want a nuke for?!"))
to_chat(user, SPAN_WARNING("The mission has failed catastrophically, what do you want a nuke for?!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
var/reason = tgui_input_text(operator, "Please enter reason nuclear ordnance is required.", "Reason for Nuclear Ordnance")
var/reason = tgui_input_text(user, "Please enter reason nuclear ordnance is required.", "Reason for Nuclear Ordnance")
if(!reason)
return FALSE
for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(operator)] has requested use of Nuclear Ordnance (via ARES)! Reason: <b>[reason]</b> [CC_MARK(operator)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukeapprove=\ref[operator]'>APPROVE</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukedeny=\ref[operator]'>DENY</A>) [ADMIN_JMP_USER(operator)] [CC_REPLY(operator)]")
to_chat(operator, SPAN_NOTICE("A nuclear ordnance request has been sent to USCM High Command for the following reason: [reason]"))
message_admins("[key_name(user)] has requested use of Nuclear Ordnance (via ARES)! Reason: <b>[reason]</b> [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukeapprove=\ref[user]'>APPROVE</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukedeny=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
to_chat(user, SPAN_NOTICE("A nuclear ordnance request has been sent to USCM High Command for the following reason: [reason]"))
log_ares_security("Nuclear Ordnance Request", "[last_login] has sent a request for nuclear ordnance for the following reason: [reason]")
if(ares_can_interface())
ai_silent_announcement("[last_login] has sent a request for nuclear ordnance to USCM High Command.", ".V")
ai_silent_announcement("Reason given: [reason].", ".V")
COOLDOWN_START(datacore, ares_nuclear_cooldown, COOLDOWN_COMM_DESTRUCT)
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(user, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(user, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(user, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if(playsound)
playsound(src, "keyboard_alt", 15, 1)
23 changes: 23 additions & 0 deletions code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@
logged_access += list(current_ticket)
data["access_tickets"] = logged_access

data["security_vents"] = get_ares_vents()

return data


Expand Down Expand Up @@ -321,6 +323,9 @@
if("page_tech")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "tech_log"
if("page_core_sec")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "core_security"
if("page_access_management")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "access_management"
Expand Down Expand Up @@ -491,3 +496,21 @@
ares_apollo_talk("Priority [ticket.ticket_type] [ticket.ticket_id] has been [choice] by [MAIN_AI_SYSTEM].")
to_chat(user, SPAN_NOTICE("[ticket.ticket_type] [ticket.ticket_id] marked as [choice]."))
return TRUE

if("trigger_vent")
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(user, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(user, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(user, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[MAIN_AI_SYSTEM] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")
24 changes: 24 additions & 0 deletions code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
requesting_access += access_ticket.ticket_name
data["access_tickets"] = logged_access

data["security_vents"] = link.get_ares_vents()

return data

/obj/structure/machinery/computer/working_joe/ui_status(mob/user, datum/ui_state/state)
Expand Down Expand Up @@ -211,6 +213,9 @@
if("page_maintenance")
last_menu = current_menu
current_menu = "maint_claim"
if("page_core_gas")
last_menu = current_menu
current_menu = "core_security_gas"

if("toggle_sound")
notify_sounds = !notify_sounds
Expand Down Expand Up @@ -413,6 +418,25 @@
playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0)
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(operator, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(operator, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(operator, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if(playsound)
playsound(src, "keyboard_alt", 15, 1)

Expand Down
21 changes: 21 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/datum/ares_datacore/datacore

var/list/obj/structure/machinery/computer/working_joe/ticket_computers = list()
/// Linked security gas vents.
var/list/linked_vents = list()
/// The tag number for generated vent labels, if none is manually set.
var/tag_num = 1

/// Working Joe stuff
var/list/tickets_maintenance = list()
Expand All @@ -50,6 +54,23 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
alert.delink()
..()

/datum/ares_link/proc/get_ares_vents()
var/list/security_vents = list()
var/datum/ares_link/link = GLOB.ares_link
for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents)
if(!vent.vent_tag)
vent.vent_tag = "Security Vent #[link.tag_num]"
link.tag_num++

var/list/current_vent = list()
var/is_available = COOLDOWN_FINISHED(vent, vent_trigger_cooldown)
current_vent["vent_tag"] = vent.vent_tag
current_vent["ref"] = "\ref[vent]"
current_vent["available"] = is_available
security_vents += list(current_vent)
return security_vents


/* BELOW ARE IN AdminAres.dm
/datum/ares_link/tgui_interact(mob/user, datum/tgui/ui)
/datum/ares_link/ui_data(mob/user)
Expand Down
24 changes: 24 additions & 0 deletions code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@
requesting_access += access_ticket.ticket_name
data["access_tickets"] = logged_access

data["security_vents"] = link.get_ares_vents()

return data

/obj/item/device/working_joe_pda/ui_status(mob/user, datum/ui_state/state)
Expand Down Expand Up @@ -237,6 +239,9 @@
if("page_maintenance")
last_menu = current_menu
current_menu = "maint_claim"
if("page_core_gas")
last_menu = current_menu
current_menu = "core_security_gas"

if("toggle_sound")
notify_sounds = !notify_sounds
Expand Down Expand Up @@ -439,6 +444,25 @@
playsound_client(id_owner?.client, 'sound/machines/pda_ping.ogg', src, 25, 0)
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(operator, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(operator, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(operator, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if(playsound)
var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg')
playsound(src, sound, 15, TRUE)
Loading
Loading