Skip to content

Commit

Permalink
Merge branch 'project/ares/gascontrol' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Feb 26, 2024
2 parents e2964f1 + ed606b3 commit 2d87496
Show file tree
Hide file tree
Showing 9 changed files with 367 additions and 36 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@
/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
#define COOLDOWN_ARES_VENT 60 SECONDS
102 changes: 73 additions & 29 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,25 @@
data["active_ref"] = active_ref
data["conversations"] = logged_convos

var/list/security_vents = list()
for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents)
if(!istype(vent))
continue
if(!vent.vent_tag)
vent.vent_tag = "Security Vent #[link.tag_num]"
link.tag_num++

var/list/current_vent = list()
var/is_available = TRUE
if(!COOLDOWN_FINISHED(vent, vent_trigger_cooldown))
is_available = FALSE
current_vent["vent_tag"] = vent.vent_tag
current_vent["ref"] = "\ref[vent]"
current_vent["available"] = is_available
security_vents += list(current_vent)

data["security_vents"] = security_vents

return data

/obj/structure/machinery/computer/ares_console/ui_status(mob/user, datum/ui_state/state)
Expand All @@ -227,19 +246,19 @@
. = ..()
if(.)
return

playsound(src, "keyboard_alt", 15, 1)
var/mob/user = usr
var/playsound = TRUE

switch (action)
if("go_back")
if(!last_menu)
return to_chat(usr, SPAN_WARNING("Error, no previous page detected."))
return to_chat(user, SPAN_WARNING("Error, no previous page detected."))
var/temp_holder = current_menu
current_menu = last_menu
last_menu = temp_holder

