Files
FabianK3 068352fa46 Powerless airlocks - Closed by default and the emergency override (#21649)
# Summary

This PR updates the default behavior of airlocks on powerloss and adds a
manual override for them.
By default airlocks now keep closed (and close if opened) on powerloss.
Additionally a new mechanic has been added allowing people to manually
open unpowered, unbolted and unsecure airlocks without power by
utilizing a manual override.

## Mechanics

- On power loss doors will stay closed.
- On power loss opened doors will now close.
- Manual override mechanic:
If a door is functional but unpowered and features an override handle
(previously called "insecure" by default, false for vaults and similar)
the user can now engage the manual override. It works by cranking a
hydraulic lever multiple times to force open the door without a crowbar,
this process takes around 15 seconds. The process is divided into
3-second steps each given a ratchet sound. When user waits long enough
the door will open. Doors that have been opened with the manual override
will automatically close again after the door receives power again, just
like the old behavior. While waiting the user will be informed about the
length of the process by seeing a small oil gauge fill up (via chat
message).

Process:
- User clicked unpowered door
- 3 second action (including a ratchet sound) x 5
- Every action feedback is given:
<img width="784" height="169" alt="image"
src="https://github.com/user-attachments/assets/4cf940bb-458b-4bce-8893-3cd96b5b2455"
/>

<hr>

Idea originated from: [Forum
thread](https://forums.aurorastation.org/topic/22728-airlocks-opening-on-powerloss/#findComment-182862)

## Changes

- Renamed `insecure` airlock feature to
`features_powerloss_manual_override`.
- Adjusted default powerloss behavior to close instead to open, if not
already closed.
- Added manual override feature.
- Update all `insecure = FALSE` references to
`features_powerloss_manual_override = FALSE` (vaults and similar
locations).
- Fixed a CI issue with a `RegisterSignal`.
2025-12-19 20:21:16 +00:00

44 lines
1.4 KiB
Plaintext

/**
* Attached to movable atoms with opacity. Listens to them move and updates their old and new turf loc's opacity accordingly.
*/
/datum/element/light_blocking
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY
/datum/element/light_blocking/Attach(datum/target)
. = ..()
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_target_move), TRUE)
var/atom/movable/movable_target = target
if(!isturf(movable_target.loc))
return
for(var/turf/turf_loc as anything in movable_target.locs)
turf_loc.add_opacity_source(target)
/datum/element/light_blocking/Detach(datum/target)
. = ..()
UnregisterSignal(target, list(COMSIG_MOVABLE_MOVED))
var/atom/movable/movable_target = target
if(!isturf(movable_target.loc))
return
for(var/turf/turf_loc as anything in movable_target.locs)
turf_loc.remove_opacity_source(target)
///Updates old and new turf loc opacities.
///Updates old and new turf loc opacities.
/datum/element/light_blocking/proc/on_target_move(atom/movable/source, atom/old_loc, dir, forced, list/old_locs)
SIGNAL_HANDLER
if(isturf(old_loc))
if(old_locs)
for(var/turf/old_turf as anything in old_locs)
old_turf.remove_opacity_source(source)
else
var/turf/old_turf = old_loc
old_turf.remove_opacity_source(source)
if(isturf(source.loc))
for(var/turf/new_turf as anything in source.locs)
new_turf.add_opacity_source(source)