Skip to content

Commit

Permalink
Merge branch 'project/ares/holderperk' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed May 22, 2024
2 parents d9f734a + 0e7b32a commit 953cf47
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 33 deletions.
7 changes: 7 additions & 0 deletions code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,10 @@
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("security_lockdown")
if(!COOLDOWN_FINISHED(datacore, aicore_lockdown))
to_chat(user, SPAN_BOLDWARNING("AI Core Lockdown procedures are on cooldown! They will be ready in [COOLDOWN_SECONDSLEFT(datacore, aicore_lockdown)] seconds!"))
return FALSE
aicore_lockdown(user)
return TRUE
101 changes: 68 additions & 33 deletions tgui/packages/tgui/interfaces/AresAdmin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ export const AresAdmin = (props) => {
);
};

const { data } = useBackend();
const { is_pda } = data;
let remotelock = !is_pda;
let remotetip = 'You cannot do this via remote console.';
if (!remotelock) {
remotetip = '';
}

const Login = (props) => {
const { act } = useBackend();

Expand Down Expand Up @@ -375,25 +383,36 @@ const MainMenu = (props) => {
)}
</Stack>
</Section>
<Section>
<Section align="center">
<h1 align="center">Core Security Protocols</h1>
<Stack>
<Stack.Item grow>
<Button
align="center"
tooltip="Release stored CN20-X nerve gas from security vents."
icon="wind"
color="red"
ml="auto"
px="2rem"
width="100%"
bold
onClick={() => act('page_core_sec')}
>
Nerve Gas Control
</Button>
</Stack.Item>
</Stack>
<Button
align="center"
tooltip="Release stored CN20-X nerve gas from security vents."
icon="wind"
color="red"
ml="auto"
px="2rem"
width="50%"
bold
onClick={() => act('page_core_sec')}
>
Nerve Gas Control
</Button>

<Button.Confirm
align="center"
tooltip="Activate/Deactivate the AI Core Lockdown."
icon="lock"
color="red"
ml="auto"
px="2rem"
width="50%"
bold
onClick={() => act('security_lockdown')}
disabled={remotelock}
>
AI Core Lockdown
</Button.Confirm>
</Section>
<Section>
<Stack>
Expand Down Expand Up @@ -1587,8 +1606,22 @@ const Security = (props) => {

const Emergency = (props) => {
const { data, act } = useBackend();
const { logged_in, access_text, last_page, current_menu, admin_login } = data;

const {
logged_in,
access_text,
last_page,
current_menu,
admin_login,
worldtime,
alert_level,
distresstimelock,
distresstime,
quarterstime,
evac_status,
mission_failed,
nuketimelock,
nuke_available,
} = data;
const minimumEvacTime = worldtime > distresstimelock;
const distressCooldown = worldtime < distresstime;
const quartersCooldown = worldtime < quarterstime;
Expand All @@ -1598,8 +1631,7 @@ const Emergency = (props) => {
quarters_reason =
'It has not been long enough since the last General Quarters call.';
}
const canDistress =
alert_level === 2 && !distressCooldown && minimumEvacTime && !remotelock;
const canDistress = alert_level === 2 && !distressCooldown && minimumEvacTime;
let distress_reason = 'Launch a Distress Beacon.';
if (remotelock) {
distress_reason = remotetip;
Expand All @@ -1613,7 +1645,7 @@ const Emergency = (props) => {
distress_reason = "It's too early to launch a distress beacon.";
}

const canEvac = (evac_status === 0, alert_level >= 2) && !remotelock;
const canEvac = (evac_status === 0, alert_level >= 2);
let evac_reason = 'Begin evacuation procedures. Authorise Lifeboats.';
if (remotelock) {
evac_reason = remotetip;
Expand All @@ -1629,8 +1661,7 @@ const Emergency = (props) => {

const minimumNukeTime = worldtime > nuketimelock;
const canNuke =
(nuke_available, !mission_failed, evac_reason === 0, minimumNukeTime) &&
!remotelock;
(nuke_available, !mission_failed, evac_reason === 0, minimumNukeTime);
let nuke_reason =
'Request a nuclear device to be authorized by USCM High Command.';
if (remotelock) {
Expand Down Expand Up @@ -1689,7 +1720,7 @@ const Emergency = (props) => {
<h1 align="center">Emergency Protocols</h1>
<Flex align="center" justify="center" height="50%" direction="column">
<Button.Confirm
tooltip="You cannot do this via remote console."
tooltip={quarters_reason}
icon="triangle-exclamation"
color="red"
width="40vw"
Expand All @@ -1698,12 +1729,13 @@ const Emergency = (props) => {
p="1rem"
mt="5rem"
bold
disabled={access_text}
onClick={() => act('general_quarters')}
disabled={!canQuarters}
>
Call General Quarters
</Button.Confirm>
<Button.Confirm
tooltip="You cannot do this via remote console."
tooltip={evac_reason}
icon="shuttle-space"
color="red"
width="40vw"
Expand All @@ -1712,12 +1744,13 @@ const Emergency = (props) => {
p="1rem"
mt="5rem"
bold
disabled={access_text}
onClick={() => act('evacuation_start')}
disabled={remotelock || !canEvac}
>
Initiate Evacuation
</Button.Confirm>
<Button.Confirm
tooltip="You cannot do this via remote console."
tooltip={distress_reason}
icon="circle-exclamation"
color="red"
width="40vw"
Expand All @@ -1726,12 +1759,13 @@ const Emergency = (props) => {
p="1rem"
mt="5rem"
bold
disabled={access_text}
onClick={() => act('distress')}
disabled={remotelock || !canDistress}
>
Launch Distress Beacon
</Button.Confirm>
<Button.Confirm
tooltip="You cannot do this via remote console."
tooltip={nuke_reason}
icon="circle-radiation"
color="red"
width="40vw"
Expand All @@ -1740,7 +1774,8 @@ const Emergency = (props) => {
p="1rem"
mt="5rem"
bold
disabled={access_text}
onClick={() => act('nuclearbomb')}
disabled={remotelock || !canNuke}
>
Request Nuclear Device
</Button.Confirm>
Expand Down

0 comments on commit 953cf47

Please sign in to comment.