mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-04 14:33:58 +00:00
Add some helpers for mappers
This commit is contained in:
124
maps/submaps/_helpers.dm
Normal file
124
maps/submaps/_helpers.dm
Normal file
@@ -0,0 +1,124 @@
|
||||
//Acts like the map edge, can use this to divide up zlevels into 'fake' multiz areas.
|
||||
//Keep in mind that the entire zlevel 'moves' when the ship does, so don't try to make DIFFERENT ships share a zlevel.
|
||||
/turf/space/internal_edge
|
||||
icon_state = "arrow"
|
||||
opacity = 1
|
||||
blocks_air = TRUE
|
||||
|
||||
/turf/space/internal_edge/Initialize()
|
||||
. = ..()
|
||||
build_overedge(dir)
|
||||
|
||||
/turf/space/internal_edge/top
|
||||
dir = NORTH
|
||||
/turf/space/internal_edge/bottom
|
||||
dir = SOUTH
|
||||
/turf/space/internal_edge/left
|
||||
dir = WEST
|
||||
/turf/space/internal_edge/right
|
||||
dir = EAST
|
||||
/turf/space/internal_edge/topleft
|
||||
dir = NORTHWEST
|
||||
/turf/space/internal_edge/topright
|
||||
dir = NORTHEAST
|
||||
/turf/space/internal_edge/bottomleft
|
||||
dir = SOUTHWEST
|
||||
/turf/space/internal_edge/bottomright
|
||||
dir = SOUTHEAST
|
||||
|
||||
//These are fake stairs, that when you try to go up them, they shove you to
|
||||
// their 'connected' friend! Try to use the appropriate top/bottom ones for good looks.
|
||||
/obj/structure/fake_stairs
|
||||
name = "use a subtype! - stairs"
|
||||
icon = 'icons/obj/stairs.dmi'
|
||||
density = 1
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
plane = TURF_PLANE
|
||||
layer = ABOVE_TURF_LAYER
|
||||
appearance_flags = PIXEL_SCALE|KEEP_TOGETHER
|
||||
|
||||
var/_stair_tag //Make this match another one and they'll connect!
|
||||
|
||||
var/obj/structure/fake_stairs/target //Don't set this manually, let it do it!
|
||||
var/stepoff_dir
|
||||
|
||||
/obj/structure/fake_stairs/Initialize(var/mapload)
|
||||
. = ..()
|
||||
|
||||
for(var/obj/structure/fake_stairs/FS in world)
|
||||
if(FS == src)
|
||||
continue //hi
|
||||
if(FS._stair_tag == _stair_tag)
|
||||
target = FS
|
||||
if(!target && mapload)
|
||||
to_world("<span class='danger'>Fake stairs at [x],[y],[z] couldn't get a target!</span>")
|
||||
|
||||
/obj/structure/fake_stairs/Destroy()
|
||||
if(target)
|
||||
target.target = null
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/structure/fake_stairs/Bumped(var/atom/movable/AM)
|
||||
if(!target)
|
||||
return
|
||||
target.take(AM)
|
||||
|
||||
/obj/structure/fake_stairs/proc/take(var/atom/movable/AM)
|
||||
var/dir_to_use = stepoff_dir ? stepoff_dir : dir
|
||||
var/turf/T = get_step(src, dir_to_use)
|
||||
if(!T)
|
||||
log_debug("Fake stairs at [x],[y],[z] couldn't move someone to their destination.")
|
||||
return
|
||||
AM.forceMove(T)
|
||||
spawn AM.set_dir(dir_to_use)
|
||||
if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
if(L.pulling)
|
||||
L.pulling.forceMove(T)
|
||||
spawn L.pulling.set_dir(dir_to_use)
|
||||
|
||||
/obj/structure/fake_stairs/north/top
|
||||
name = "stairs"
|
||||
dir = NORTH
|
||||
color = "#B0B0B0"
|
||||
pixel_y = -32
|
||||
|
||||
/obj/structure/fake_stairs/north/bottom
|
||||
name = "stairs"
|
||||
dir = NORTH
|
||||
stepoff_dir = SOUTH
|
||||
pixel_y = -32
|
||||
|
||||
/obj/structure/fake_stairs/south/top
|
||||
name = "stairs"
|
||||
dir = SOUTH
|
||||
color = "#B0B0B0"
|
||||
|
||||
/obj/structure/fake_stairs/south/bottom
|
||||
name = "stairs"
|
||||
dir = SOUTH
|
||||
stepoff_dir = NORTH
|
||||
|
||||
/obj/structure/fake_stairs/east/top
|
||||
name = "stairs"
|
||||
dir = EAST
|
||||
color = "#B0B0B0"
|
||||
pixel_x = -32
|
||||
|
||||
/obj/structure/fake_stairs/east/bottom
|
||||
name = "stairs"
|
||||
dir = EAST
|
||||
stepoff_dir = WEST
|
||||
pixel_x = -32
|
||||
|
||||
/obj/structure/fake_stairs/west/top
|
||||
name = "stairs"
|
||||
dir = WEST
|
||||
color = "#B0B0B0"
|
||||
|
||||
/obj/structure/fake_stairs/west/bottom
|
||||
name = "stairs"
|
||||
dir = WEST
|
||||
stepoff_dir = EAST
|
||||
@@ -3513,6 +3513,7 @@
|
||||
#include "maps\southern_cross\loadout\loadout_uniform.dm"
|
||||
#include "maps\southern_cross\structures\closets\misc.dm"
|
||||
#include "maps\southern_cross\structures\closets\misc_vr.dm"
|
||||
#include "maps\submaps\_helpers.dm"
|
||||
#include "maps\submaps\_readme.dm"
|
||||
#include "maps\submaps\engine_submaps\engine.dm"
|
||||
#include "maps\submaps\engine_submaps\engine_areas.dm"
|
||||
|
||||
Reference in New Issue
Block a user