From 041e5843de24e736347110fe1d88ec932a8e94dd Mon Sep 17 00:00:00 2001 From: forest2001 Date: Fri, 24 Jan 2025 15:47:01 +0000 Subject: [PATCH] IFF Config Button C Proc act UI Button F pathing defines --- code/__DEFINES/ARES.dm | 6 ++++ code/game/machinery/ARES/ARES.dm | 31 +++++++++++++++++++ code/game/machinery/ARES/ARES_interface.dm | 12 +++++++ .../machinery/ARES/ARES_interface_admin.dm | 12 +++++++ .../machinery/ARES/ARES_interface_apollo.dm | 12 +++++++ .../machinery/ARES/ARES_interface_data.dm | 3 ++ code/game/machinery/ARES/ARES_procs.dm | 28 +++++++++++++++++ code/game/machinery/ARES/apollo_pda.dm | 12 +++++++ code/game/machinery/sentry_holder.dm | 1 + tgui/packages/tgui/interfaces/AresAdmin.jsx | 14 ++++++++- .../tgui/interfaces/AresInterface.jsx | 15 ++++++++- tgui/packages/tgui/interfaces/WorkingJoe.jsx | 15 ++++++++- 12 files changed, 158 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index 55aa68f97309..e53d68627aa5 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -82,3 +82,9 @@ /// Time until someone can respawn as Working Joe #define JOE_JOIN_DEAD_TIME (15 MINUTES) + +#define FACTION_ARES "Ares" +#define FACTION_LIST_ARES_MARINE list(FACTION_MARINE, FACTION_ARES) +#define FACTION_LIST_ARES_ALL list(FACTION_ARES, FACTION_MARINE, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) +#define FACTION_LIST_ARES_WY list(FACTION_ARES, FACTION_PMC, FACTION_WY_DEATHSQUAD, FACTION_WY) +#define FACTION_LIST_ARES_ALONE list(FACTION_ARES) diff --git a/code/game/machinery/ARES/ARES.dm b/code/game/machinery/ARES/ARES.dm index 1ecbb4a5d7d6..952f02c8f48d 100644 --- a/code/game/machinery/ARES/ARES.dm +++ b/code/game/machinery/ARES/ARES.dm @@ -115,3 +115,34 @@ name = "ARES Substrate" desc = "The memory substrate of ARES, containing complex protocols and information. Limited capabilities can operate on substrate alone, without the main ARES Unit operational." icon_state = "substrate" + +/// Sentry +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares + name = "UA X512-S mini sentry" + faction_group = FACTION_LIST_ARES_MARINE + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/Initialize() + link_sentry() + . = ..() + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/Destroy() + delink_sentry() + . = ..() + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/start_processing() + sync_iff() + ..() + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/proc/sync_iff() + var/datum/ares_link/ares_link = GLOB.ares_link + if(!ares_link || !ares_link.faction_group) + faction_group = FACTION_LIST_ARES_MARINE + faction_group = ares_link.faction_group + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/proc/link_sentry() + var/datum/ares_link/link = GLOB.ares_link + link.core_sentries += src + +/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/proc/delink_sentry() + var/datum/ares_link/link = GLOB.ares_link + link.core_sentries -= src diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 2bdd42088346..ef136adbfdf9 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -476,5 +476,17 @@ aicore_lockdown(user) return TRUE + if("update_sentries") + var/new_iff = params["chosen_iff"] + if(!new_iff) + to_chat(user, SPAN_WARNING("ERROR: Unknown setting.")) + return FALSE + if(new_iff == link.faction_label) + return FALSE + link.change_iff(new_iff) + message_admins("ARES: [key_name(user)] updated ARES Sentry IFF to [new_iff].") + to_chat(user, SPAN_WARNING("Sentry IFF settings updated!")) + return TRUE + if(playsound) playsound(src, "keyboard_alt", 15, 1) diff --git a/code/game/machinery/ARES/ARES_interface_admin.dm b/code/game/machinery/ARES/ARES_interface_admin.dm index 9dd631f37455..35540ef94073 100644 --- a/code/game/machinery/ARES/ARES_interface_admin.dm +++ b/code/game/machinery/ARES/ARES_interface_admin.dm @@ -358,3 +358,15 @@ log_ares_security("Nerve Gas Release", "Released Nerve Gas from Vent '[sec_vent.vent_tag]'.", MAIN_AI_SYSTEM) 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("update_sentries") + var/new_iff = params["chosen_iff"] + if(!new_iff) + to_chat(user, SPAN_WARNING("ERROR: Unknown setting.")) + return FALSE + if(new_iff == faction_label) + return FALSE + change_iff(new_iff) + message_admins("ARES: [key_name(user)] updated ARES Sentry IFF to [new_iff].") + to_chat(user, SPAN_WARNING("Sentry IFF settings updated!")) + return TRUE diff --git a/code/game/machinery/ARES/ARES_interface_apollo.dm b/code/game/machinery/ARES/ARES_interface_apollo.dm index b371ba885b06..d2d8718801c1 100644 --- a/code/game/machinery/ARES/ARES_interface_apollo.dm +++ b/code/game/machinery/ARES/ARES_interface_apollo.dm @@ -383,6 +383,18 @@ aicore_lockdown(user) return TRUE + if("update_sentries") + var/new_iff = params["chosen_iff"] + if(!new_iff) + to_chat(user, SPAN_WARNING("ERROR: Unknown setting.")) + return FALSE + if(new_iff == link.faction_label) + return FALSE + link.change_iff(new_iff) + message_admins("ARES: [key_name(user)] updated ARES Sentry IFF to [new_iff].") + to_chat(user, SPAN_WARNING("Sentry IFF settings updated!")) + return TRUE + if(playsound) playsound(src, "keyboard_alt", 15, 1) diff --git a/code/game/machinery/ARES/ARES_interface_data.dm b/code/game/machinery/ARES/ARES_interface_data.dm index ee6da6704f84..f609aff0ead6 100644 --- a/code/game/machinery/ARES/ARES_interface_data.dm +++ b/code/game/machinery/ARES/ARES_interface_data.dm @@ -18,6 +18,9 @@ data["nuketimelock"] = NUCLEAR_TIME_LOCK data["nuke_available"] = nuke_available + data["sentry_setting"] = link.faction_label + data["faction_options"] = link.faction_options + var/list/logged_announcements = list() for(var/datum/ares_record/announcement/broadcast as anything in records_announcement) diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 09a90f240aeb..3752b002794e 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -40,6 +40,12 @@ GLOBAL_LIST_INIT(maintenance_categories, list( var/list/waiting_ids = list() var/list/active_ids = list() + ///Sentry faction stuff + var/faction_label = FACTION_MARINE + var/list/faction_group = FACTION_LIST_ARES_MARINE + var/list/faction_options = list(FACTION_MARINE, FACTION_WY, "USCM-WY", FACTION_ARES) + var/list/core_sentries = list() + /datum/ares_link/New() admin_interface = new datacore = GLOB.ares_datacore @@ -54,6 +60,28 @@ GLOBAL_LIST_INIT(maintenance_categories, list( alert.delink() ..() +/datum/ares_link/proc/change_iff(selection) + faction_label = selection + var/list/new_iff = list() + var/setting + switch(selection) + if("USCM-WY") + setting = "all USCM and Corporate personnel!" + new_iff = FACTION_LIST_ARES_ALL + if(FACTION_WY) + setting = "Corporate personnel only!" + new_iff = FACTION_LIST_ARES_WY + if(FACTION_ARES) + setting = "authenticated Core Assets!" + new_iff = FACTION_LIST_ARES_ALONE + else + setting = "USCM personnel only!" + faction_label = FACTION_MARINE + new_iff = FACTION_LIST_ARES_MARINE + faction_group = new_iff + ares_apollo_talk("Security IFF systems updated to [setting]") + for(var/obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares/sentry in core_sentries) + sentry.sync_iff() /* BELOW ARE IN AdminAres.dm /datum/ares_link/tgui_interact(mob/user, datum/tgui/ui) diff --git a/code/game/machinery/ARES/apollo_pda.dm b/code/game/machinery/ARES/apollo_pda.dm index c81e879fdf69..cb51dffe2d40 100644 --- a/code/game/machinery/ARES/apollo_pda.dm +++ b/code/game/machinery/ARES/apollo_pda.dm @@ -414,6 +414,18 @@ aicore_lockdown(user) return TRUE + if("update_sentries") + var/new_iff = params["chosen_iff"] + if(!new_iff) + to_chat(user, SPAN_WARNING("ERROR: Unknown setting.")) + return FALSE + if(new_iff == link.faction_label) + return FALSE + link.change_iff(new_iff) + message_admins("ARES: [key_name(user)] updated ARES Sentry IFF to [new_iff].") + to_chat(user, SPAN_WARNING("Sentry IFF settings updated!")) + return TRUE + if(playsound) var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg') playsound(src, sound, 15, TRUE) diff --git a/code/game/machinery/sentry_holder.dm b/code/game/machinery/sentry_holder.dm index 7dfb71acc717..ae989bb61710 100644 --- a/code/game/machinery/sentry_holder.dm +++ b/code/game/machinery/sentry_holder.dm @@ -127,6 +127,7 @@ turret_path = /obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini /obj/structure/machinery/sentry_holder/almayer/mini/aicore + turret_path = /obj/structure/machinery/defenses/sentry/premade/deployable/almayer/mini/ares /obj/structure/machinery/sentry_holder/almayer/mini/aicore/Initialize() . = ..() diff --git a/tgui/packages/tgui/interfaces/AresAdmin.jsx b/tgui/packages/tgui/interfaces/AresAdmin.jsx index 476eac13953b..b8608836e509 100644 --- a/tgui/packages/tgui/interfaces/AresAdmin.jsx +++ b/tgui/packages/tgui/interfaces/AresAdmin.jsx @@ -1,5 +1,5 @@ import { useBackend } from '../backend'; -import { Box, Button, Flex, Section, Stack } from '../components'; +import { Box, Button, Dropdown, Flex, Section, Stack } from '../components'; import { Window } from '../layouts'; const PAGES = { @@ -398,6 +398,18 @@ const MainMenu = (props) => { Nerve Gas Control + + + act('update_sentries', { chosen_iff: value }) + } + width="90px" + tooltip="Change core sentries IFF settings." + /> +
diff --git a/tgui/packages/tgui/interfaces/AresInterface.jsx b/tgui/packages/tgui/interfaces/AresInterface.jsx index 1b696475949d..a3943a855ca9 100644 --- a/tgui/packages/tgui/interfaces/AresInterface.jsx +++ b/tgui/packages/tgui/interfaces/AresInterface.jsx @@ -3,7 +3,7 @@ // -------------------------------------------------------------------- // import { useBackend } from '../backend'; -import { Box, Button, Flex, Section, Stack } from '../components'; +import { Box, Button, Dropdown, Flex, Section, Stack } from '../components'; import { Window } from '../layouts'; const PAGES = { @@ -434,6 +434,19 @@ const MainMenu = (props) => { AI Core Lockdown + + + act('update_sentries', { chosen_iff: value }) + } + width="90px" + disabled={local_access_level < 9} + tooltip="Change core sentries IFF settings." + /> +
)} diff --git a/tgui/packages/tgui/interfaces/WorkingJoe.jsx b/tgui/packages/tgui/interfaces/WorkingJoe.jsx index b711378f7d16..8cf26f45d2b4 100644 --- a/tgui/packages/tgui/interfaces/WorkingJoe.jsx +++ b/tgui/packages/tgui/interfaces/WorkingJoe.jsx @@ -1,5 +1,5 @@ import { useBackend } from '../backend'; -import { Box, Button, Flex, Section, Stack } from '../components'; +import { Box, Button, Dropdown, Flex, Section, Stack } from '../components'; import { Window } from '../layouts'; const PAGES = { @@ -285,6 +285,19 @@ const MainMenu = (props) => { AI Core Lockdown + + + act('update_sentries', { chosen_iff: value }) + } + width="90px" + disabled={local_access_level < 6} + tooltip="Change core sentries IFF settings." + /> + )}