Skip to content

Commit

Permalink
Merge pull request #9 from Ben10083/project/apollo_controller
Browse files Browse the repository at this point in the history
Adds General Quarters
  • Loading branch information
realforest2001 authored Jul 20, 2023
2 parents a93ea71 + 64c2cd6 commit 7af6ca7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,19 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
current_menu = "read_deleted"

// -- Emergency Buttons -- //
if("general_quarters")
if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA)
to_chat(usr, SPAN_WARNING("Alert level is already red or above, General Quarters cannot be called."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
set_security_level(2, no_sound=1, announce=0)
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.")
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_security("General Quarters", "[last_login] has called for general quarters via ARES.")
. = TRUE

if("evacuation_start")
if(security_level < SEC_LEVEL_RED)
to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
Expand Down
16 changes: 16 additions & 0 deletions tgui/packages/tgui/interfaces/AresInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,8 @@ const Emergency = (props, context) => {
nuketimelock,
nuke_available,
} = data;
const canQuarters = alert_level < 2;
let quarters_reason = 'Call for General Quarters.';
const minimumEvacTime = worldtime > distresstimelock;
const distressCooldown = worldtime < distresstime;
const canDistress = alert_level === 2 && !distressCooldown && minimumEvacTime;
Expand Down Expand Up @@ -1452,6 +1454,20 @@ const Emergency = (props, context) => {

<h1 align="center">Emergency Protocols</h1>
<Flex align="center" justify="center" height="50%" direction="column">
<Button.Confirm
content="Call General Quarters"
tooltip={quarters_reason}
icon="triangle-exclamation"
color="red"
width="40vw"
textAlign="center"
fontSize="1.5rem"
p="1rem"
mt="5rem"
bold
onClick={() => act('general_quarters')}
disabled={!canQuarters}
/>
<Button.Confirm
content="Initiate Evacuation"
tooltip={evac_reason}
Expand Down

0 comments on commit 7af6ca7

Please sign in to comment.