Cutting an airlock's ID wire prevents ID usage again (#96195)

This commit is contained in:
MrMelbert
2026-06-01 22:20:53 -05:00
committed by GitHub
parent 82773825b2
commit 65c41f0cb6
2 changed files with 70 additions and 18 deletions
+52
View File
@@ -173,3 +173,55 @@
door.req_access = list(ACCESS_ENGINEERING, ACCESS_MAINT_TUNNELS)
subject.Bump(door)
TEST_ASSERT_EQUAL(door.density, TRUE, "Subject opened access-locked airlock while hands blocked!")
/// Checks that doors with the id wire cut are inaccessible
/datum/unit_test/door_require_id_wire_cut
/datum/unit_test/door_require_id_wire_cut/Run()
var/obj/machinery/door/airlock/instant/door = EASY_ALLOCATE()
door.interaction_flags_machine |= INTERACT_MACHINE_OFFLINE
door.req_access = list(ACCESS_ENGINEERING)
var/mob/living/carbon/human/subject = EASY_ALLOCATE()
subject.equipOutfit(/datum/outfit/job/assistant/consistent)
var/obj/item/card/id/advanced/keycard = subject.wear_id
keycard.access = list(ACCESS_ENGINEERING, ACCESS_MAINT_TUNNELS)
subject.Bump(door)
TEST_ASSERT_EQUAL(door.density, FALSE, "Subject failed to open access-locked airlock before id wire cut!")
door.close()
door.wires.pulse(WIRE_OPEN, subject)
TEST_ASSERT_EQUAL(door.density, TRUE, "Pulsing the door's open wire allowed the subject to open the access-locked airlock without cutting the id wire!")
door.wires.cut(WIRE_IDSCAN, subject)
subject.last_bumped = 0
subject.Bump(door)
TEST_ASSERT_EQUAL(door.density, TRUE, "Subject opened access-locked airlock with id wire cut!")
door.wires.pulse(WIRE_OPEN, subject)
TEST_ASSERT_EQUAL(door.density, FALSE, "Subject failed to open access-locked airlock with id wire cut and open wire pulsed!")
door.close()
door.wires.cut(WIRE_IDSCAN, subject) // mend
subject.last_bumped = 0
subject.Bump(door)
TEST_ASSERT_EQUAL(door.density, FALSE, "Subject failed to open access-locked airlock after mending id wire!")
/// Same as above but testing throwing the item at the door
/datum/unit_test/door_require_id_wire_cut/item_only
/datum/unit_test/door_require_id_wire_cut/item_only/Run()
var/obj/machinery/door/airlock/instant/door = EASY_ALLOCATE()
door.interaction_flags_machine |= INTERACT_MACHINE_OFFLINE
door.req_access = list(ACCESS_ENGINEERING)
var/obj/item/card/id/advanced/keycard = EASY_ALLOCATE()
keycard.access = list(ACCESS_ENGINEERING, ACCESS_MAINT_TUNNELS)
keycard.Bump(door)
TEST_ASSERT_EQUAL(door.density, FALSE, "Throwing an ID at an access-locked airlock failed to open it before id wire cut!")
door.close()
door.wires.cut(WIRE_IDSCAN)
keycard.Bump(door)
TEST_ASSERT_EQUAL(door.density, TRUE, "Throwing an ID at an access-locked airlock succeeded in opening it after id wire cut!")
door.close()
door.wires.cut(WIRE_IDSCAN) // mend
keycard.Bump(door)
TEST_ASSERT_EQUAL(door.density, FALSE, "Throwing an ID at an access-locked airlock failed to open it after mending the id wire!")