Skip to content

Commit

Permalink
General Quarters via ARES no longer cares if Red alert or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 committed Aug 22, 2023
1 parent 25f082e commit c0c7b15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions code/game/machinery/ARES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@

COOLDOWN_DECLARE(ares_distress_cooldown)
COOLDOWN_DECLARE(ares_nuclear_cooldown)
COOLDOWN_DECLARE(ares_quarters_cooldown)

/obj/structure/machinery/computer/ares_console/proc/link_systems(datum/ares_link/new_link = GLOB.ares_link, override)
if(link && !override)
Expand Down
9 changes: 6 additions & 3 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

data["distresstime"] = ares_distress_cooldown
data["distresstimelock"] = DISTRESS_TIME_LOCK
data["quarterstime"] = ares_quarters_cooldown
data["mission_failed"] = SSticker.mode.is_in_endgame
data["nuketimelock"] = NUCLEAR_TIME_LOCK
data["nuke_available"] = nuke_available
Expand Down Expand Up @@ -506,16 +507,18 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

// -- 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."))
if(!COOLDOWN_FINISHED(src, ares_quarters_cooldown))
to_chat(usr, SPAN_WARNING("It has not been long enough since last General Quarters call!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
set_security_level(2, no_sound = TRUE, announce = FALSE)
if(security_level != SEC_LEVEL_RED && security_level != SEC_LEVEL_DELTA)
set_security_level(2, no_sound = TRUE, announce = FALSE)
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.")
COOLDOWN_START(src, ares_quarters_cooldown, 10 MINUTES)
. = TRUE

if("evacuation_start")
Expand Down
9 changes: 7 additions & 2 deletions tgui/packages/tgui/interfaces/AresInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1372,15 +1372,20 @@ const Emergency = (props, context) => {
worldtime,
distresstimelock,
distresstime,
quarterstime,
evac_status,
mission_failed,
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 quartersCooldown = worldtime < quarterstime;
const canQuarters = !quartersCooldown;
let quarters_reason = 'Call for General Quarters.';
if(quartersCooldown) {
quarters_reason = 'It has not been long enough since last General Quarters call.';
}
const canDistress = alert_level === 2 && !distressCooldown && minimumEvacTime;
let distress_reason = 'Launch a Distress Beacon.';
if (alert_level === 3) {
Expand Down

0 comments on commit c0c7b15

Please sign in to comment.