Files
san7890 e0827de4b5 [MDB Ignore] Unrestricted Airlocks - Door Delays (#94040)
## About The Pull Request

This PR adds a change to a pretty prevalent feature that's been around
since #66588 (April 28th, 2022). Although it has been controversial to
some extent, I believe that it was a good change in principle for
reasons I will later get into. For now, this is what the PR does:

* All _station_ unrestricted door helpers (e.g. those in maintenance)
have been replaced with a subtype that adds a random 2-3 second delay to
opening the door, using a new "unrestricted latch" feature. **This does
not occur if the user has regular access to that door.**
* The unrestricted side will initiate a do_after and plays a distinct
small hissing sound (because I presume you're disengaging some hydraulic
lever on that side), after which the door will open as players have come
to expect.
* While you're engaging the lever, you will be resistant to pressure
movements as you are presumably holding onto the lever or something. All
other movements (e.g. voluntary, being shoved, etc.) will continue to
function as expected.
* We will statistically tabulate each time someone attempts to use the
unrestricted "lever", and every time one successfully occurs. This is
just for analysis to see player trends as we have lacked this over the
last 3.5 years.

Here's a link to the sound I added:
https://freesound.org/people/Usernameis1337/sounds/632755, the version
in this PR was converted using OGG Vorbis.


https://github.com/user-attachments/assets/4167bda4-63b5-4dc0-a7b2-694a9e3d3201

## Why It's Good For The Game

Back in 2022, I was one of the major proponents for adding such a change
to the game. This is for a few reasons:

* It doesn't really make human sense for a station to have
hallways/spaces that you can enter and then just get completely trapped
in. The station is a deathtrap because of _who_ is on it, not because it
_is_ a death trap. I have always maintained that we should assume that
the station is competently made to give the hijinx a much more jarring
background. To me, maintenance isn't old sections of a station (although
it can have those elements), but vital side pathways in the event of
emergencies, like having extra fire stairs in a building. The doors to
those fire stairs are always unlocked because they need to ensure that
people are able to efflux to save themselves from danger rather than
die.
* It was easily subvertable anyways. You can easily ask the HoP for
maintenance access or AI to let you out of maintenance (although the
latter was a bit harder to articulate). I don't find myself agreeing
with this as much nowadays but I remember the frustration I felt waiting
for minutes for someone to open the door had something occurred for me
to have found myself in maintenance. It's simply not fun and doesn't
make sense for a station to have this.
* I thought that it added a unique element to antagonism. You can't drag
someone in maintenance and then have the whole entire subsection of the
station be your den. It's important for you to secure your base should
you be dragging people in there instead of just always being able to win
via dragging.
* People tend to forget this point, but it actually did cause a lot
_more_ deaths in situations where threats originate outside the
station/in maintenance. It was much easier for the killy-stabby mass
murderers to ingress into main hallways and get to killing faster. This
is why the change felt "equal" in a way.

### Why not remove it outright?

I believe that a lot of balance changes over the last 3.5 years (30000
issues ago!) have been weighting for these interactions, and I think
removing it all cold-turkey like will cause a huge upturn in deadliness
and just not be what players are looking for in the new game loop. To
me, this was a vital step in getting more towards 90-minute rounds, and
I think we would see a drop in that. I also have those above three
reasons that I am still a firm believer in, but I am still interested in
seeing what a different system might entail and how that could play out.
I added stat gathering so after we get 4-6 weeks of data, we can
determine to keep or shelve this feature. I will probably always be on
the "blocking" side of removing it outright unless there's some severe
data that can convince me (which will probably need it's own test-merged
PR, while this is meant to be added into the game right now).

### Why are we changing it?

I think not enough people are dying. I played a few rounds yesterday and
while a decent chunk of people were dying, I saw a few follies in my
original line of thought. Maintenance should be a bit creepier and not
auxiliary hallways (in normal circumstances), I already thought we did a
really good job of that but I noticed that it wasn't as good as memory
served me. I think maintenance should have a little bit more difficulty
to navigate (i.e. if you're being chased down by someone and it's taking
2.5 seconds to open, that would be an excellent heart-pounding tension
moment) and would overall be more interesting than the status quo. It is
a bit sillier to me but some IRL buildings do have to have you hold down
the push bar for a few seconds until it disengages, so this is
agreeable.

