Request Emergency Temporary Access - RETA (#92753)

<img width="819" height="348" alt="image"
src="https://github.com/user-attachments/assets/0424ec76-2648-43d3-8e94-d44558b44bcf"
/>

## About The Pull Request

Follow up from #92751 - Not to conflict with it but as an idea on how to
change it for the long run.

Paramedics currently start with broad department access. This proposal
replaces that by granting temporary department access only when an
emergency is called.

When a player presses "Call X" on a Requests Console, responders called
receive temporary access to the common work areas of that department.

![image](https://hackmd.io/_uploads/r1xNOv0Fle.png)
> [Security] The Automated Announcement System coldly states, "SECURITY
EMERGENCY in Research Lab! (Called by Sloan Keppel, Scientist) RETA door
access granted to responders."

> [Science] The Automated Announcement System coldly states, "RETA
activated (Called by Sloan Keppel, Scientist). Security personnel now
have temporary access to your areas."

They do not receive access to sub rooms or high risk areas.

- Access lasts 5 minutes (configurable)  
- Access is removed when the timer expires or the emergency is resolved
- No mapping changes are required (uses existing request consoles)  
- Removes Paramedics round start access but gives them external access
to rescue bodies in space by default
- Flashing blue lights on doors affected by temporary access
<img width="897" height="837" alt="image"
src="https://github.com/user-attachments/assets/97980cb4-3481-44b6-9f96-fc241ca16f57"
/>


**The full document is here:
https://hackmd.io/@NM8HxpG_Toahg5pimrpsKw/Hk0tKq3Yxe**

**Wiki documentation for players and admins:
https://wiki.tgstation13.org/Guide_To_RETA**


## Why It's Good For The Game

- Removes paramedics’ broad “Doctor+” access.
- Keeps them effective as emergency responders.
- Responders must be called in OR access upgraded.
- Keeps sensitive areas secure.
- Prevents spam or stacking through cooldown.
- Scales across all maps without mapper work.
- Gives admins a new tool for temp department wide access
- Dedicated logging file and unit tests
- Very performant, only affects living players with connected mind
- Gives Request Consoles more use as an alarm button and further utility
- Imagine later on "Request Janitor" which sorts access and tells
Janitor where needed

## Changelog
🆑
add: RETA System - Request Consoles give temporary access to responders
when used for some areas. Paramedics lose broad access but get external
space access.
qol: Request consoles now show name and job role on call message &
Cooldown on spamming calls + sound prompt
qol: Medibot access no longer based on Paramedic trim ID - Still has
original access
image: Added "lights_reta" for temporary door access when in effect
admin: Gives admins "RETA door access" verb for giving department wide
area access on maps.
config: New config settings for RETA

/🆑
This commit is contained in:
SimplyLogan
2025-09-10 23:33:40 +00:00
committed by GitHub
parent 9f356f8b9a
commit a1fdc715df
20 changed files with 1052 additions and 16 deletions
+122
View File
@@ -0,0 +1,122 @@
/**
* Request Emergency Temporary Access - Admin Verbs
*/
/// Admin command to manually trigger RETA access grant for admins
ADMIN_VERB(reta_manual_trigger, R_ADMIN, "RETA Door Access", "Manually trigger RETA access for testing", ADMIN_CATEGORY_EVENTS)
var/calling_dept = tgui_input_list(user, "RETA - Which department is CALLING for help?", "Calling Department", list("Security", "Engineering", "Medical", "Science", "Service", "Command", "Cargo", "Mining"))
if(!calling_dept)
return
var/list/available_depts = list("Security", "Engineering", "Medical", "Science", "Service", "Command", "Cargo", "Mining")
available_depts -= calling_dept
// Multi-select using repeated input_list calls
var/list/selected_depts = list()
var/list/remaining_depts = available_depts.Copy()
while(length(remaining_depts))
remaining_depts += "DONE - Finish selection"
var/choice = tgui_input_list(user, "RETA - Select departments to RESPOND to [calling_dept]\nCurrently selected: [english_list(selected_depts)]\n\nSelect another department or DONE:", "Responding Departments", remaining_depts)
if(!choice || choice == "DONE - Finish selection")
break
selected_depts += choice
remaining_depts -= choice
remaining_depts -= "DONE - Finish selection"
if(!length(selected_depts))
message_admins("No departments selected for RETA response.")
return
var/duration = tgui_input_number(user, "Duration in minutes:", "RETA Duration", 5, 60, 1)
if(!duration)
return
message_admins("[key_name_admin(user)] is manually triggering RETA: [calling_dept] called for help, [english_list(selected_depts)] will get access to [calling_dept] areas for [duration] minutes.")
log_game("ADMIN: [key_name(user)] is manually triggering RETA: [calling_dept] called for help, [english_list(selected_depts)] will get access to [calling_dept] areas for [duration] minutes.")
// Grant access to each responding department and collect results
var/successful_grants = 0
var/list/granted_depts = list()
var/total_eligible_cards = 0
for(var/responding_dept in selected_depts)
var/dept_eligible_cards = 0
var/list/job_trims = GLOB.reta_job_trims[responding_dept]
for(var/mob/living/carbon/human/human_player as anything in GLOB.human_list)
if(!human_player.client || human_player.stat == DEAD)
continue
var/obj/item/card/id/id_card = human_player.get_idcard(hand_first = FALSE)
if(!id_card || !id_card.trim)
continue
if(is_type_in_list(id_card.trim, job_trims))
dept_eligible_cards++
total_eligible_cards += dept_eligible_cards
message_admins("[responding_dept] department: [dept_eligible_cards] eligible cards from living players")
// Note: RETA grants access FROM calling_dept TO responding_dept personnel
// So if Medical calls Security, Security personnel get Medical access
if(reta_find_and_grant_access(responding_dept, calling_dept, duration MINUTES))
successful_grants++
granted_depts += responding_dept
// Report results
if(successful_grants > 0)
message_admins("RETA access granted successfully: [english_list(granted_depts)] personnel now have [calling_dept] access. Total eligible cards: [total_eligible_cards]")
// Send department announcement like the normal system
var/caller_info = " (Called by CENTCOM)"
var/enhanced_location = "[calling_dept][caller_info]"
// Send announcements to all successfully granted departments
for(var/dept in granted_depts)
switch(dept)
if("Security")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SECURITY), "Security")
if("Engineering")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_ENGINEERING), "Engineering")
if("Medical")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_MEDICAL), "Medical")
if("Science")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SCIENCE), "Science")
if("Service")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SERVICE), "Service")
if("Command")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_COMMAND), "Command")
if("Cargo")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SUPPLY), "Cargo")
if("Mining")
aas_config_announce(/datum/aas_config_entry/rc_emergency, list("LOCATION" = enhanced_location), null, list(RADIO_CHANNEL_SUPPLY), "Mining")
// Send confirmation to the calling department about who has been given access
var/calling_message = "RETA activated[caller_info]. The following now have temporary door access: [english_list(granted_depts)]."
// Get an announcement system to send simple radio messages
var/obj/machinery/announcement_system/announcer = get_announcement_system(null, null, list(RADIO_CHANNEL_COMMON))
if(announcer)
switch(calling_dept)
if("Security")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SECURITY)
if("Engineering")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_ENGINEERING)
if("Medical")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_MEDICAL)
if("Science")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SCIENCE)
if("Service")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SERVICE)
if("Command")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_COMMAND)
if("Cargo")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY)
if("Mining")
announcer.radio.talk_into(announcer, calling_message, RADIO_CHANNEL_SUPPLY)
else
message_admins("RETA access grant failed for all departments.")