mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 11:34:19 +01:00
one way unrestricted airlocks!
This commit is contained in:
+1758
-1306
File diff suppressed because it is too large
Load Diff
@@ -621,6 +621,31 @@ About the new airlock wires panel:
|
||||
if(user)
|
||||
attack_ai(user)
|
||||
|
||||
/obj/machinery/door/airlock/proc/check_unres() //unrestricted sides. This overlay indicates which directions the player can access even without an ID
|
||||
if(hasPower() && unres_sides)
|
||||
if(unres_sides & NORTH)
|
||||
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_n") //layer=src.layer+1
|
||||
I.pixel_y = 32
|
||||
set_light(l_range = 2, l_power = 1)
|
||||
add_overlay(I)
|
||||
if(unres_sides & SOUTH)
|
||||
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_s") //layer=src.layer+1
|
||||
I.pixel_y = -32
|
||||
set_light(l_range = 2, l_power = 1)
|
||||
add_overlay(I)
|
||||
if(unres_sides & EAST)
|
||||
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_e") //layer=src.layer+1
|
||||
I.pixel_x = 32
|
||||
set_light(l_range = 2, l_power = 1)
|
||||
add_overlay(I)
|
||||
if(unres_sides & WEST)
|
||||
var/image/I = image(icon='icons/obj/doors/airlocks/station/overlays.dmi', icon_state="unres_w") //layer=src.layer+1
|
||||
I.pixel_x = -32
|
||||
set_light(l_range = 2, l_power = 1)
|
||||
add_overlay(I)
|
||||
else
|
||||
set_light(0)
|
||||
|
||||
/obj/machinery/door/airlock/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(isElectrified() && density && istype(mover, /obj/item))
|
||||
var/obj/item/I = mover
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/real_explosion_block //ignore this, just use explosion_block
|
||||
var/heat_proof = FALSE // For rglass-windowed airlocks and firedoors
|
||||
var/emergency = FALSE
|
||||
|
||||
var/unres_sides = 0 //Unrestricted sides. A bitflag for which direction (if any) can open the door with no access
|
||||
//Multi-tile doors
|
||||
var/width = 1
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
..()
|
||||
update_dir()
|
||||
|
||||
/obj/machinery/door/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/door/proc/update_dir()
|
||||
if(width > 1)
|
||||
if(dir in list(EAST, WEST))
|
||||
@@ -175,10 +179,15 @@
|
||||
/obj/machinery/door/allowed(mob/M)
|
||||
if(emergency)
|
||||
return TRUE
|
||||
if(unrestricted_side(M))
|
||||
return TRUE
|
||||
if(!requiresID())
|
||||
return FALSE // Intentional. machinery/door/requiresID() always == 1. airlocks, however, == 0 if ID scan is disabled. Yes, this var is poorly named.
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/proc/unrestricted_side(mob/M) //Allows for specific side of airlocks to be unrestrected (IE, can exit maint freely, but need access to enter)
|
||||
return get_dir(src, M) & unres_sides
|
||||
|
||||
/obj/machinery/door/proc/try_to_weld(obj/item/weldingtool/W, mob/user)
|
||||
return
|
||||
|
||||
|
||||
@@ -67,6 +67,24 @@
|
||||
/obj/effect/mapping_helpers/no_lava
|
||||
icon_state = "no_lava"
|
||||
|
||||
/obj/effect/mapping_helpers/airlock
|
||||
layer = DOOR_HELPER_LAYER
|
||||
|
||||
/obj/effect/mapping_helpers/airlock/unres
|
||||
name = "airlock unresctricted side helper"
|
||||
icon_state = "airlock_unres_helper"
|
||||
|
||||
/obj/effect/mapping_helpers/airlock/unres/Initialize(mapload)
|
||||
..()
|
||||
if(!mapload)
|
||||
log_world("### MAP WARNING, [src] spawned outside of mapload!")
|
||||
return
|
||||
var/obj/machinery/door/airlock/airlock = locate(/obj/machinery/door/airlock) in src.loc
|
||||
if(airlock)
|
||||
airlock.unres_sides ^= dir
|
||||
else
|
||||
log_world("### MAP WARNING, [src] failed to find an airlock at [AREACOORD(src)]")
|
||||
|
||||
/obj/effect/mapping_helpers/no_lava/New()
|
||||
var/turf/T = get_turf(src)
|
||||
T.flags |= NO_LAVA_GEN
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 9.4 KiB |
Reference in New Issue
Block a user