I also don't think the unidirectional exit design flow standards are
where they were due to drift in application, so this is also a better
way to uniformly apply it.
## Changelog
🆑
balance: After noticing it was too easy for animals to crawl through
maintenance by abusing the Easy-Exit sensors, Nanotrasen has replaced
all unrestricted door sensors (like in maintenance) with a pull-down
lever that should take around 2-3 seconds to engage. It has been
designed to allow the employee to actuate it despite any pressure
differentials within an area.
balance: The above change does not apply to select doors in the medical
section of the station, which will continue to use the "older"
Ready-Exit system.
sound: In order to ensure that staff in high-traffic areas don't go
bonkers due to this new change, sound dampeners have been installed to
prevent the hydraulics from being heard for super long distances.
However, they skimped out on the quality for the ones in maintenance...
/🆑

FYI Mappers/Tweakers: This PR replaces all station map unres mapping
helpers with the new subtype. You are welcome to replace certain doors
with the old helper (the base type) to get the old behavior as you see
fit, just explain why that behavior is desired in that location.
Otherwise, it would be appreciated if we have this new behavior >95% of
the time.
2025-12-05 21:01:15 -05:00

392 lines
15 KiB
Plaintext

/obj/structure/door_assembly
name = "airlock assembly"
icon = 'icons/obj/doors/airlocks/station/public.dmi'
icon_state = "construction"
var/overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
anchored = FALSE
density = TRUE
max_integrity = 200
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 4)
/// Airlock's current construction state
var/state = AIRLOCK_ASSEMBLY_NEEDS_WIRES
var/base_name = "Airlock"
var/created_name = null
var/mineral = null
var/obj/item/electronics/airlock/electronics = null
/// Do we perform the extra checks required for multi-tile (large) airlocks
var/multi_tile = FALSE
/// The type path of the airlock once completed (solid version)
var/airlock_type = /obj/machinery/door/airlock
/// The type path of the airlock once completed (glass version)
var/glass_type = /obj/machinery/door/airlock/glass
/// FALSE = glass can be installed. TRUE = glass is already installed.
var/glass = FALSE
/// Whether to heat-proof the finished airlock
var/heat_proof_finished = FALSE
/// If you're changing the airlock material, what is the previous type
var/previous_assembly = /obj/structure/door_assembly
/// Airlocks with no glass version, also cannot be modified with sheets
var/noglass = FALSE
/// Airlock with glass version, but cannot be modified with sheets
var/nomineral = FALSE
/// What type of material the airlock drops when deconstructed
var/material_type = /obj/item/stack/sheet/iron
/// Amount of material the airlock drops when deconstructed
var/material_amt = 4
/obj/structure/door_assembly/multi_tile
name = "large airlock assembly"
icon = 'icons/obj/doors/airlocks/multi_tile/public/glass.dmi'
overlays_file = 'icons/obj/doors/airlocks/multi_tile/public/overlays.dmi'
base_name = "large airlock"
glass_type = /obj/machinery/door/airlock/multi_tile/public/glass
airlock_type = /obj/machinery/door/airlock/multi_tile/public/glass
dir = EAST
multi_tile = TRUE
glass = TRUE
nomineral = TRUE
material_amt = 8
/obj/structure/door_assembly/Initialize(mapload)
. = ..()
obj_flags |= UNIQUE_RENAME | RENAME_NO_DESC
update_appearance()
update_name()
/obj/structure/door_assembly/multi_tile/Initialize(mapload)
. = ..()
set_bounds()
update_overlays()
/obj/structure/door_assembly/multi_tile/Move()
. = ..()
set_bounds()
/obj/structure/door_assembly/examine(mob/user)
. = ..()
switch(state)
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
if(anchored)
. += span_notice("The anchoring bolts are <b>wrenched</b> in place, but the maintenance panel lacks <i>wiring</i>.")
else
. += span_notice("The assembly is <b>welded together</b>, but the anchoring bolts are <i>unwrenched</i>.")
if(AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
. += span_notice("The maintenance panel is <b>wired</b>, but the circuit slot is <i>empty</i>.")
if(AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
. += span_notice("The circuit is <b>connected loosely</b> to its slot, but the maintenance panel is <i>unscrewed and open</i>.")
if(!mineral && !nomineral && !glass && !noglass)
. += span_notice("There are <i>empty</i> slots for glass windows and mineral covers.")
else if(!mineral && !nomineral && glass && !noglass)
. += span_notice("There are <i>empty</i> slots for mineral covers.")
else if(!glass && !noglass)
. += span_notice("There are <i>empty</i> slots for glass windows.")
if(created_name)
. += span_notice("There is a small <i>paper</i> placard on the assembly, written on it is '[created_name]'.")
/obj/structure/door_assembly/attackby(obj/item/tool, mob/living/user, list/modifiers, list/attack_modifiers)
if((tool.tool_behaviour == TOOL_WELDER) && (mineral || glass || !anchored ))
if(!tool.tool_start_check(user, amount=1))
return
if(mineral)
var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]")
user.visible_message(span_notice("[user] welds the [mineral] plating off the airlock assembly."), span_notice("You start to weld the [mineral] plating off the airlock assembly..."))
if(tool.use_tool(src, user, 40, volume=50))
to_chat(user, span_notice("You weld the [mineral] plating off."))
new mineral_path(loc, 2)
var/obj/structure/door_assembly/PA = new previous_assembly(loc)
transfer_assembly_vars(src, PA)
else if(glass)
user.visible_message(span_notice("[user] welds the glass panel out of the airlock assembly."), span_notice("You start to weld the glass panel out of the airlock assembly..."))
if(tool.use_tool(src, user, 40, volume=50))
to_chat(user, span_notice("You weld the glass panel out."))
if(heat_proof_finished)
new /obj/item/stack/sheet/rglass(get_turf(src))
heat_proof_finished = FALSE
else
new /obj/item/stack/sheet/glass(get_turf(src))
glass = 0
else if(!anchored)
user.visible_message(span_warning("[user] disassembles the airlock assembly."), \
span_notice("You start to disassemble the airlock assembly..."))
if(tool.use_tool(src, user, 40, volume=50))
to_chat(user, span_notice("You disassemble the airlock assembly."))
deconstruct(TRUE)
else if(tool.tool_behaviour == TOOL_WRENCH)
if(!anchored )
var/door_check = 1
for(var/obj/machinery/door/D in loc)
if(!D.sub_door)
door_check = 0
break
if(door_check)
user.visible_message(span_notice("[user] secures the airlock assembly to the floor."), \
span_notice("You start to secure the airlock assembly to the floor..."), \
span_hear("You hear wrenching."))
if(tool.use_tool(src, user, 40, volume=100))
if(anchored)
return
to_chat(user, span_notice("You secure the airlock assembly."))
name = "secured airlock assembly"
set_anchored(TRUE)
else
to_chat(user, "There is another door here!")
else
user.visible_message(span_notice("[user] unsecures the airlock assembly from the floor."), \
span_notice("You start to unsecure the airlock assembly from the floor..."), \
span_hear("You hear wrenching."))
if(tool.use_tool(src, user, 40, volume=100))
if(!anchored)
return
to_chat(user, span_notice("You unsecure the airlock assembly."))
name = "airlock assembly"
set_anchored(FALSE)
else if(istype(tool, /obj/item/stack/cable_coil) && state == AIRLOCK_ASSEMBLY_NEEDS_WIRES && anchored )
if(!tool.tool_start_check(user, amount=1))
return
user.visible_message(span_notice("[user] wires the airlock assembly."), \
span_notice("You start to wire the airlock assembly..."))
if(tool.use_tool(src, user, 40, amount=1))
if(state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
return
state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS
to_chat(user, span_notice("You wire the airlock assembly."))
name = "wired airlock assembly"
else if((tool.tool_behaviour == TOOL_WIRECUTTER) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
user.visible_message(span_notice("[user] cuts the wires from the airlock assembly."), \
span_notice("You start to cut the wires from the airlock assembly..."))
if(tool.use_tool(src, user, 40, volume=100))
if(state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
return
to_chat(user, span_notice("You cut the wires from the airlock assembly."))
new/obj/item/stack/cable_coil(get_turf(user), 1)
state = AIRLOCK_ASSEMBLY_NEEDS_WIRES
name = "secured airlock assembly"
else if(istype(tool, /obj/item/electronics/airlock) && state == AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
tool.play_tool_sound(src, 100)
user.visible_message(span_notice("[user] installs the electronics into the airlock assembly."), \
span_notice("You start to install electronics into the airlock assembly..."))
if(do_after(user, 4 SECONDS, target = src))
if( state != AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS )
return
if(!user.transferItemToLoc(tool, src))
return
to_chat(user, span_notice("You install the airlock electronics."))
state = AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER
name = "near finished airlock assembly"
electronics = tool
else if((tool.tool_behaviour == TOOL_CROWBAR) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message(span_notice("[user] removes the electronics from the airlock assembly."), \
span_notice("You start to remove electronics from the airlock assembly..."))
if(tool.use_tool(src, user, 40, volume=100))
if(state != AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
return
to_chat(user, span_notice("You remove the airlock electronics."))
state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS
name = "wired airlock assembly"
var/obj/item/electronics/airlock/ae
if (!electronics)
ae = new/obj/item/electronics/airlock( loc )
else
ae = electronics
electronics = null
ae.forceMove(src.loc)
else if(istype(tool, /obj/item/stack/sheet))
var/obj/item/stack/sheet/sheet = tool
if(!glass && (istype(sheet, /obj/item/stack/sheet/rglass) || istype(sheet, /obj/item/stack/sheet/glass)))
if(noglass)
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
user.visible_message(span_notice("[user] adds [sheet.name] to the airlock assembly."), \
span_notice("You start to install [sheet.name] into the airlock assembly..."))
if(do_after(user, 4 SECONDS, target = src))
if(sheet.get_amount() < 1 || glass)
return
if(sheet.type == /obj/item/stack/sheet/rglass)
to_chat(user, span_notice("You install [sheet.name] windows into the airlock assembly."))
heat_proof_finished = 1 //reinforced glass makes the airlock heat-proof
name = "near finished heat-proofed window airlock assembly"
else
to_chat(user, span_notice("You install regular glass windows into the airlock assembly."))
name = "near finished window airlock assembly"
sheet.use(1)
glass = TRUE
return
if(istype(sheet, /obj/item/stack/sheet/mineral) && sheet.construction_path_type)
if(nomineral || mineral)
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
var/M = sheet.construction_path_type
var/mineralassembly = text2path("/obj/structure/door_assembly/door_assembly_[M]")
if(!ispath(mineralassembly))
to_chat(user, span_warning("You cannot add [sheet] to [src]!"))
return
if(sheet.get_amount() < 2)
to_chat(user, span_warning("You need at least two sheets add a mineral cover!"))
return
playsound(src, 'sound/items/tools/crowbar.ogg', 100, TRUE)
user.visible_message(span_notice("[user] adds [sheet.name] to the airlock assembly."), \
span_notice("You start to install [sheet.name] into the airlock assembly..."))
if(!do_after(user, 4 SECONDS, target = src) || sheet.get_amount() < 2 || mineral)
return
to_chat(user, span_notice("You install [M] plating into the airlock assembly."))
sheet.use(2)
var/obj/structure/door_assembly/MA = new mineralassembly(loc)
if(MA.noglass && glass) //in case the new door doesn't support glass. prevents the new one from reverting to a normal airlock after being constructed.
var/obj/item/stack/sheet/dropped_glass
if(heat_proof_finished)
dropped_glass = new /obj/item/stack/sheet/rglass(drop_location())
heat_proof_finished = FALSE
else
dropped_glass = new /obj/item/stack/sheet/glass(drop_location())
glass = FALSE
to_chat(user, span_notice("As you finish, a [dropped_glass.singular_name] falls out of [MA]'s frame."))
transfer_assembly_vars(src, MA, TRUE)
else if((tool.tool_behaviour == TOOL_SCREWDRIVER) && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER )
user.visible_message(span_notice("[user] finishes the airlock."), \
span_notice("You start finishing the airlock..."))
if(tool.use_tool(src, user, 40, volume=100))
if(loc && state == AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
to_chat(user, span_notice("You finish the airlock."))
finish_door()
else
return ..()
update_name()
update_appearance()
/obj/structure/door_assembly/proc/finish_door()
var/obj/machinery/door/airlock/door
if(glass)
door = new glass_type( loc )
else
door = new airlock_type( loc )
door.setDir(dir)
door.unres_sides = electronics.unres_sides
door.electronics = electronics
door.heat_proof = heat_proof_finished
door.security_level = 0
if(electronics.shell)
door.AddComponent( \
/datum/component/shell, \
unremovable_circuit_components = list(new /obj/item/circuit_component/airlock, new /obj/item/circuit_component/airlock_access_event, new /obj/item/circuit_component/remotecam/airlock), \
capacity = SHELL_CAPACITY_LARGE, \
shell_flags = SHELL_FLAG_ALLOW_FAILURE_ACTION|SHELL_FLAG_REQUIRE_ANCHOR \
)
if(electronics.one_access)
door.req_one_access = electronics.accesses
else
door.req_access = electronics.accesses
if(created_name)
door.name = created_name
else if(electronics.passed_name)
door.name = sanitize(electronics.passed_name)
else
door.name = base_name
if(electronics.passed_cycle_id)
door.closeOtherId = electronics.passed_cycle_id
door.update_other_id()
if(door.unres_sides)
door.unres_latch = TRUE
door.previous_airlock = previous_assembly
electronics.forceMove(door)
door.autoclose = TRUE
door.close()
door.update_appearance()
qdel(src)
return door
/obj/structure/door_assembly/update_overlays()
. = ..()
if(!glass)
. += get_airlock_overlay("fill_construction", icon, src, TRUE)
else
. += get_airlock_overlay("glass_construction", overlays_file, src, TRUE)
. += get_airlock_overlay("panel_c[state+1]", overlays_file, src, TRUE)
/obj/structure/door_assembly/update_name()
name = ""
switch(state)
if(AIRLOCK_ASSEMBLY_NEEDS_WIRES)
if(anchored)
name = "secured "
if(AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS)
name = "wired "
if(AIRLOCK_ASSEMBLY_NEEDS_SCREWDRIVER)
name = "near finished "
name += "[heat_proof_finished ? "heat-proofed " : ""][glass ? "window " : ""][base_name] assembly"
return ..()
/obj/structure/door_assembly/proc/transfer_assembly_vars(obj/structure/door_assembly/source, obj/structure/door_assembly/target, previous = FALSE)
target.glass = source.glass
target.heat_proof_finished = source.heat_proof_finished
target.created_name = source.created_name
target.state = source.state
target.set_anchored(source.anchored)
if(previous)
target.previous_assembly = source.type
if(electronics)
target.electronics = source.electronics
source.electronics.forceMove(target)
target.update_appearance()
target.update_name()
qdel(source)
/obj/structure/door_assembly/atom_deconstruct(disassembled = TRUE)
var/turf/target_turf = get_turf(src)
if(!disassembled)
material_amt = rand(2,4)
new material_type(target_turf, material_amt)
if(glass)
if(disassembled)
if(heat_proof_finished)
new /obj/item/stack/sheet/rglass(target_turf)
else
new /obj/item/stack/sheet/glass(target_turf)
else
new /obj/item/shard(target_turf)
if(mineral)
var/obj/item/stack/sheet/mineral/mineral_path = text2path("/obj/item/stack/sheet/mineral/[mineral]")
new mineral_path(target_turf, 2)
/obj/structure/door_assembly/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
if(the_rcd.mode == RCD_DECONSTRUCT)
return list("delay" = 5 SECONDS, "cost" = 16)
return FALSE
/obj/structure/door_assembly/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, list/rcd_data)
if(rcd_data[RCD_DESIGN_MODE] == RCD_DECONSTRUCT)
qdel(src)
return TRUE
return FALSE
/obj/structure/door_assembly/nameformat(input, mob/living/user)
created_name = input
return input
/obj/structure/door_assembly/rename_reset()
created_name = null