From a1ab60fd07f0ef502019474db6f61af2e025bbb1 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sat, 8 Apr 2023 22:47:48 -0300 Subject: [PATCH] push --- code/game/machinery/doors/door.dm | 31 +++++++++++++++++++++------ code/game/machinery/doors/firedoor.dm | 1 + code/game/machinery/doors/poddoor.dm | 1 + 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index d565984bf0..a3483e5702 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -44,6 +44,8 @@ var/red_alert_access = FALSE //if TRUE, this door will always open on red alert var/poddoor = FALSE var/unres_sides = 0 //Unrestricted sides. A bitflag for which direction (if any) can open the door with no access + /// Whether or not the door can be opened by hand (used for blast doors and shutters) + var/can_open_with_hands = TRUE /obj/machinery/door/examine(mob/user) . = ..() @@ -55,10 +57,16 @@ if(!poddoor) . += "Its maintenance panel is screwed in place." -/obj/machinery/door/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) +/obj/machinery/door/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() - if (isnull(held_item) && !istype(src, /obj/machinery/door/firedoor)) // You cannot open/close with your hands + if(!can_open_with_hands) + return . + + if(isaicamera(user) || issilicon(user)) + return . + + if(isnull(held_item) && Adjacent(user)) LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_ANY, (density ? "Open" : "Close")) return CONTEXTUAL_SCREENTIP_SET @@ -100,7 +108,7 @@ return ..() /obj/machinery/door/Bumped(atom/movable/AM) - if(operating || (obj_flags & EMAGGED)) + if(operating || (obj_flags & EMAGGED) || (!can_open_with_hands && density)) return if(ismob(AM)) var/mob/B = AM @@ -132,9 +140,9 @@ return !opacity /obj/machinery/door/proc/bumpopen(mob/user) - if(operating) + if(operating || !can_open_with_hands) return - src.add_fingerprint(user) + add_fingerprint(user) if(!src.requiresID()) user = null @@ -155,7 +163,7 @@ /obj/machinery/door/proc/try_to_activate_door(mob/user) add_fingerprint(user) - if(operating || (obj_flags & EMAGGED)) + if(operating || (obj_flags & EMAGGED) || !can_open_with_hands) return if(!requiresID()) user = null //so allowed(user) always succeeds @@ -417,3 +425,14 @@ . = ..() if(!density) return . * EXPLOSION_DAMAGE_OPEN_DOOR_FACTOR + +/obj/machinery/door/shuttleRotate(rotation, params) + . = ..() + if(!unres_sides) + return + var/new_unres_sides + for(var/direction in GLOB.cardinals) + if(unres_sides & direction) + new_unres_sides |= angle2dir_cardinal(rotation+dir2angle(direction)) + unres_sides = new_unres_sides + update_icon() diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 39b9baae62..0e1a67316b 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -26,6 +26,7 @@ air_tight = TRUE attack_hand_is_action = TRUE attack_hand_speed = CLICK_CD_MELEE + can_open_with_hands = FALSE var/emergency_close_timer = 0 var/nextstate = null var/boltslocked = TRUE diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 654dc13e1c..ba96cb5bf6 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -16,6 +16,7 @@ armor = list(MELEE = 50, BULLET = 100, LASER = 100, ENERGY = 100, BOMB = 50, BIO = 100, RAD = 100, FIRE = 100, ACID = 70) resistance_flags = FIRE_PROOF damage_deflection = 70 + can_open_with_hands = FALSE poddoor = TRUE /obj/machinery/door/poddoor/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)