if("login")
var/mob/living/carbon/human/operator = usr
var/mob/living/carbon/human/operator = user
var/obj/item/card/id/idcard = operator.get_active_hand()
if(istype(idcard))
authentication = get_ares_access(idcard)
Expand All @@ -250,22 +269,22 @@
authentication = get_ares_access(idcard)
last_login = idcard.registered_name
else
to_chat(usr, SPAN_WARNING("You require an ID card to access this terminal!"))
to_chat(user, SPAN_WARNING("You require an ID card to access this terminal!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(authentication)
datacore.interface_access_list += "[last_login] at [worldtime2text()], Access Level [authentication] - [ares_auth_to_text(authentication)]."
current_menu = "main"

if("sudo")
var/new_user = tgui_input_text(usr, "Enter Sudo Username", "Sudo User", encode = FALSE)
var/new_user = tgui_input_text(user, "Enter Sudo Username", "Sudo User", encode = FALSE)
if(new_user)
if(new_user == sudo_holder)
last_login = sudo_holder
sudo_holder = null
return FALSE
if(new_user == last_login)
to_chat(usr, SPAN_WARNING("Already remote logged in as this user."))
to_chat(user, SPAN_WARNING("Already remote logged in as this user."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
sudo_holder = last_login
Expand Down Expand Up @@ -331,6 +350,9 @@
if("page_tech")
last_menu = current_menu
current_menu = "tech_log"
if("page_core_sec")
last_menu = current_menu
current_menu = "core_security"

// -- Delete Button -- //
if("delete_record")
Expand Down Expand Up @@ -382,9 +404,9 @@
datacore.records_talking -= conversation

if("message_ares")
var/message = tgui_input_text(usr, "What do you wish to say to ARES?", "ARES Message", encode = FALSE)
var/message = tgui_input_text(user, "What do you wish to say to ARES?", "ARES Message", encode = FALSE)
if(message)
message_ares(message, usr, params["active_convo"])
message_ares(message, user, params["active_convo"])

if("read_record")
var/datum/ares_record/deleted_talk/conversation = locate(params["record"])
Expand All @@ -397,93 +419,115 @@
// -- Emergency Buttons -- //
if("general_quarters")
if(!COOLDOWN_FINISHED(datacore, ares_quarters_cooldown))
to_chat(usr, SPAN_WARNING("It has not been long enough since the last General Quarters call!"))
to_chat(user, SPAN_WARNING("It has not been long enough since the last General Quarters call!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level < SEC_LEVEL_RED)
set_security_level(SEC_LEVEL_RED, 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.")
log_game("[key_name(user)] has called for general quarters via ARES.")
message_admins("[key_name_admin(user)] has called for general quarters via ARES.")
log_ares_security("General Quarters", "[last_login] has called for general quarters via ARES.")
COOLDOWN_START(datacore, ares_quarters_cooldown, 10 MINUTES)
. = TRUE

if("evacuation_start")
if(GLOB.security_level < SEC_LEVEL_RED)
to_chat(usr, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
to_chat(user, SPAN_WARNING("The ship must be under red alert in order to enact evacuation procedures."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

if(SShijack.evac_admin_denied)
to_chat(usr, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
to_chat(user, SPAN_WARNING("The USCM has placed a lock on deploying the evacuation pods."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

if(!SShijack.initiate_evacuation())
to_chat(usr, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
to_chat(user, SPAN_WARNING("You are unable to initiate an evacuation procedure right now!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

log_game("[key_name(usr)] has called for an emergency evacuation via ARES.")
message_admins("[key_name_admin(usr)] has called for an emergency evacuation via ARES.")
log_game("[key_name(user)] has called for an emergency evacuation via ARES.")
message_admins("[key_name_admin(user)] has called for an emergency evacuation via ARES.")
log_ares_security("Initiate Evacuation", "[last_login] has called for an emergency evacuation via ARES.")
. = TRUE

if("distress")
if(!SSticker.mode)
return FALSE //Not a game mode?
if(world.time < DISTRESS_TIME_LOCK)
to_chat(usr, SPAN_WARNING("You have been here for less than six minutes... what could you possibly have done!"))
to_chat(user, SPAN_WARNING("You have been here for less than six minutes... what could you possibly have done!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(datacore, ares_distress_cooldown))
to_chat(usr, SPAN_WARNING("The distress launcher is cooling down!"))
to_chat(user, SPAN_WARNING("The distress launcher is cooling down!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level == SEC_LEVEL_DELTA)
to_chat(usr, SPAN_WARNING("The ship is already undergoing self destruct procedures!"))
to_chat(user, SPAN_WARNING("The ship is already undergoing self destruct procedures!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level < SEC_LEVEL_RED)
to_chat(usr, SPAN_WARNING("The ship must be under red alert to launch a distress beacon!"))
to_chat(user, SPAN_WARNING("The ship must be under red alert to launch a distress beacon!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE

for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
SSticker.mode.request_ert(usr, TRUE)
to_chat(usr, SPAN_NOTICE("A distress beacon request has been sent to USCM High Command."))
SSticker.mode.request_ert(user, TRUE)
to_chat(user, SPAN_NOTICE("A distress beacon request has been sent to USCM High Command."))
COOLDOWN_START(datacore, ares_distress_cooldown, COOLDOWN_COMM_REQUEST)
return TRUE

if("nuclearbomb")
if(!SSticker.mode)
return FALSE //Not a game mode?
if(world.time < NUCLEAR_TIME_LOCK)
to_chat(usr, SPAN_WARNING("It is too soon to request Nuclear Ordnance!"))
to_chat(user, SPAN_WARNING("It is too soon to request Nuclear Ordnance!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(datacore, ares_nuclear_cooldown))
to_chat(usr, SPAN_WARNING("The ordnance request frequency is garbled, wait for reset!"))
to_chat(user, SPAN_WARNING("The ordnance request frequency is garbled, wait for reset!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(GLOB.security_level == SEC_LEVEL_DELTA || SSticker.mode.is_in_endgame)
to_chat(usr, SPAN_WARNING("The mission has failed catastrophically, what do you want a nuke for?!"))
to_chat(user, SPAN_WARNING("The mission has failed catastrophically, what do you want a nuke for?!"))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
var/reason = tgui_input_text(usr, "Please enter reason nuclear ordnance is required.", "Reason for Nuclear Ordnance")
var/reason = tgui_input_text(user, "Please enter reason nuclear ordnance is required.", "Reason for Nuclear Ordnance")
if(!reason)
return FALSE
for(var/client/admin in GLOB.admins)
if((R_ADMIN|R_MOD) & admin.admin_holder.rights)
playsound_client(admin,'sound/effects/sos-morse-code.ogg',10)
message_admins("[key_name(usr)] has requested use of Nuclear Ordnance (via ARES)! Reason: <b>[reason]</b> [CC_MARK(usr)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukeapprove=\ref[usr]'>APPROVE</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukedeny=\ref[usr]'>DENY</A>) [ADMIN_JMP_USER(usr)] [CC_REPLY(usr)]")
to_chat(usr, SPAN_NOTICE("A nuclear ordnance request has been sent to USCM High Command for the following reason: [reason]"))
message_admins("[key_name(user)] has requested use of Nuclear Ordnance (via ARES)! Reason: <b>[reason]</b> [CC_MARK(user)] (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukeapprove=\ref[user]'>APPROVE</A>) (<A HREF='?_src_=admin_holder;[HrefToken(forceGlobal = TRUE)];nukedeny=\ref[user]'>DENY</A>) [ADMIN_JMP_USER(user)] [CC_REPLY(user)]")
to_chat(user, SPAN_NOTICE("A nuclear ordnance request has been sent to USCM High Command for the following reason: [reason]"))
log_ares_security("Nuclear Ordnance Request", "[last_login] has sent a request for nuclear ordnance for the following reason: [reason]")
if(ares_can_interface())
ai_silent_announcement("[last_login] has sent a request for nuclear ordnance to USCM High Command.", ".V")
ai_silent_announcement("Reason given: [reason].", ".V")
COOLDOWN_START(datacore, ares_nuclear_cooldown, COOLDOWN_COMM_DESTRUCT)
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(user, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(user, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(user, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
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(playsound)
playsound(src, "keyboard_alt", 15, 1)
45 changes: 43 additions & 2 deletions code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,25 @@
requesting_access += access_ticket.ticket_name
data["access_tickets"] = logged_access

var/list/security_vents = list()
for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents)
if(!istype(vent))
continue
if(!vent.vent_tag)
vent.vent_tag = "Security Vent #[link.tag_num]"
link.tag_num++

var/list/current_vent = list()
var/is_available = TRUE
if(!COOLDOWN_FINISHED(vent, vent_trigger_cooldown))
is_available = FALSE
current_vent["vent_tag"] = vent.vent_tag
current_vent["ref"] = "\ref[vent]"
current_vent["available"] = is_available
security_vents += list(current_vent)

data["security_vents"] = security_vents

return data

/obj/structure/machinery/computer/working_joe/ui_status(mob/user, datum/ui_state/state)
Expand Down Expand Up @@ -197,6 +216,9 @@
if("page_maintenance")
last_menu = current_menu
current_menu = "maint_claim"
if("page_core_gas")
last_menu = current_menu
current_menu = "core_security_gas"

if("new_report")
var/priority_report = FALSE
Expand Down Expand Up @@ -382,13 +404,32 @@
if(!istype(access_ticket))
return FALSE
if(access_ticket.ticket_assignee != last_login && access_ticket.ticket_assignee) //must be claimed by you or unclaimed.)
to_chat(usr, SPAN_WARNING("You cannot update a ticket that is not assigned to you!"))
to_chat(operator, SPAN_WARNING("You cannot update a ticket that is not assigned to you!"))
return FALSE
access_ticket.ticket_status = TICKET_REJECTED
to_chat(usr, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected."))
to_chat(operator, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected."))
ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].")
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(operator, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(operator, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(operator, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if(playsound)
playsound(src, "keyboard_alt", 15, 1)

Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/datum/ares_datacore/datacore

var/list/obj/structure/machinery/computer/working_joe/ticket_computers = list()
/// Linked security gas vents.
var/list/linked_vents = list()
/// The tag number for generated vent labels, if none is manually set.
var/tag_num = 1

/// Working Joe stuff
var/list/tickets_maintenance = list()
Expand Down
45 changes: 43 additions & 2 deletions code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,25 @@
requesting_access += access_ticket.ticket_name
data["access_tickets"] = logged_access

var/list/security_vents = list()
for(var/obj/structure/pipes/vents/pump/no_boom/gas/vent in link.linked_vents)
if(!istype(vent))
continue
if(!vent.vent_tag)
vent.vent_tag = "Security Vent #[link.tag_num]"
link.tag_num++

var/list/current_vent = list()
var/is_available = TRUE
if(!COOLDOWN_FINISHED(vent, vent_trigger_cooldown))
is_available = FALSE
current_vent["vent_tag"] = vent.vent_tag
current_vent["ref"] = "\ref[vent]"
current_vent["available"] = is_available
security_vents += list(current_vent)

data["security_vents"] = security_vents

return data

/obj/item/device/working_joe_pda/ui_status(mob/user, datum/ui_state/state)
Expand Down Expand Up @@ -222,6 +241,9 @@
if("page_maintenance")
last_menu = current_menu
current_menu = "maint_claim"
if("page_core_gas")
last_menu = current_menu
current_menu = "core_security_gas"

if("new_report")
var/priority_report = FALSE
Expand Down Expand Up @@ -407,13 +429,32 @@
if(!istype(access_ticket))
return FALSE
if(access_ticket.ticket_assignee != last_login && access_ticket.ticket_assignee) //must be claimed by you or unclaimed.)
to_chat(usr, SPAN_WARNING("You cannot update a ticket that is not assigned to you!"))
to_chat(operator, SPAN_WARNING("You cannot update a ticket that is not assigned to you!"))
return FALSE
access_ticket.ticket_status = TICKET_REJECTED
to_chat(usr, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected."))
to_chat(operator, SPAN_NOTICE("[access_ticket.ticket_type] [access_ticket.ticket_id] marked as rejected."))
ares_apollo_talk("Access Ticket [access_ticket.ticket_id]: [access_ticket.ticket_submitter] was rejected access by [last_login].")
return TRUE

if("trigger_vent")
playsound = FALSE
var/obj/structure/pipes/vents/pump/no_boom/gas/sec_vent = locate(params["vent"])
if(!istype(sec_vent) || sec_vent.welded)
to_chat(operator, SPAN_WARNING("ERROR: Gas release failure."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(!COOLDOWN_FINISHED(sec_vent, vent_trigger_cooldown))
to_chat(operator, SPAN_WARNING("ERROR: Insufficient gas reserve for this vent."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
to_chat(operator, SPAN_WARNING("Initiating gas release from [sec_vent.vent_tag]."))
playsound(src, 'sound/machines/chime.ogg', 15, 1)
COOLDOWN_START(sec_vent, vent_trigger_cooldown, COOLDOWN_ARES_VENT)
ares_apollo_talk("Nerve Gas release imminent from [sec_vent.vent_tag].")
log_ares_security("Nerve Gas Release", "[last_login] released Nerve Gas from Vent '[sec_vent.vent_tag]'.")
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(operator)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if(playsound)
var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg')
playsound(src, sound, 15, TRUE)
Loading

0 comments on commit 2d87496

Please sign in to comment.