Skip to content

Commit

Permalink
TGS Test Merge (#5007)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Feb 11, 2024
2 parents 65aec78 + 6c41b6a commit 6f61f1f
Show file tree
Hide file tree
Showing 34 changed files with 4,396 additions and 163 deletions.
31 changes: 20 additions & 11 deletions code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#define ARES_ACCESS_LOGOUT 0
/// Generic access for 1:1 conversations with ARES and unrestricted commands.
#define ARES_ACCESS_BASIC 0
#define ARES_ACCESS_BASIC 1
/// Secure Access, can read ARES Announcements and Bioscans.
#define ARES_ACCESS_COMMAND 1
#define ARES_ACCESS_JOE 2
#define ARES_ACCESS_COMMAND 2
#define ARES_ACCESS_JOE 3
/// CL, can read Apollo Log and also Delete Announcements.
#define ARES_ACCESS_CORPORATE 3
#define ARES_ACCESS_CORPORATE 4
/// Senior Command, can Delete Bioscans.
#define ARES_ACCESS_SENIOR 4
#define ARES_ACCESS_SENIOR 5
/// Synth, CE & Commanding Officer, can read the access log.
#define ARES_ACCESS_CE 5
#define ARES_ACCESS_SYNTH 6
#define ARES_ACCESS_CO 7
#define ARES_ACCESS_CE 6
#define ARES_ACCESS_SYNTH 7
#define ARES_ACCESS_CO 8
/// High Command, can read the deletion log.
#define ARES_ACCESS_HIGH 8
#define ARES_ACCESS_WY_COMMAND 9
#define ARES_ACCESS_HIGH 9
#define ARES_ACCESS_WY_COMMAND 10
/// Debugging. Allows me to view everything without using a high command rank. Unlikely to stay in a full merge.
#define ARES_ACCESS_DEBUG 10
#define ARES_ACCESS_DEBUG 11

#define ARES_RECORD_ANNOUNCE "Announcement Record"
#define ARES_RECORD_ANTIAIR "AntiAir Control Log"
Expand All @@ -27,6 +28,7 @@
#define ARES_RECORD_MAINTENANCE "Maintenance Ticket"
#define ARES_RECORD_ACCESS "Access Ticket"
#define ARES_RECORD_FLIGHT "Flight Record"
#define ARES_RECORD_TECH "Tech Control Record"

/// Not by ARES logged through marine_announcement()
#define ARES_LOG_NONE 0
Expand Down Expand Up @@ -67,6 +69,13 @@
#define TICKET_OPEN "OPEN"
#define TICKET_CLOSED "CLOSED"

// Priority status changes.
/// Upgraded to Priority
#define TICKET_PRIORITY "priority"
/// Downgraded from Priority
#define TICKET_NON_PRIORITY "non-priority"

/// Cooldowns
#define COOLDOWN_ARES_SENSOR 60 SECONDS
#define COOLDOWN_ARES_ACCESS_CONTROL 20 SECONDS
#define COOLDOWN_ARES_VENT 60 SECONDS
1 change: 1 addition & 0 deletions code/__DEFINES/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ GLOBAL_LIST_INIT(job_command_roles, JOB_COMMAND_ROLES_LIST)
#define JOB_GENERAL "USCM General"
#define JOB_ACMC "Assistant Commandant of the Marine Corps"
#define JOB_CMC "Commandant of the Marine Corps"
#define JOB_AI_TECH "AI Service Technician"

// Used to add a timelock to a job. Will be passed onto derivatives
#define AddTimelock(Path, timelockList) \
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
#define ROLE_WHITELISTED 16
#define ROLE_NO_ACCOUNT 32
#define ROLE_CUSTOM_SPAWN 64
#define ROLE_HIDDEN 128
//=================================================

//Role defines, specifically lists of roles for job bans, crew manifests and the like.
Expand All @@ -117,7 +118,7 @@ GLOBAL_LIST_INIT(ROLES_CIC, list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO))
GLOBAL_LIST_INIT(ROLES_AUXIL_SUPPORT, list(JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT))
GLOBAL_LIST_INIT(ROLES_MISC, list(JOB_SYNTH, JOB_WORKING_JOE, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH))
GLOBAL_LIST_INIT(ROLES_POLICE, list(JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE))
GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH))
GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_AI_TECH))
GLOBAL_LIST_INIT(ROLES_REQUISITION, list(JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION))
GLOBAL_LIST_INIT(ROLES_MEDICAL, list(JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_WO_CMO, JOB_WO_RESEARCHER, JOB_WO_DOCTOR))
GLOBAL_LIST_INIT(ROLES_MARINES, list(JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE))
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/objectives_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ SUBSYSTEM_DEF(objectives)

