Update power.dm

powernet connection for z-levels
This commit is contained in:
LBraindead
2014-01-18 00:20:22 +01:00
parent cfcb3e65cd
commit 4bccee98ba

View File

@@ -112,7 +112,17 @@
// if unmarked==1, only return those with no powernet
/proc/power_list(var/turf/T, var/source, var/d, var/unmarked=0)
. = list()
var/fdir = (!d)? 0 : turn(d, 180) // the opposite direction to d (or 0 if d==0)
var/fdir = (!d)? 0 : turn(d, 180)
// the opposite direction to d (or 0 if d==0)
///// Z-Level Stuff
var/Zdir
if(d==11)
Zdir = 11
else if (d==12)
Zdir = 12
else
Zdir = 999
///// Z-Level Stuff
// world.log << "d=[d] fdir=[fdir]"
for(var/AM in T)
if(AM == source) continue //we don't want to return source
@@ -129,7 +139,9 @@
var/obj/structure/cable/C = AM
if(!unmarked || !C.powernet)
if(C.d1 == fdir || C.d2 == fdir)
///// Z-Level Stuff
if(C.d1 == fdir || C.d2 == fdir || C.d1 == Zdir || C.d2 == Zdir)
///// Z-Level Stuff
. += C
else if(C.d1 == turn(C.d2, 180))
. += C
@@ -140,11 +152,40 @@
. = list() // this will be a list of all connected power objects
var/turf/T = loc
if(d1) T = get_step(src, d1)
if(T) . += power_list(T, src, d1, 1)
///// Z-Level Stuff
if(d1)
if(d1 <= 10)
T = get_step(src, d1)
if(T)
. += power_list(T, src, d1, 1)
else if (d1 == 11 || d1 == 12)
var/turf/controlerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroler/controler in controlerlocation)
if(controler.up && d1 == 12)
T = locate(src.x, src.y, controler.up_target)
if(T)
. += power_list(T, src, 11, 1)
if(controler.down && d1 == 11)
T = locate(src.x, src.y, controler.down_target)
if(T)
. += power_list(T, src, 12, 1)
T = get_step(src, d2)
if(T) . += power_list(T, src, d2, 1)
if(d2 == 11 || d2 == 12)
var/turf/controlerlocation = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroler/controler in controlerlocation)
if(controler.up && d2 == 12)
T = locate(src.x, src.y, controler.up_target)
if(T)
. += power_list(T, src, 11, 1)
if(controler.down && d2 == 11)
T = locate(src.x, src.y, controler.down_target)
if(T)
. += power_list(T, src, 12, 1)
else
T = get_step(src, d2)
if(T)
. += power_list(T, src, d2, 1)
///// Z-Level Stuff
return .