From 47a1d0d62cfaa0f71e834b1d6bd5f60d22bade16 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 26 Oct 2024 21:04:04 +0100 Subject: [PATCH 1/2] start --- code/__DEFINES/wycomputer.dm | 5 + code/game/machinery/computer/wy_computer.dm | 156 ++++++++++++++ code/game/machinery/doors/poddoor/almayer.dm | 5 + colonialmarines.dme | 2 + maps/map_files/USS_Almayer/USS_Almayer.dmm | 6 +- tgui/packages/tgui/interfaces/WYComputer.jsx | 215 +++++++++++++++++++ 6 files changed, 384 insertions(+), 5 deletions(-) create mode 100644 code/__DEFINES/wycomputer.dm create mode 100644 code/game/machinery/computer/wy_computer.dm create mode 100644 tgui/packages/tgui/interfaces/WYComputer.jsx diff --git a/code/__DEFINES/wycomputer.dm b/code/__DEFINES/wycomputer.dm new file mode 100644 index 000000000000..8d7dded87c90 --- /dev/null +++ b/code/__DEFINES/wycomputer.dm @@ -0,0 +1,5 @@ +#define WY_COMP_ACCESS_DIRECTOR 6 +#define WY_COMP_ACCESS_SENIOR_LEAD 5 +#define WY_COMP_ACCESS_CORPORATE 2 +#define WY_COMP_ACCESS_FORBIDDEN 1 +#define WY_COMP_ACCESS_LOGGED_OUT 0 diff --git a/code/game/machinery/computer/wy_computer.dm b/code/game/machinery/computer/wy_computer.dm new file mode 100644 index 000000000000..e846c4cd1d94 --- /dev/null +++ b/code/game/machinery/computer/wy_computer.dm @@ -0,0 +1,156 @@ +// #################### WY Intranet Console ##################### +/obj/structure/machinery/computer/wy_intranet + name = "WY Intranet Terminal" + desc = "A standard issue Weyland-Yutani terminal for accessing the corporate intranet." + icon_state = "medlaptop" + explo_proof = TRUE + + var/current_menu = "login" + var/last_menu = "" + + /// The last person to login. + var/last_login = "No User" + + var/authentication = WY_COMP_ACCESS_LOGGED_OUT + + /// A list of everyone who has logged in. + var/list/login_history = list() + + /// The ID of the wall divider(s) linked to this console. + var/divider_id + + COOLDOWN_DECLARE(printer_cooldown) + +/obj/structure/machinery/computer/wy_intranet/liaison + divider_id = "CLRoomDivider" + +// ------ WY Intranet Console UI ------ // + +/obj/structure/machinery/computer/wy_intranet/attack_hand(mob/user as mob) + if(..() || !allowed(usr) || inoperable()) + return FALSE + + tgui_interact(user) + return TRUE + +/obj/structure/machinery/computer/wy_intranet/tgui_interact(mob/user, datum/tgui/ui, datum/ui_state/state) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "WYComputer", name) + ui.open() + +/obj/structure/machinery/computer/wy_intranet/ui_data(mob/user) + var/list/data = list() + + data["current_menu"] = current_menu + data["last_page"] = last_menu + data["logged_in"] = last_login + + data["access_text"] = "intranet level [authentication], [wy_auth_to_text(authentication)]." + data["access_level"] = authentication + + data["alert_level"] = GLOB.security_level + data["worldtime"] = world.time + + data["access_log"] = login_history + + + data["printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown) + + + return data + +/obj/structure/machinery/computer/wy_intranet/ui_status(mob/user, datum/ui_state/state) + . = ..() + if(!allowed(user)) + return UI_UPDATE + if(inoperable()) + return UI_DISABLED + +/obj/structure/machinery/computer/wy_intranet/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + var/mob/user = ui.user + var/playsound = TRUE + + switch (action) + if("go_back") + if(!last_menu) + 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/human_user = user + var/obj/item/card/id/idcard = human_user.get_active_hand() + if(istype(idcard)) + authentication = get_wy_access(idcard) + last_login = idcard.registered_name + else if(human_user.wear_id) + idcard = human_user.get_idcard() + if(idcard) + authentication = get_wy_access(idcard) + last_login = idcard.registered_name + else + to_chat(human_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) + login_history += "[last_login] at [worldtime2text()], Intranet Tier [authentication] - [wy_auth_to_text(authentication)]." + current_menu = "main" + + // -- Page Changers -- // + if("logout") + last_menu = current_menu + current_menu = "login" + login_history += "[last_login] logged out at [worldtime2text()]." + last_login = "No User" + authentication = WY_COMP_ACCESS_LOGGED_OUT + + if("home") + last_menu = current_menu + current_menu = "main" + if("page_1to1") + last_menu = current_menu + current_menu = "talking" + if("page_announcements") + last_menu = current_menu + current_menu = "announcements" + + if("unlock_divider") + for(var/obj/structure/machinery/door/poddoor/divider in GLOB.machines) + if(divider.id == divider_id) + if(divider.density) + INVOKE_ASYNC(divider, TYPE_PROC_REF(/obj/structure/machinery/door, open)) + else + INVOKE_ASYNC(divider, TYPE_PROC_REF(/obj/structure/machinery/door, close)) + + if(playsound) + playsound(src, "keyboard_alt", 15, 1) + + + +/obj/structure/machinery/computer/proc/get_wy_access(obj/item/card/id/card) + if(card.paygrade in GLOB.wy_highcom_paygrades) + return WY_COMP_ACCESS_SENIOR_LEAD + if(ACCESS_WY_GENERAL in card.access) + return WY_COMP_ACCESS_CORPORATE + else + return WY_COMP_ACCESS_FORBIDDEN + + + +/obj/structure/machinery/computer/proc/wy_auth_to_text(access_level) + switch(access_level) + if(WY_COMP_ACCESS_LOGGED_OUT) + return "Logged Out" + if(WY_COMP_ACCESS_FORBIDDEN) + return "Unauthorized User" + if(WY_COMP_ACCESS_CORPORATE) + return "Weyland-Yutani Employee" + if(WY_COMP_ACCESS_SENIOR_LEAD) + return "Weyland-Yutani Senior Leadership" + if(WY_COMP_ACCESS_DIRECTOR) + return "Weyland-Yutani Directorate" diff --git a/code/game/machinery/doors/poddoor/almayer.dm b/code/game/machinery/doors/poddoor/almayer.dm index 2b296412df7d..e264c9cb7f0f 100644 --- a/code/game/machinery/doors/poddoor/almayer.dm +++ b/code/game/machinery/doors/poddoor/almayer.dm @@ -22,6 +22,11 @@ icon_state = "almayer_pdoor1" base_icon_state = "almayer_pdoor" +/obj/structure/machinery/door/poddoor/almayer/blended/liaison + name = "\improper Room Divider" + id = "CLRoomDivider" + layer = 3.1 + /obj/structure/machinery/door/poddoor/almayer/blended/open density = FALSE diff --git a/colonialmarines.dme b/colonialmarines.dme index 4f2a681799d9..54d5c0b4de24 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -123,6 +123,7 @@ #include "code\__DEFINES\vv.dm" #include "code\__DEFINES\weapon_stats.dm" #include "code\__DEFINES\weather.dm" +#include "code\__DEFINES\wycomputer.dm" #include "code\__DEFINES\xeno.dm" #include "code\__DEFINES\dcs\flags.dm" #include "code\__DEFINES\dcs\helpers.dm" @@ -942,6 +943,7 @@ #include "code\game\machinery\computer\sentencing.dm" #include "code\game\machinery\computer\skills.dm" #include "code\game\machinery\computer\station_alert.dm" +#include "code\game\machinery\computer\wy_computer.dm" #include "code\game\machinery\door_display\door_display.dm" #include "code\game\machinery\doors\airlock.dm" #include "code\game\machinery\doors\airlock_control.dm" diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index 52fdc85ca8cb..82f6025d8a88 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -66993,11 +66993,7 @@ /turf/closed/wall/almayer, /area/almayer/command/securestorage) "xqQ" = ( -/obj/structure/machinery/door/poddoor/almayer/blended{ - id = "RoomDivider"; - layer = 3.1; - name = "\improper Room Divider" - }, +/obj/structure/machinery/door/poddoor/almayer/blended/liaison, /turf/open/floor/almayer/plate, /area/almayer/command/corporateliaison) "xrg" = ( diff --git a/tgui/packages/tgui/interfaces/WYComputer.jsx b/tgui/packages/tgui/interfaces/WYComputer.jsx new file mode 100644 index 000000000000..4df248eeaa94 --- /dev/null +++ b/tgui/packages/tgui/interfaces/WYComputer.jsx @@ -0,0 +1,215 @@ +// -------------------------------------------------------------------- // +// Please ensure when updating this menu, changes are reflected in AresAdmin.js +// -------------------------------------------------------------------- // + +import { useBackend } from '../backend'; +import { Box, Button, Flex, Section, Stack } from '../components'; +import { Window } from '../layouts'; + +const PAGES = { + login: () => Login, + main: () => MainMenu, +}; + +export const WYComputer = (props) => { + const { data } = useBackend(); + const { current_menu, last_page, access_text, logged_in } = data; + const PageComponent = PAGES[current_menu](); + + let themecolor = 'crtyellow'; + if (current_menu === 'emergency') { + themecolor = 'crtred'; + } + + return ( + + {!!current_menu === 'Login' && ( +
+ + +
+ )} + + + + +
+ ); +}; + +const Login = (props) => { + const { act } = useBackend(); + + return ( + + WY Intranet Terminal + + WY-DOS Executive + + Version 1.3.7 + Copyright © 2182, Weyland Yutani Corp. + + + + ); +}; + +const MainMenu = (props) => { + const { data, act } = useBackend(); + const { logged_in, access_text, last_page, current_menu, access_level } = + data; + + return ( + <> +
+ + +
+ +
+

Navigation Menu

+ + {access_level >= 4 && ( + + +

Intranet Tier 4

+
+ + + +
+ )} +
+ {access_level >= 3 && ( +
+

Security Protocols

+ + + act('unlock_divider')} + > + Room Divider + + + + + + +
+ )} + + ); +}; From a7f2e5adf7b7259edfdf2aa1579f29f805046d59 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 6 Nov 2024 02:48:45 +0000 Subject: [PATCH 2/2] Intranet Console --- code/__DEFINES/ARES.dm | 2 + code/__DEFINES/objects.dm | 1 + code/__DEFINES/wycomputer.dm | 15 +- code/game/machinery/ARES/ARES_interface.dm | 2 +- .../machinery/ARES/ARES_interface_admin.dm | 2 +- .../machinery/ARES/ARES_interface_apollo.dm | 2 +- code/game/machinery/ARES/ARES_procs.dm | 2 +- code/game/machinery/ARES/apollo_pda.dm | 2 +- code/game/machinery/computer/wy_computer.dm | 251 ++++++++++++++++-- code/game/machinery/doors/poddoor/almayer.dm | 6 +- .../structures/pipes/vents/pump_scrubber.dm | 22 +- maps/map_files/USS_Almayer/USS_Almayer.dmm | 76 +++--- tgui/packages/tgui/interfaces/WYComputer.jsx | 236 +++++++++++++--- 13 files changed, 510 insertions(+), 109 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index 55aa68f97309..bf1684d62941 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -82,3 +82,5 @@ /// Time until someone can respawn as Working Joe #define JOE_JOIN_DEAD_TIME (15 MINUTES) + +GLOBAL_LIST_EMPTY_TYPED(gas_vents, /obj/structure/pipes/vents/pump/no_boom/gas) diff --git a/code/__DEFINES/objects.dm b/code/__DEFINES/objects.dm index 26db2f3d2254..bc8752a1e9ae 100644 --- a/code/__DEFINES/objects.dm +++ b/code/__DEFINES/objects.dm @@ -87,6 +87,7 @@ GLOBAL_LIST_INIT(RESTRICTED_CAMERA_NETWORKS, list( //Those networks can only be CAMERA_NET_COLONY, CAMERA_NET_OVERWATCH, CAMERA_NET_ARES, + CAMERA_NET_CONTAINMENT_HIDDEN, )) #define STASIS_IN_BAG 1 diff --git a/code/__DEFINES/wycomputer.dm b/code/__DEFINES/wycomputer.dm index 8d7dded87c90..e51a035f0471 100644 --- a/code/__DEFINES/wycomputer.dm +++ b/code/__DEFINES/wycomputer.dm @@ -1,5 +1,16 @@ -#define WY_COMP_ACCESS_DIRECTOR 6 -#define WY_COMP_ACCESS_SENIOR_LEAD 5 +/// WY Corporate Director +#define WY_COMP_ACCESS_DIRECTOR 7 +/// WY Corporate Leadership (Chief Exec and Div Manager) +#define WY_COMP_ACCESS_SENIOR_LEAD 6 +/// WY Corporate Supervisors (Asst. Manager and Exec. Supervisor) +#define WY_COMP_ACCESS_SUPERVISOR 5 +/// WY Senior Employees (Exec. Specialists and Senior Execs.) +#define WY_COMP_ACCESS_CORPORATE_SENIOR 4 +/// WY Corporate Liaison +#define WY_COMP_ACCESS_LIAISON 3 +/// WY Corporate Employees #define WY_COMP_ACCESS_CORPORATE 2 +/// Unauthenticated Personnel #define WY_COMP_ACCESS_FORBIDDEN 1 +/// Logged out... #define WY_COMP_ACCESS_LOGGED_OUT 0 diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 1c6d085d5ed0..3a4c14ebe037 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -575,7 +575,7 @@ if("trigger_vent") playsound = FALSE - var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"]) + var/obj/structure/pipes/vents/pump/no_boom/gas/ares/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) diff --git a/code/game/machinery/ARES/ARES_interface_admin.dm b/code/game/machinery/ARES/ARES_interface_admin.dm index 758ba9fbb5e7..dc9b8c5cb478 100644 --- a/code/game/machinery/ARES/ARES_interface_admin.dm +++ b/code/game/machinery/ARES/ARES_interface_admin.dm @@ -498,7 +498,7 @@ return TRUE if("trigger_vent") - var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"]) + var/obj/structure/pipes/vents/pump/no_boom/gas/ares/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) diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index 5c17f2ac87aa..b838cf89d668 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -420,7 +420,7 @@ if("trigger_vent") playsound = FALSE - var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"]) + var/obj/structure/pipes/vents/pump/no_boom/gas/ares/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) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index ef1b836a3d4b..6f45055020f6 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list( /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) + for(var/obj/structure/pipes/vents/pump/no_boom/gas/ares/vent in link.linked_vents) if(!vent.vent_tag) vent.vent_tag = "Security Vent #[link.tag_num]" link.tag_num++ diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index ad070a8e63c7..b97becd72445 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -447,7 +447,7 @@ if("trigger_vent") playsound = FALSE - var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"]) + var/obj/structure/pipes/vents/pump/no_boom/gas/ares/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) diff --git a/code/game/machinery/computer/wy_computer.dm b/code/game/machinery/computer/wy_computer.dm index e846c4cd1d94..b508ec82a077 100644 --- a/code/game/machinery/computer/wy_computer.dm +++ b/code/game/machinery/computer/wy_computer.dm @@ -17,12 +17,59 @@ var/list/login_history = list() /// The ID of the wall divider(s) linked to this console. - var/divider_id + var/divider_id = null + /// Whether or not the control panel for a hidden cell is available. + var/hidden_cell_id = null + /// The ID of any security systems. (Flashbulbs) + var/security_system_id = null + + // If the room divider, or cell doors/shutters are open or not. + var/open_divider = FALSE + var/open_cell_door = FALSE + var/open_cell_shutters = FALSE + + /// A loose number to order security vents if they aren't pre-ordered. + var/vent_tag_num = 1 + + /// Machinery the console interacts with (doors/shutters) + var/list/obj/structure/machinery/targets = list() COOLDOWN_DECLARE(printer_cooldown) + COOLDOWN_DECLARE(cell_flasher) + COOLDOWN_DECLARE(sec_flasher) + +/obj/structure/machinery/computer/wy_intranet/Initialize() + . = ..() + return INITIALIZE_HINT_LATELOAD + +/obj/structure/machinery/computer/wy_intranet/LateInitialize() + . = ..() + get_targets() + +/obj/structure/machinery/computer/wy_intranet/proc/get_targets() + targets = list() + for(var/obj/structure/machinery/door/target_door in GLOB.machines) + if(target_door.id == divider_id) + targets += target_door + continue + if(target_door.id == hidden_cell_id) + targets += target_door + + for(var/obj/structure/machinery/flasher/target_flash in GLOB.machines) + if(target_flash.id == hidden_cell_id) + targets += target_flash + continue + if(target_flash.id == security_system_id) + targets += target_flash + + for(var/obj/structure/pipes/vents/pump/no_boom/gas/gas_vent in GLOB.gas_vents) + if(gas_vent.network_id == security_system_id) + targets += gas_vent /obj/structure/machinery/computer/wy_intranet/liaison divider_id = "CLRoomDivider" + hidden_cell_id = "CL_Containment" + security_system_id = "CL_Security" // ------ WY Intranet Console UI ------ // @@ -46,7 +93,7 @@ data["last_page"] = last_menu data["logged_in"] = last_login - data["access_text"] = "intranet level [authentication], [wy_auth_to_text(authentication)]." + data["access_text"] = "Intranet Tier [authentication], [wy_auth_to_text(authentication)]." data["access_level"] = authentication data["alert_level"] = GLOB.security_level @@ -54,9 +101,17 @@ data["access_log"] = login_history + data["has_room_divider"] = divider_id + data["has_hidden_cell"] = hidden_cell_id + + data["open_divider"] = open_divider + data["open_cell_door"] = open_cell_door + data["open_cell_shutters"] = open_cell_shutters data["printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown) + data["cell_flash_cooldown"] = !COOLDOWN_FINISHED(src, cell_flasher) + data["security_vents"] = get_security_vents() return data @@ -112,20 +167,50 @@ if("home") last_menu = current_menu current_menu = "main" - if("page_1to1") - last_menu = current_menu - current_menu = "talking" - if("page_announcements") + if("page_vents") last_menu = current_menu - current_menu = "announcements" + current_menu = "vents" if("unlock_divider") - for(var/obj/structure/machinery/door/poddoor/divider in GLOB.machines) - if(divider.id == divider_id) - if(divider.density) - INVOKE_ASYNC(divider, TYPE_PROC_REF(/obj/structure/machinery/door, open)) - else - INVOKE_ASYNC(divider, TYPE_PROC_REF(/obj/structure/machinery/door, close)) + toggle_divider() + + if("cell_shutters") + if(!open_cell_shutters) + open_shutters() + else + close_door() + close_shutters() + + if("cell_door") + if(!open_cell_door) + open_door() + else + close_door() + + if("cell_flash") + trigger_cell_flash() + + if("security_flash") + trigger_sec_flash() + + 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, 30 SECONDS) + ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")//Ares still monitors release of gas, even in the CLs vents. + log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.") + sec_vent.create_gas(VENT_GAS_CN20, 6, 5 SECONDS) + log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via WY Intranet.") if(playsound) playsound(src, "keyboard_alt", 15, 1) @@ -133,9 +218,19 @@ /obj/structure/machinery/computer/proc/get_wy_access(obj/item/card/id/card) - if(card.paygrade in GLOB.wy_highcom_paygrades) - return WY_COMP_ACCESS_SENIOR_LEAD if(ACCESS_WY_GENERAL in card.access) + if(card.paygrade) + switch(card.paygrade) + if(PAY_SHORT_WYC10) + return WY_COMP_ACCESS_DIRECTOR + if(PAY_SHORT_WYC9, PAY_SHORT_WYC8) + return WY_COMP_ACCESS_SENIOR_LEAD + if(PAY_SHORT_WYC7, PAY_SHORT_WYC6) + return WY_COMP_ACCESS_SUPERVISOR + if(PAY_SHORT_WYC5, PAY_SHORT_WYC4) + return WY_COMP_ACCESS_CORPORATE_SENIOR + if(card.assignment == JOB_CORPORATE_LIAISON) + return WY_COMP_ACCESS_LIAISON return WY_COMP_ACCESS_CORPORATE else return WY_COMP_ACCESS_FORBIDDEN @@ -148,9 +243,135 @@ return "Logged Out" if(WY_COMP_ACCESS_FORBIDDEN) return "Unauthorized User" + if(WY_COMP_ACCESS_LIAISON) + return "Weyland-Yutani Liaison" if(WY_COMP_ACCESS_CORPORATE) return "Weyland-Yutani Employee" + if(WY_COMP_ACCESS_SUPERVISOR) + return "Weyland-Yutani Supervisor" if(WY_COMP_ACCESS_SENIOR_LEAD) return "Weyland-Yutani Senior Leadership" if(WY_COMP_ACCESS_DIRECTOR) return "Weyland-Yutani Directorate" + + + +// Opens and locks doors, power check +/obj/structure/machinery/computer/wy_intranet/proc/open_door(force = FALSE) + if(inoperable() && !force) + return FALSE + + for(var/obj/structure/machinery/door/airlock/target_door in targets) + if(target_door.id != hidden_cell_id) + continue + if(!target_door.density) + continue + target_door.unlock(force) + target_door.open(force) + open_cell_door = TRUE + + return TRUE + +// Closes and unlocks doors, power check +/obj/structure/machinery/computer/wy_intranet/proc/close_door() + if(inoperable()) + return FALSE + + for(var/obj/structure/machinery/door/airlock/target_door in targets) + if(target_door.id != hidden_cell_id) + continue + if(target_door.density) + continue + target_door.close() + target_door.lock() + open_cell_door = FALSE + + return TRUE + +// Opens and locks doors, power check +/obj/structure/machinery/computer/wy_intranet/proc/open_shutters(force = FALSE) + if(inoperable() && !force) + return FALSE + + for(var/obj/structure/machinery/door/poddoor/target_shutter in targets) + if(target_shutter.id != hidden_cell_id) + continue + if(target_shutter.stat & BROKEN) + continue + if(!target_shutter.density) + continue + target_shutter.open() + open_cell_shutters = TRUE + return TRUE + +// Closes and unlocks doors, power check +/obj/structure/machinery/computer/wy_intranet/proc/close_shutters() + if(inoperable()) + return FALSE + for(var/obj/structure/machinery/door/poddoor/target_shutter in targets) + if(target_shutter.id != hidden_cell_id) + continue + if(target_shutter.stat & BROKEN) + continue + if(target_shutter.density) + continue + target_shutter.close() + open_cell_shutters = FALSE + return TRUE + +/obj/structure/machinery/computer/wy_intranet/proc/toggle_divider() + if(inoperable()) + return FALSE + if(open_divider) + for(var/obj/structure/machinery/door/poddoor/divider in targets) + if(divider.id != divider_id) + continue + if(divider.density) + continue + divider.close() + open_divider = FALSE + else + for(var/obj/structure/machinery/door/poddoor/divider in targets) + if(divider.id != divider_id) + continue + if(!divider.density) + continue + divider.open() + open_divider = TRUE + +/obj/structure/machinery/computer/wy_intranet/proc/trigger_cell_flash() + if(!COOLDOWN_FINISHED(src, cell_flasher)) + return FALSE + + for(var/obj/structure/machinery/flasher/target_flash in targets) + if(target_flash.id != hidden_cell_id) + continue + target_flash.flash() + COOLDOWN_START(src, cell_flasher, 15 SECONDS) + return TRUE + +/obj/structure/machinery/computer/wy_intranet/proc/trigger_sec_flash() + if(!COOLDOWN_FINISHED(src, sec_flasher)) + return FALSE + + for(var/obj/structure/machinery/flasher/target_flash in targets) + if(target_flash.id != security_system_id) + continue + target_flash.flash() + COOLDOWN_START(src, sec_flasher, 15 SECONDS) + return TRUE + +/obj/structure/machinery/computer/wy_intranet/proc/get_security_vents() + var/list/security_vents = list() + for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in targets) + if(!vent.vent_tag) + vent.vent_tag = "Security Vent #[vent_tag_num]" + vent_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 diff --git a/code/game/machinery/doors/poddoor/almayer.dm b/code/game/machinery/doors/poddoor/almayer.dm index 77456c7cb507..4dc952541ab7 100644 --- a/code/game/machinery/doors/poddoor/almayer.dm +++ b/code/game/machinery/doors/poddoor/almayer.dm @@ -22,11 +22,6 @@ icon_state = "almayer_pdoor1" base_icon_state = "almayer_pdoor" -/obj/structure/machinery/door/poddoor/almayer/blended/liaison - name = "\improper Room Divider" - id = "CLRoomDivider" - layer = 3.1 - /obj/structure/machinery/door/poddoor/almayer/blended/open density = FALSE @@ -42,6 +37,7 @@ desc = "A metal wall used to separate rooms and make up the ship." icon_state = "liaison_pdoor1" base_icon_state = "liaison_pdoor" + id = "CLRoomDivider" /obj/structure/machinery/door/poddoor/almayer/blended/liaison/open density = FALSE diff --git a/code/game/objects/structures/pipes/vents/pump_scrubber.dm b/code/game/objects/structures/pipes/vents/pump_scrubber.dm index acc8b4784af9..6b88826d9444 100644 --- a/code/game/objects/structures/pipes/vents/pump_scrubber.dm +++ b/code/game/objects/structures/pipes/vents/pump_scrubber.dm @@ -21,22 +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 COOLDOWN_DECLARE(vent_trigger_cooldown) + var/network_id /obj/structure/pipes/vents/pump/no_boom/gas/Initialize() - link_systems(override = FALSE) + GLOB.gas_vents += src . = ..() /obj/structure/pipes/vents/pump/no_boom/gas/Destroy() + GLOB.gas_vents -= src + return ..() + +/// Vents that are linked to ARES Security Protocols, allowing the ARES Interface to trigger security measures. +/obj/structure/pipes/vents/pump/no_boom/gas/ares + var/datum/ares_link/link + network_id = MAIN_AI_SYSTEM + +/obj/structure/pipes/vents/pump/no_boom/gas/ares/Initialize() + link_systems(override = FALSE) + . = ..() + +/obj/structure/pipes/vents/pump/no_boom/gas/ares/Destroy() delink() return ..() -/obj/structure/pipes/vents/pump/no_boom/gas/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) +/obj/structure/pipes/vents/pump/no_boom/gas/ares/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override) if(link && !override) return FALSE delink() @@ -45,7 +57,7 @@ new_link.linked_vents += src return TRUE -/obj/structure/pipes/vents/pump/no_boom/gas/proc/delink() +/obj/structure/pipes/vents/pump/no_boom/gas/ares/proc/delink() if(link) link.linked_vents -= src link = null diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index 21f5bc72a9fb..319025e25553 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -12256,7 +12256,7 @@ /turf/open/floor/almayer, /area/almayer/hallways/lower/starboard_midship_hallway) "bMg" = ( -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ dir = 8; vent_tag = "Synth Bay" }, @@ -16481,12 +16481,12 @@ /area/almayer/hallways/upper/aft_hallway) "cNH" = ( /obj/structure/machinery/door/poddoor/shutters/almayer/containment{ - id = "Containment Cell 4"; + id = "CL_Containment"; name = "\improper Containment Cell 4" }, /obj/structure/machinery/door/airlock/almayer/research/glass/reinforced{ dir = 1; - id = "Containment Cell 4"; + id = "CL_Containment"; locked = 1; name = "\improper Containment Cell 4" }, @@ -16987,7 +16987,7 @@ "cXF" = ( /obj/structure/machinery/flasher{ alpha = 1; - id = "Containment Cell 4"; + id = "CL_Containment"; layer = 2.1; name = "Mounted Flash"; pixel_x = -15; @@ -18199,7 +18199,11 @@ /obj/item/desk_bell{ anchored = 1; pixel_x = -8; - pixel_y = 8 + pixel_y = 9 + }, +/obj/structure/machinery/door_control/cl/office/evac{ + pixel_x = -5; + pixel_y = -3 }, /turf/open/floor/carpet, /area/almayer/command/corporateliaison) @@ -21074,14 +21078,6 @@ pixel_x = 2; pixel_y = 9 }, -/obj/structure/machinery/door_control/cl/office/window{ - pixel_x = 6; - pixel_y = 4 - }, -/obj/structure/machinery/door_control/cl/office/door{ - pixel_x = 6; - pixel_y = -3 - }, /obj/item/spacecash/c500{ pixel_x = -10; pixel_y = 8 @@ -22406,28 +22402,15 @@ /area/almayer/maint/hull/upper/u_f_s) "fiE" = ( /obj/structure/surface/table/almayer, -/obj/structure/machinery/door_display/research_cell{ - dir = 4; - id = "Containment Cell 4"; - name = "Control Panel"; - pixel_x = -17; - req_access_txt = "200"; - pixel_y = 9 - }, /obj/item/storage/photo_album, /obj/structure/machinery/computer/cameras/containment/hidden{ dir = 4; pixel_x = -17; - pixel_y = -5; plane = -5 }, /obj/item/device/camera_film{ pixel_x = -3 }, -/obj/structure/machinery/door_control/cl/office/divider{ - pixel_x = 7; - pixel_y = -7 - }, /turf/open/floor/almayer, /area/almayer/command/corporateliaison) "fiQ" = ( @@ -22472,7 +22455,7 @@ }, /area/almayer/medical/containment/cell/cl) "flf" = ( -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ dir = 1; vent_tag = "Records" }, @@ -22590,8 +22573,10 @@ /turf/open/floor/almayer/test_floor4, /area/almayer/medical/upper_medical) "fnH" = ( -/obj/structure/pipes/vents/pump{ - dir = 1 +/obj/structure/pipes/vents/pump/no_boom/gas{ + dir = 1; + vent_tag = "Main Office"; + network_id = "CL_Security" }, /turf/open/floor/wood/ship, /area/almayer/command/corporateliaison) @@ -23860,6 +23845,15 @@ /obj/structure/disposalpipe/segment{ dir = 4 }, +/obj/structure/machinery/flasher{ + alpha = 1; + name = "Ceiling Flashbulb"; + range = 3; + layer = 2.1; + mouse_opacity = 0; + pixel_x = -14; + id = "CL_Security" + }, /turf/open/floor/carpet, /area/almayer/command/corporateliaison) "fRg" = ( @@ -40465,9 +40459,6 @@ /turf/open/floor/plating/plating_catwalk, /area/almayer/living/pilotbunks) "mLe" = ( -/obj/structure/pipes/vents/pump{ - dir = 8 - }, /obj/structure/sign/safety/bathunisex{ pixel_x = 8; pixel_y = -32 @@ -40475,6 +40466,11 @@ /obj/structure/machinery/door_control/cl/quarter/backdoor{ pixel_x = 25 }, +/obj/structure/pipes/vents/pump/no_boom/gas{ + dir = 8; + vent_tag = "Private Quarters"; + network_id = "CL_Security" + }, /turf/open/floor/wood/ship, /area/almayer/command/corporateliaison) "mLg" = ( @@ -42664,7 +42660,7 @@ /obj/structure/bed/chair/comfy/ares{ dir = 1 }, -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ vent_tag = "Core Chamber" }, /turf/open/floor/almayer/no_build/plating, @@ -45079,7 +45075,7 @@ /turf/open/floor/almayer/silver/west, /area/almayer/command/cichallway) "oBD" = ( -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ dir = 8; vent_tag = "Access Hall" }, @@ -45428,11 +45424,11 @@ pixel_y = 3 }, /obj/structure/surface/table/woodentable/fancy, -/obj/structure/machinery/door_control/cl/office/evac{ +/obj/structure/machinery/door_control/cl/office/window{ pixel_x = -5; pixel_y = 4 }, -/obj/structure/machinery/door_control/cl/quarter/windows{ +/obj/structure/machinery/door_control/cl/office/door{ pixel_x = -5; pixel_y = -3 }, @@ -46419,7 +46415,7 @@ /area/almayer/shipboard/brig/cryo) "pax" = ( /obj/effect/step_trigger/clone_cleaner, -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ dir = 8; vent_tag = "Reception" }, @@ -52828,9 +52824,6 @@ /turf/open/floor/almayer/orange/east, /area/almayer/maint/upper/mess) "rGU" = ( -/obj/structure/machinery/computer/skills{ - req_one_access_txt = "200" - }, /obj/structure/surface/table/woodentable/fancy, /obj/item/tool/pen/clicky{ pixel_x = 14; @@ -52841,6 +52834,7 @@ pixel_x = 14; pixel_y = 6 }, +/obj/structure/machinery/computer/wy_intranet/liaison, /turf/open/floor/carpet, /area/almayer/command/corporateliaison) "rHc" = ( @@ -67531,7 +67525,7 @@ /turf/open/floor/almayer/plate, /area/almayer/living/briefing) "xwU" = ( -/obj/structure/pipes/vents/pump/no_boom/gas{ +/obj/structure/pipes/vents/pump/no_boom/gas/ares{ dir = 1; vent_tag = "Comms" }, diff --git a/tgui/packages/tgui/interfaces/WYComputer.jsx b/tgui/packages/tgui/interfaces/WYComputer.jsx index 4df248eeaa94..90e98a6b2755 100644 --- a/tgui/packages/tgui/interfaces/WYComputer.jsx +++ b/tgui/packages/tgui/interfaces/WYComputer.jsx @@ -9,6 +9,7 @@ import { Window } from '../layouts'; const PAGES = { login: () => Login, main: () => MainMenu, + vents: () => SecVents, }; export const WYComputer = (props) => { @@ -106,8 +107,20 @@ const Login = (props) => { const MainMenu = (props) => { const { data, act } = useBackend(); - const { logged_in, access_text, last_page, current_menu, access_level } = - data; + const { + logged_in, + access_text, + last_page, + current_menu, + access_level, + has_hidden_cell, + has_room_divider, + open_divider, + open_cell_door, + open_cell_shutters, + cell_flash_cooldown, + sec_flash_cooldown, + } = data; return ( <> @@ -172,44 +185,195 @@ const MainMenu = (props) => { )} - {access_level >= 3 && ( + {(access_level === 3 || access_level >= 5) && (

Security Protocols

- - - act('unlock_divider')} - > - Room Divider - - - - - - + {!!has_room_divider && !has_hidden_cell && ( + act('unlock_divider')} + disabled={!has_room_divider} + > + Room Divider + + )} + act('security_flash')} + disabled={sec_flash_cooldown} + > + Security Flash + + {(access_level === 3 || access_level >= 6) && ( + + )} +
+ )} + {(access_level === 3 || access_level >= 6) && !!has_hidden_cell && ( +
+

Hidden Cell Controls

+ {!!has_room_divider && ( + act('unlock_divider')} + disabled={!has_room_divider} + > + Room Divider + + )} + + + act('cell_flash')} + disabled={cell_flash_cooldown} + > + Cell Flash +
)} ); }; + +const SecVents = (props) => { + const { data, act } = useBackend(); + const { + logged_in, + access_text, + access_level, + last_page, + current_menu, + security_vents, + } = data; + + return ( + <> +
+ + +
+ +
+

Security Vent Controls

+
+
+ {security_vents.map((vent, i) => { + return ( + act('trigger_vent', { vent: vent.ref })} + > + {vent.vent_tag} + + ); + })} +
+ + ); +};