ai_silent_announcement(message, ":v", TRUE)
ai_silent_announcement(message, ":t", TRUE)
log_ares_tech(MAIN_AI_SYSTEM, FALSE, "TECH REPORT", "[round(tree.points, 0.1)] points available.", 0)
tree.total_points_last_sitrep = tree.total_points

next_sitrep = world.time + SITREP_INTERVAL
Expand Down
2 changes: 1 addition & 1 deletion code/datums/factions/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
// Whiskey Outpost
if(JOB_WO_CO)
marine_rk = "wo_co"
if(JOB_WO_XO)
if(JOB_WO_XO, JOB_AI_TECH)
marine_rk = "wo_xo"
if(JOB_WO_CHIEF_POLICE)
marine_rk = "hgsl"
Expand Down
18 changes: 18 additions & 0 deletions code/game/jobs/job/special/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,21 @@
title = JOB_RIOT
/datum/job/special/uscm/riot/chief
title = JOB_RIOT_CHIEF

/datum/job/special/uscm/ai_tech
title = JOB_AI_TECH
selection_class = "job_ce"
supervisors = "the acting commanding officer"
total_positions = 1
spawn_positions = 1
flags_startup_parameters = ROLE_WHITELISTED|ROLE_HIDDEN
gear_preset = /datum/equipment_preset/uscm_event/ai_tech

/datum/job/special/uscm/ai_tech/check_whitelist_status(mob/user)
if(check_rights(R_PERMISSIONS, show_msg = FALSE))
return TRUE
return FALSE

/datum/job/special/uscm/ai_tech/generate_entry_message()
entry_message_body = "You are a visiting AI Service Technician aboard the [MAIN_SHIP_NAME]. Your goal is to ensure the onboard AI, [MAIN_AI_SYSTEM], is operating effectively. Your job involves heavy roleplay and requires you to behave like a high-ranking officer and to stay in character at all times. You are required to adhere to and obey <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in punitive action against you. Godspeed."
return ..()
124 changes: 93 additions & 31 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
var/current_menu = "login"
var/last_menu = ""

var/authentication = ARES_ACCESS_BASIC
var/authentication = ARES_ACCESS_LOGOUT

/// The last person to login.
var/last_login
var/last_login = "No User"
/// The person pretending to be last_login
var/sudo_holder

Expand Down Expand Up @@ -183,6 +183,19 @@
logged_orders += list(current_order)
data["records_requisition"] = logged_orders

var/list/logged_techs = list()
for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech)
if(!istype(tech_unlock))
continue
var/list/current_tech = list()
current_tech["time"] = tech_unlock.time
current_tech["details"] = tech_unlock.details
current_tech["user"] = tech_unlock.user
current_tech["tier_changer"] = tech_unlock.is_tier
current_tech["ref"] = "\ref[tech_unlock]"
logged_techs += list(current_tech)
data["records_tech"] = logged_techs

var/list/logged_convos = list()
var/list/active_convo = list()
var/active_ref
Expand All @@ -203,6 +216,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 as anything 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 @@ -216,19 +248,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 @@ -239,22 +271,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 All @@ -275,6 +307,8 @@
last_login = sudo_holder
sudo_holder = null
datacore.interface_access_list += "[last_login] logged out at [worldtime2text()]."
last_login = "No User"
authentication = ARES_ACCESS_LOGOUT

if("home")
last_menu = current_menu
Expand Down Expand Up @@ -315,6 +349,12 @@
if("page_deleted_1to1")
last_menu = current_menu
current_menu = "deleted_talks"
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 @@ -366,9 +406,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 @@ -379,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)
Loading

0 comments on commit 6f61f1f

Please sign in to comment.