Skip to content

Commit

Permalink
TGS Test Merge (#8226)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Jan 25, 2025
2 parents 3ec5ff4 + 041e584 commit a010d97
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 3 deletions.
6 changes: 6 additions & 0 deletions code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
31 changes: 31 additions & 0 deletions code/game/machinery/ARES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/ARES/ARES_interface_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
28 changes: 28 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/sentry_holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
. = ..()
Expand Down
14 changes: 13 additions & 1 deletion tgui/packages/tgui/interfaces/AresAdmin.jsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -398,6 +398,18 @@ const MainMenu = (props) => {
Nerve Gas Control
</Button>
</Stack.Item>
<Stack.Item ml="0" mr="0">
<Dropdown
options={faction_options}
selected={sentry_setting}
color="red"
onSelected={(value) =>
act('update_sentries', { chosen_iff: value })
}
width="90px"
tooltip="Change core sentries IFF settings."
/>
</Stack.Item>
</Stack>
</Section>
<Section>
Expand Down
15 changes: 14 additions & 1 deletion tgui/packages/tgui/interfaces/AresInterface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -434,6 +434,19 @@ const MainMenu = (props) => {
AI Core Lockdown
</Button.Confirm>
</Stack.Item>
<Stack.Item ml="0" mr="0">
<Dropdown
options={faction_options}
selected={sentry_setting}
color="red"
onSelected={(value) =>
act('update_sentries', { chosen_iff: value })
}
width="90px"
disabled={local_access_level < 9}
tooltip="Change core sentries IFF settings."
/>
</Stack.Item>
</Stack>
</Section>
)}
Expand Down
15 changes: 14 additions & 1 deletion tgui/packages/tgui/interfaces/WorkingJoe.jsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -285,6 +285,19 @@ const MainMenu = (props) => {
AI Core Lockdown
</Button.Confirm>
</Stack.Item>
<Stack.Item ml="0" mr="0">
<Dropdown
options={faction_options}
selected={sentry_setting}
color="red"
onSelected={(value) =>
act('update_sentries', { chosen_iff: value })
}
width="90px"
disabled={local_access_level < 6}
tooltip="Change core sentries IFF settings."
/>
</Stack.Item>
</Stack>
</Section>
)}
Expand Down

0 comments on commit a010d97

Please sign in to comment.