From 171108cafd6e431596ccd62e12530554c15e1330 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 31 Jan 2024 21:48:50 +0000 Subject: [PATCH 01/16] start --- code/game/machinery/ARES/ARES_interface.dm | 15 ++++++++++ code/game/machinery/ARES/ARES_procs.dm | 4 +++ .../structures/pipes/vents/pump_scrubber.dm | 28 +++++++++++++++++++ maps/map_files/USS_Almayer/USS_Almayer.dmm | 11 +++----- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index aa1cd92547ec..3d2f9ed3275d 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -203,6 +203,21 @@ data["active_ref"] = active_ref data["conversations"] = logged_convos + var/list/security_vents = list() + for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent as anything in link.linked_vents) + if(!istype(vent)) + continue + if(!vent.vent_tag) + vent.vent_tag = "Security Vent #[link.tag_num]" + link.tag_num++ + + var/list/current_vent = list() + current_vent["vent_tag"] = vent.vent_tag + current_vent["ref"] = "\ref[vent]" + security_vents += list(current_vent) + + data["security_vents"] = security_vents + return data /obj/structure/machinery/computer/ares_console/ui_status(mob/user, datum/ui_state/state) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 8113614d9b92..f2a14b525560 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -26,6 +26,10 @@ GLOBAL_LIST_INIT(maintenance_categories, list( var/obj/structure/machinery/ares/processor/bioscan/processor_bioscan var/obj/structure/machinery/computer/ares_console/interface 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() diff --git a/code/game/objects/structures/pipes/vents/pump_scrubber.dm b/code/game/objects/structures/pipes/vents/pump_scrubber.dm index a4565c610ad5..08c2302290c6 100644 --- a/code/game/objects/structures/pipes/vents/pump_scrubber.dm +++ b/code/game/objects/structures/pipes/vents/pump_scrubber.dm @@ -21,6 +21,34 @@ name = "Reinforced Air Vent" explodey = FALSE +/// Vents that are linked to ARES Security Protocols, allowing the ARES Interface to trigger security measures. +/obj/structure/pipes/vents/pump/no_boom/gas + name = "Security Air Vent" + var/datum/ares_link/link + var/vent_tag + +/obj/structure/pipes/vents/pump/no_boom/gas/Initialize() + link_systems(override = FALSE) + . = ..() + +/obj/structure/pipes/vents/pump/no_boom/gas/Destroy() + delink() + return ..() + +/obj/structure/pipes/vents/pump/no_boom/gas/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) + if(link && !override) + return FALSE + delink() + if(new_link) + link = new_link + new_link.linked_vents += src + return TRUE + +/obj/structure/pipes/vents/pump/no_boom/gas/proc/delink() + if(link) + link.linked_vents -= src + link = null + /obj/structure/pipes/vents/pump/on icon_state = "on" diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index 64e110d30248..cdc5a1aa97fa 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -28574,7 +28574,7 @@ /obj/structure/machinery/light{ dir = 8 }, -/obj/structure/pipes/vents/pump/no_boom{ +/obj/structure/pipes/vents/pump/no_boom/gas{ dir = 1 }, /turf/open/floor/almayer/no_build{ @@ -59443,7 +59443,7 @@ /obj/structure/machinery/light{ dir = 4 }, -/obj/structure/pipes/vents/pump/no_boom{ +/obj/structure/pipes/vents/pump/no_boom/gas{ dir = 8 }, /turf/open/floor/almayer/no_build{ @@ -77510,10 +77510,7 @@ /obj/structure/bed/chair/comfy/ares{ dir = 1 }, -/obj/structure/pipes/vents/pump/no_boom{ - desc = "Has a valve and pump attached to it, connected to multiple gas tanks."; - name = "Security Vent" - }, +/obj/structure/pipes/vents/pump/no_boom/gas, /turf/open/floor/almayer/no_build{ icon_state = "plating" }, @@ -82695,7 +82692,7 @@ /obj/structure/machinery/light{ dir = 4 }, -/obj/structure/pipes/vents/pump/no_boom{ +/obj/structure/pipes/vents/pump/no_boom/gas{ dir = 1 }, /turf/open/floor/almayer/no_build{ From 5d83a9469a919818eab10c6b52e270e5449f6575 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Thu, 1 Feb 2024 20:40:01 +0000 Subject: [PATCH 02/16] x --- code/__DEFINES/ARES.dm | 1 + code/game/machinery/ARES/ARES_interface.dm | 77 ++++++++++------- .../structures/pipes/vents/pump_scrubber.dm | 1 + .../tgui/interfaces/AresInterface.jsx | 84 +++++++++++++++++++ 4 files changed, 134 insertions(+), 29 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index a1b82af25821..ee235df3da9c 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -70,3 +70,4 @@ /// Cooldowns #define COOLDOWN_ARES_SENSOR 60 SECONDS #define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS +#define COOLDOWN_ARES_VENT 60 SECONDS diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 3d2f9ed3275d..fa71b4607627 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -231,19 +231,19 @@ . = ..() if(.) return - - playsound(src, "keyboard_alt", 15, 1) + var/mob/user = usr + var/playsound = TRUE switch (action) if("go_back") if(!last_menu) - return to_chat(usr, 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 = usr + 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) @@ -254,7 +254,7 @@ authentication = get_ares_access(idcard) last_login = idcard.registered_name else - to_chat(usr, 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) @@ -262,14 +262,14 @@ current_menu = "main" if("sudo") - var/new_user = tgui_input_text(usr, "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(usr, 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 @@ -330,6 +330,9 @@ if("page_deleted_1to1") last_menu = current_menu current_menu = "deleted_talks" + if("page_core_sec") + last_menu = current_menu + current_menu = "core_security" // -- Delete Button -- // if("delete_record") @@ -381,9 +384,9 @@ datacore.records_talking -= conversation if("message_ares") - var/message = tgui_input_text(usr, "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, usr, params["active_convo"]) + message_ares(message, user, params["active_convo"]) if("read_record") var/datum/ares_record/deleted_talk/conversation = locate(params["record"]) @@ -394,36 +397,36 @@ // -- Emergency Buttons -- // if("general_quarters") if(!COOLDOWN_FINISHED(datacore, ares_quarters_cooldown)) - to_chat(usr, 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(usr)] has called for general quarters via ARES.") - message_admins("[key_name_admin(usr)] 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(usr, 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(usr, 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(usr, 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(usr)] has called for an emergency evacuation via ARES.") - message_admins("[key_name_admin(usr)] 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 @@ -431,27 +434,27 @@ if(!SSticker.mode) return FALSE //Not a game mode? if(world.time < DISTRESS_TIME_LOCK) - to_chat(usr, 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(usr, 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(usr, 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(usr, 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(usr, TRUE) - to_chat(usr, 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 @@ -459,28 +462,44 @@ if(!SSticker.mode) return FALSE //Not a game mode? if(world.time < NUCLEAR_TIME_LOCK) - to_chat(usr, 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(usr, 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(usr, 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(usr, "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(usr)] has requested use of Nuclear Ordnance (via ARES)! Reason: [reason] [CC_MARK(usr)] (APPROVE) (DENY) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]") - to_chat(usr, 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: [reason] [CC_MARK(user)] (APPROVE) (DENY) [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.")) + return FALSE + if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown)) + return FALSE + COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT) + 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, 4, 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) diff --git a/code/game/objects/structures/pipes/vents/pump_scrubber.dm b/code/game/objects/structures/pipes/vents/pump_scrubber.dm index 08c2302290c6..acc8b4784af9 100644 --- a/code/game/objects/structures/pipes/vents/pump_scrubber.dm +++ b/code/game/objects/structures/pipes/vents/pump_scrubber.dm @@ -26,6 +26,7 @@ name = "Security Air Vent" var/datum/ares_link/link var/vent_tag + COOLDOWN_DECLARE(vent_trigger_cooldown) /obj/structure/pipes/vents/pump/no_boom/gas/Initialize() link_systems(override = FALSE) diff --git a/tgui/packages/tgui/interfaces/AresInterface.jsx b/tgui/packages/tgui/interfaces/AresInterface.jsx index f2ced09014f6..437345bff5b9 100644 --- a/tgui/packages/tgui/interfaces/AresInterface.jsx +++ b/tgui/packages/tgui/interfaces/AresInterface.jsx @@ -18,6 +18,7 @@ const PAGES = { 'security': () => Security, 'requisitions': () => Requisitions, 'emergency': () => Emergency, + 'core_security': () => CoreSec, }; export const AresInterface = (props) => { @@ -279,6 +280,19 @@ const MainMenu = (props) => { onClick={() => act('page_access')} /> + +