Added handling for space travel/stragglers.

Now new empty space levels are created if needed.
Added config option to use overmap system, ticked files in.

Conflicts:
	code/setup.dm
This commit is contained in:
Chinsky
2014-07-15 16:01:04 +04:00
parent 68fc5d91c6
commit c7257c1bf2
7 changed files with 104 additions and 11 deletions

View File

@@ -5,7 +5,8 @@
var/global/list/map_sectors = list()
/hook/startup/proc/build_map()
accessable_z_levels = list() //no space travel with this system, at least not like this
if(!config.use_overmap)
return 1
testing("Building overmap...")
var/obj/effect/mapinfo/data
for(var/level in 1 to world.maxz)
@@ -93,3 +94,34 @@ var/global/list/map_sectors = list()
name = "generic sector"
desc = "Sector with some stuff in it."
anchored = 1
//Space stragglers go here
/obj/effect/map/sector/temporary
name = "Deep Space"
icon_state = ""
always_known = 0
/obj/effect/map/sector/temporary/New(var/nx, var/ny, var/nz)
loc = locate(nx, ny, OVERMAP_ZLEVEL)
map_z = nz
map_sectors["[map_z]"] = src
testing("Temporary sector at [x],[y] was created, corresponding zlevel is [map_z].")
/obj/effect/map/sector/temporary/Del()
map_sectors["[map_z]"] = null
testing("Temporary sector at [x],[y] was deleted.")
if (can_die())
testing("Associated zlevel disappeared.")
world.maxz--
/obj/effect/map/sector/temporary/proc/can_die(var/mob/observer)
testing("Checking if sector at [map_z] can die.")
if(src.map_z < world.maxz) //can't specify which zlevel to remove
testing("It is not last sector in the stack.")
return 0
for(var/mob/M in player_list)
if(M != observer && M.z == map_z)
testing("There are people on it.")
return 0
return 1