Add floor catwalks (#2786)

Adds floor-mounted catwalks, a special variant of catwalks that can be placed on regular turfs without deleting themselves.
Constructed with 4 rods from the rod construction menu, and are layered above wiring and power terminals. Can be disassembled with a welder, or (un)anchored with a screwdriver.
This commit is contained in:
Lohikar
2017-06-22 05:22:12 -05:00
committed by skull132
parent 26af8de863
commit c8fde7832f
2 changed files with 43 additions and 27 deletions
+32 -17
View File
@@ -3,11 +3,12 @@
desc = "A lightweight support lattice."
icon = 'icons/obj/smooth/lattice.dmi'
icon_state = "lattice"
density = 0
anchored = 1.0
density = FALSE
anchored = TRUE
w_class = 3
layer = 2.3 //under pipes
// flags = CONDUCT
var/restrict_placement = TRUE
smooth = SMOOTH_MORE
canSmoothWith = list(
/obj/structure/lattice,
@@ -21,11 +22,10 @@
/obj/structure/lattice/Initialize()
. = ..()
///// Z-Level Stuff
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/open) || istype(src.loc, /turf/simulated/floor/asteroid)))
///// Z-Level Stuff
return INITIALIZE_HINT_QDEL
for(var/obj/structure/lattice/LAT in src.loc)
if (restrict_placement)
if(!(istype(loc, /turf/space) || istype(loc, /turf/simulated/open) || istype(loc, /turf/simulated/floor/asteroid)))
return INITIALIZE_HINT_QDEL
for(var/obj/structure/lattice/LAT in loc)
if(LAT != src)
qdel(LAT)
@@ -38,7 +38,6 @@
return
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/stack/tile/floor))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
@@ -66,12 +65,28 @@
smooth = SMOOTH_TRUE
canSmoothWith = null
/obj/structure/lattice/catwalk/Initialize()
. = ..()
///// Z-Level Stuff
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/open) || istype(src.loc, /turf/simulated/floor/asteroid)))
///// Z-Level Stuff
return INITIALIZE_HINT_QDEL
for(var/obj/structure/lattice/catwalk/LAT in src.loc)
if(LAT != src)
qdel(LAT)
// Special catwalk that can be placed on regular flooring.
/obj/structure/lattice/catwalk/indoor
desc = "A floor-mounted catwalk designed to protect pipes & station wiring from passing feet."
restrict_placement = FALSE
can_be_unanchored = TRUE
layer = 2.7 // Above wires.
/obj/structure/lattice/catwalk/attackby(obj/item/C, mob/user)
if (iswelder(C))
var/obj/item/weapon/weldingtool/WT = C
if (do_after(user, 5, act_target = src) && WT.remove_fuel(1, user))
user << "<span class='notice'>You slice apart [src].</span>"
playsound(src, 'sound/items/Welder.ogg', 50, 1)
new /obj/item/stack/rods{amount = 3}(loc)
qdel(src)
/obj/structure/lattice/catwalk/indoor/attackby(obj/item/C, mob/user)
if (isscrewdriver(C))
anchored = !anchored
user << "<span class='notice'>You [anchored ? "" : "un"]anchor [src].</span>"
playsound(src, 'sound/items/Screwdriver.ogg', 50, 1)
queue_smooth(src)
queue_smooth_neighbors(src)
else
..()