diff --git a/baystation12.dme b/baystation12.dme index 4851c962cb..b528c9cf2f 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1400,6 +1400,15 @@ #include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm" #include "code\WorkInProgress\Chinsky\ashtray.dm" #include "code\WorkInProgress\Chinsky\guestpass.dm" +#include "code\WorkInProgress\Chinsky\overmap\_defines.dm" +#include "code\WorkInProgress\Chinsky\overmap\README.dm" +#include "code\WorkInProgress\Chinsky\overmap\sectors.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\ship.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\computers\engine_control.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\computers\helm.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\computers\shuttle.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\engines\engine.dm" +#include "code\WorkInProgress\Chinsky\overmap\ships\engines\thermal.dm" #include "code\WorkInProgress\Cib\MedicalSideEffects.dm" #include "code\WorkInProgress\computer3\bios.dm" #include "code\WorkInProgress\computer3\buildandrepair.dm" diff --git a/code/WorkInProgress/Chinsky/overmap/README.dm b/code/WorkInProgress/Chinsky/overmap/README.dm index d11ea1fdee..14a7a955a5 100644 --- a/code/WorkInProgress/Chinsky/overmap/README.dm +++ b/code/WorkInProgress/Chinsky/overmap/README.dm @@ -88,12 +88,6 @@ Sector should appear on overmap (in random place if you didn't set mapx,mapy) TODO: -more mechanics to moving ship: - actually working engine objects - unary atmospheric machinery - give more thrust the more pressure gas has - ships have mass var, which is used to caalculate how much acceleration those engines give -better space travel / stragglers handling shuttle console: checking occupied pad or not with docking controllers ?landing pad size detection diff --git a/code/WorkInProgress/Chinsky/overmap/_defines.dm b/code/WorkInProgress/Chinsky/overmap/_defines.dm index dfc0881ed5..55326b8da1 100644 --- a/code/WorkInProgress/Chinsky/overmap/_defines.dm +++ b/code/WorkInProgress/Chinsky/overmap/_defines.dm @@ -32,4 +32,52 @@ proc/toggle_move_stars(zlevel, direction) T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]" for(var/atom/movable/AM in T) if (!AM.anchored) - AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) \ No newline at end of file + AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) + + +proc/overmap_spacetravel(var/turf/space/T, var/atom/movable/A) + var/obj/effect/map/M = map_sectors["[T.z]"] + if (!M) + return + var/mapx = M.x + var/mapy = M.y + var/nx = 1 + var/ny = 1 + var/nz = M.map_z + + if(T.x <= TRANSITIONEDGE) + nx = world.maxx - TRANSITIONEDGE - 2 + ny = rand(TRANSITIONEDGE + 2, world.maxy - TRANSITIONEDGE - 2) + mapx = max(1, mapx-1) + + else if (A.x >= (world.maxx - TRANSITIONEDGE - 1)) + nx = TRANSITIONEDGE + 2 + ny = rand(TRANSITIONEDGE + 2, world.maxy - TRANSITIONEDGE - 2) + mapx = min(world.maxx, mapx+1) + + else if (T.y <= TRANSITIONEDGE) + ny = world.maxy - TRANSITIONEDGE -2 + nx = rand(TRANSITIONEDGE + 2, world.maxx - TRANSITIONEDGE - 2) + mapy = max(1, mapy-1) + + else if (A.y >= (world.maxy - TRANSITIONEDGE - 1)) + ny = TRANSITIONEDGE + 2 + nx = rand(TRANSITIONEDGE + 2, world.maxx - TRANSITIONEDGE - 2) + mapy = min(world.maxy, mapy+1) + + testing("[A] moving from [M] ([M.x], [M.y]) to ([mapx],[mapy]).") + + var/turf/map = locate(mapx,mapy,OVERMAP_ZLEVEL) + var/obj/effect/map/TM = locate() in map + if(TM) + nz = TM.map_z + testing("Destination: [TM]") + else + world.maxz++ + nz = world.maxz + TM = new /obj/effect/map/sector/temporary(mapx, mapy, nz) + testing("Destination: *new* [TM]") + + var/turf/dest = locate(nx,ny,nz) + if(dest) + A.loc = dest \ No newline at end of file diff --git a/code/WorkInProgress/Chinsky/overmap/sectors.dm b/code/WorkInProgress/Chinsky/overmap/sectors.dm index 9e1635a960..410b418427 100644 --- a/code/WorkInProgress/Chinsky/overmap/sectors.dm +++ b/code/WorkInProgress/Chinsky/overmap/sectors.dm @@ -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 diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 66747abbb5..f85391b767 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -147,6 +147,7 @@ var/admin_irc = "" var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix var/use_lib_nudge = 0 //Use the C library nudge instead of the python nudge. + var/use_overmap = 0 /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode @@ -502,6 +503,9 @@ if("max_maint_drones") config.max_maint_drones = text2num(value) + if("use_overmap") + config.use_overmap = 1 + else log_misc("Unknown setting in configuration: '[name]'") diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index d99dc06677..87ee17b963 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -71,9 +71,10 @@ if(ticker && ticker.mode) + // Okay, so let's make it so that people can travel z levels but not nuke disks! // if(ticker.mode.name == "nuclear emergency") return - if(A.z > 6) return + if(A.z > 6 && !config.use_overmap) return if (A.x <= TRANSITIONEDGE || A.x >= (world.maxx - TRANSITIONEDGE - 1) || A.y <= TRANSITIONEDGE || A.y >= (world.maxy - TRANSITIONEDGE - 1)) if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust)) del(A) @@ -82,7 +83,9 @@ if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level. del(A) //The disk's Del() proc ensures a new one is created return - + if(config.use_overmap) + overmap_spacetravel(src,A) + return var/list/disk_search = A.search_contents_for(/obj/item/weapon/disk/nuclear) if(!isemptylist(disk_search)) if(istype(A, /mob/living)) diff --git a/config/example/config.txt b/config/example/config.txt index fa8613e21d..faeebb79bc 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -256,4 +256,7 @@ USEALIENWHITELIST ALLOW_CULT_GHOSTWRITER ## Sets the minimum number of cultists needed for ghosts to write in blood. -REQ_CULT_GHOSTWRITER 6 +REQ_CULT_GHOSTWRITER 6 + +## Uncomment to use overmap system for zlevel travel +#USE_OVERMAP