mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 19:44:46 +01:00
Update to stairs.
This commit is contained in:
@@ -55,32 +55,53 @@
|
||||
|
||||
/obj/structure/stairs
|
||||
name = "Stairs"
|
||||
desc = "Stairs. You walk up and down them."
|
||||
icon_state = "rampbottom"
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
desc = "Stairs leading to another deck. Not too useful if the gravity goes out."
|
||||
icon = 'icons/obj/stairs.dmi'
|
||||
density = 0
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
|
||||
var/obj/structure/stairs/connected
|
||||
|
||||
New()
|
||||
..()
|
||||
var/turf/above = GetAbove(src)
|
||||
if(istype(above, /turf/space))
|
||||
above.ChangeTurf(/turf/simulated/open)
|
||||
. = ..()
|
||||
for(var/turf/turf in locs)
|
||||
var/turf/simulated/open/above = GetAbove(turf)
|
||||
if(!above)
|
||||
warning("Stair created without level above: ([loc.x], [loc.y], [loc.z])")
|
||||
return qdel(src)
|
||||
if(!istype(above))
|
||||
above.ChangeTurf(/turf/simulated/open)
|
||||
|
||||
initialize()
|
||||
var/updown = icon_state == "rampbottom" ? UP : DOWN
|
||||
|
||||
var/turf/T = get_step(src, dir | updown)
|
||||
connected = locate() in T
|
||||
ASSERT(connected)
|
||||
|
||||
Uncross(var/atom/movable/M)
|
||||
if(connected && M.dir == dir)
|
||||
M.loc = connected.loc
|
||||
Uncross(atom/movable/A)
|
||||
if(A.dir == dir)
|
||||
// This is hackish but whatever.
|
||||
var/turf/target = get_step(GetAbove(A), dir)
|
||||
var/turf/source = A.loc
|
||||
if(target.Enter(A, source))
|
||||
A.loc = target
|
||||
target.Entered(A, source)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
CanPass(obj/mover, turf/source, height, airflow)
|
||||
return airflow || !density
|
||||
return airflow || !density
|
||||
|
||||
// type paths to make mapping easier.
|
||||
north
|
||||
dir = NORTH
|
||||
bound_height = 64
|
||||
bound_y = -32
|
||||
pixel_y = -32
|
||||
|
||||
south
|
||||
dir = SOUTH
|
||||
bound_height = 64
|
||||
|
||||
east
|
||||
dir = EAST
|
||||
bound_width = 64
|
||||
bound_x = -32
|
||||
pixel_x = -32
|
||||
|
||||
west
|
||||
dir = WEST
|
||||
bound_width = 64
|
||||
@@ -29,7 +29,7 @@
|
||||
return
|
||||
|
||||
// Prevent pipes from falling into the void... if there is a pipe to support it.
|
||||
if(istype(mover, /obj/item/pipe) && \
|
||||
if(mover.anchored || istype(mover, /obj/item/pipe) && \
|
||||
(locate(/obj/structure/disposalpipe/up) in below) || \
|
||||
locate(/obj/machinery/atmospherics/pipe/zpipe/up in below))
|
||||
return
|
||||
@@ -54,9 +54,9 @@
|
||||
if(!soft)
|
||||
if(!istype(mover, /mob))
|
||||
if(istype(below, /turf/simulated/open))
|
||||
below.visible_message("\The [mover] falls from the deck above through \the [below]!", "You hear a whoosh of displaced air.")
|
||||
mover.visible_message("\The [mover] falls from the deck above through \the [below]!", "You hear a whoosh of displaced air.")
|
||||
else
|
||||
below.visible_message("\The [mover] falls from the deck above and slams into \the [below]!", "You hear something slam into the deck.")
|
||||
mover.visible_message("\The [mover] falls from the deck above and slams into \the [below]!", "You hear something slam into the deck.")
|
||||
else
|
||||
var/mob/M = mover
|
||||
if(istype(below, /turf/simulated/open))
|
||||
|
||||
Reference in New Issue
Block a user