Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@
// from /obj/item/device/binoculars/range/designator/acquire_target()
#define COMSIG_DESIGNATOR_LASE "comsig_designator_lase"
#define COMSIG_DESIGNATOR_LASE_OFF "comsig_designator_lase_off"

#define COMSIG_DOOR_OPEN "comsig_door_open"
#define COMSIG_DOOR_CLOSE "comsig_door_close"
4 changes: 4 additions & 0 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@
if(autoclose)
addtimer(CALLBACK(src, PROC_REF(autoclose)), normalspeed ? 15 SECONDS + openspeed : 5 DECISECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)

SEND_SIGNAL(src, COMSIG_DOOR_OPEN)

/obj/structure/machinery/door/proc/close(forced = FALSE)
if(density && !operating)
return TRUE
Expand Down Expand Up @@ -282,7 +284,9 @@
set_opacity(TRUE)
if(length(filler_turfs))
change_filler_opacity(opacity)

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/proc/requiresID()
return TRUE
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/doors/poddoor/poddoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
return

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/poddoor/filler_object
name = ""
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/poddoor/shutters/shutters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
if(autoclose)
addtimer(CALLBACK(src, PROC_REF(autoclose)), 15 SECONDS, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_NO_HASH_WAIT)

SEND_SIGNAL(src, COMSIG_DOOR_OPEN)

/obj/structure/machinery/door/poddoor/shutters/close(forced = FALSE)
if(operating)
return FALSE
Expand All @@ -78,6 +80,7 @@
return

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/poddoor/shutters/almayer
icon = 'icons/obj/structures/doors/blastdoors_shutters.dmi'
Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/doors/railing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

density = FALSE
operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_OPEN)

/obj/structure/machinery/door/poddoor/railing/close(forced = FALSE)
if(operating)
Expand All @@ -74,6 +75,7 @@
return

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/poddoor/railing/open
density = FALSE
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/runed_sandstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
change_filler_opacity(opacity)

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_OPEN)

/obj/structure/machinery/door/airlock/sandstone/runed/close(forced = TRUE)
if(operating && !forced)
Expand Down Expand Up @@ -176,6 +177,8 @@
if(killthis)
killthis.ex_act(EXPLOSION_THRESHOLD_LOW)

SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/airlock/sandstone/runed/lock(forced = FALSE)
if(operating && !forced)
return FALSE
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
density = FALSE
operating = DOOR_OPERATING_IDLE

SEND_SIGNAL(src, COMSIG_DOOR_OPEN)

/obj/structure/machinery/door/window/close(forced = FALSE)
if(operating)
return FALSE
Expand All @@ -100,6 +102,7 @@
return

operating = DOOR_OPERATING_IDLE
SEND_SIGNAL(src, COMSIG_DOOR_CLOSE)

/obj/structure/machinery/door/window/proc/take_damage(damage)
src.health = max(0, src.health - damage)
Expand Down
14 changes: 14 additions & 0 deletions code/game/machinery/vending/cm_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ IN_USE used for vending/denying
. = ..()
cm_build_inventory(get_listed_products(), 1, 3)

// Make us uninteractable if hidden by a door
for(var/obj/structure/machinery/door/door in loc)
RegisterSignal(door, list(COMSIG_DOOR_OPEN, COMSIG_DOOR_CLOSE), PROC_REF(check_doors))
if(door.density)
mouse_opacity = 0

/// This will update the mouse_opacity depending on if any of the doors in our loc have density
/obj/structure/machinery/cm_vending/proc/check_doors()
for(var/obj/structure/machinery/door/door in loc)
if(door.density)
mouse_opacity = 0
return
mouse_opacity = initial(mouse_opacity)

/obj/structure/machinery/cm_vending/update_icon()
//restoring sprite to initial
overlays.Cut()
Expand Down
26 changes: 20 additions & 6 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
GLOB.closet_list += src
flags_atom |= USES_HEARING

// Make us uninteractable if hidden by a door
for(var/obj/structure/machinery/door/door in loc)
RegisterSignal(door, list(COMSIG_DOOR_OPEN, COMSIG_DOOR_CLOSE), PROC_REF(check_doors))
if(door.density)
mouse_opacity = 0

/obj/structure/closet/Destroy()
GLOB.closet_list -= src
return ..()
Expand All @@ -54,19 +60,27 @@

return ..()

/// This will update the mouse_opacity depending on if any of the doors in our loc have density
/obj/structure/closet/proc/check_doors()
for(var/obj/structure/machinery/door/door in loc)
if(door.density)
mouse_opacity = 0
return
mouse_opacity = initial(mouse_opacity)

/obj/structure/closet/proc/select_gamemode_equipment(gamemode)
return

/obj/structure/closet/proc/can_open()
if(src.welded)
return 0
return 1
/obj/structure/closet/proc/can_open(mob/user)
if(welded)
return FALSE
return TRUE

/obj/structure/closet/proc/can_close(mob/user)
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src && !closet.wall_mounted)
return FALSE
for(var/mob/living/carbon/xenomorph/xeno in get_turf(src))
if(locate(/mob/living/carbon/xenomorph) in get_turf(src))
return FALSE
if(MODE_HAS_MODIFIER(/datum/gamemode_modifier/disable_stripdrag_enemy))
for(var/mob/living/carbon/human/closed_mob in get_turf(src))
Expand Down Expand Up @@ -94,7 +108,7 @@
if(opened)
return FALSE

if(!force && !can_open())
if(!force && !can_open(user))
return FALSE

dump_contents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
var/slotlocked = 0
var/slotlocktype = null

/obj/structure/closet/secure_closet/can_open()
if(src.locked)
return 0
/obj/structure/closet/secure_closet/can_open(mob/user)
if(locked)
return FALSE
return ..()

/obj/structure/closet/secure_closet/close()
Expand Down
13 changes: 5 additions & 8 deletions code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@
if (PF)
PF.flags_can_pass_all = PASS_OVER|PASS_AROUND

/obj/structure/closet/crate/can_open()
return 1

/obj/structure/closet/crate/can_close()
for(var/mob/living/L in get_turf(src)) //Can't close if someone is standing inside it. This is to prevent "crate traps" (let someone step in, close, open for 30 damage)
return 0
return 1
/obj/structure/closet/crate/can_close(mob/user)
if(locate(/mob/living) in get_turf(src)) //Can't close if someone is standing inside it. This is to prevent "crate traps" (let someone step in, close, open for 30 damage)
return FALSE
return TRUE

/obj/structure/closet/crate/BlockedPassDirs(atom/movable/mover, target_dir)
for(var/obj/structure/S in get_turf(mover))
Expand All @@ -59,7 +56,7 @@
/obj/structure/closet/crate/open(mob/user, force)
if(opened)
return FALSE
if(!force && !can_open())
if(!force && !can_open(user))
return FALSE

if(rigged && locate(/obj/item/device/radio/electropack) in src)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
overlays += "welded"


/obj/structure/closet/crate/secure/can_open()
/obj/structure/closet/crate/secure/can_open(mob/user)
return !locked

/obj/structure/closet/crate/secure/proc/togglelock(mob/user as mob)
Expand Down
Loading