Adds a mapping helper that can cycle multiple airlocks regardless of location (#60675)

currently cycle helpers only work in straight lines, this limits mapping design for airlocks, i now present to you a new mapping helper where all you do is set a var for the helper, and paste it over airlocks, and those airlocks will now all sync up so only one of them can be open at a time (as of now clicking an airlock to open them wont cycle, but the current cycle helpers dont do it either so its consistent)
This commit is contained in:
小月猫
2021-08-18 20:04:25 -04:00
committed by GitHub
parent b6478f256a
commit ac68fd9e16
4 changed files with 66 additions and 10 deletions
+36 -1
View File
@@ -28234,6 +28234,9 @@
/obj/structure/disposalpipe/segment{
dir = 4
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-right"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"hmM" = (
@@ -31376,6 +31379,9 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/structure/cable,
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-left"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"ixK" = (
@@ -40658,6 +40664,9 @@
/obj/effect/turf_decal/trimline/blue/filled/line{
dir = 1
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-left"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"lOl" = (
@@ -45709,6 +45718,9 @@
/obj/effect/turf_decal/trimline/blue/filled/line{
dir = 4
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-right"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"nPQ" = (
@@ -46586,6 +46598,9 @@
dir = 4
},
/obj/structure/cable,
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-left"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"ohf" = (
@@ -54489,6 +54504,9 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/structure/cable,
/obj/structure/disposalpipe/segment,
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-right"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"raw" = (
@@ -56134,6 +56152,20 @@
},
/turf/open/floor/engine,
/area/engineering/supermatter/room)
"rHC" = (
/obj/machinery/door/airlock/command/glass{
name = "Bridge Access";
req_access_txt = "19"
},
/obj/machinery/door/firedoor,
/obj/effect/turf_decal/trimline/blue/filled/line{
dir = 1
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-right"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"rHD" = (
/obj/effect/turf_decal/stripes{
dir = 1
@@ -60477,6 +60509,9 @@
/obj/effect/turf_decal/trimline/blue/filled/line{
dir = 8
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "bridge-left"
},
/turf/open/floor/iron/dark,
/area/command/bridge)
"toF" = (
@@ -173152,7 +173187,7 @@ ydp
cun
vGu
vGu
lOg
rHC
hmH
vGu
fsN
+20 -9
View File
@@ -112,6 +112,7 @@
var/aiHacking = FALSE
var/closeOtherId //Cyclelinking for airlocks that aren't on the same x or y coord as the target.
var/obj/machinery/door/airlock/closeOther
var/list/obj/machinery/door/airlock/close_others = list()
var/obj/item/electronics/airlock/electronics
COOLDOWN_DECLARE(shockCooldown)
var/obj/item/note //Any papers pinned to the airlock
@@ -148,9 +149,6 @@
wires = set_wires()
if(frequency)
set_frequency(frequency)
if(closeOtherId != null)
addtimer(CALLBACK(.proc/update_other_id), 5)
if(glass)
airlock_material = "glass"
if(security_level > AIRLOCK_SECURITY_IRON)
@@ -181,6 +179,8 @@
. = ..()
if (cyclelinkeddir)
cyclelinkairlock()
if(closeOtherId)
update_other_id()
if(abandoned)
var/outcome = rand(1,100)
switch(outcome)
@@ -212,10 +212,9 @@
id_tag = "[port.id]_[id_tag]"
/obj/machinery/door/airlock/proc/update_other_id()
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
if(A.closeOtherId == closeOtherId && A != src)
closeOther = A
break
for(var/obj/machinery/door/airlock/Airlock in GLOB.airlocks)
if(Airlock.closeOtherId == closeOtherId && Airlock != src)
close_others += Airlock
/obj/machinery/door/airlock/proc/cyclelinkairlock()
if (cyclelinkedairlock)
@@ -350,6 +349,11 @@
if (cyclelinkedairlock.cyclelinkedairlock == src)
cyclelinkedairlock.cyclelinkedairlock = null
cyclelinkedairlock = null
if(close_others) //remove this airlock from the list of every linked airlock
closeOtherId = null
for(var/obj/machinery/door/airlock/otherlock as anything in close_others)
otherlock.close_others -= src
close_others.Cut()
if(id_tag)
for(var/obj/machinery/door_buttons/D in GLOB.machines)
D.removeMe(src)
@@ -376,8 +380,15 @@
if(!C.wearing_shock_proof_gloves())
new /datum/hallucination/shock(C)
return
if (cyclelinkedairlock)
if (!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user))
if(close_others)
for(var/obj/machinery/door/airlock/otherlock as anything in close_others)
if(!shuttledocked && !emergency && !otherlock.shuttledocked && !otherlock.emergency && allowed(user))
if(otherlock.operating)
otherlock.delayed_close_requested = TRUE
else
addtimer(CALLBACK(otherlock, .proc/close), 2)
if(cyclelinkedairlock)
if(!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user))
if(cyclelinkedairlock.operating)
cyclelinkedairlock.delayed_close_requested = TRUE
else
+10
View File
@@ -126,6 +126,16 @@
else
airlock.cyclelinkeddir = dir
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi
name = "airlock multi-cyclelink helper"
icon_state = "airlock_multicyclelink_helper"
var/cycle_id
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi/payload(obj/machinery/door/airlock/airlock)
if(airlock.closeOtherId)
log_mapping("[src] at [AREACOORD(src)] tried to set [airlock] closeOtherId, but it's already set!")
else
airlock.closeOtherId = cycle_id
/obj/effect/mapping_helpers/airlock/locked
name = "airlock lock helper"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB