mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 04:57:57 +01:00
1X3 ICEBOX | Wilderness Expansion (Now not extremely slow!) (#91920)
## About The Pull Request Turns the surface z-level of icebox into a 1x3 area, effectively adding 2 wilderness new z-levels surrounding the station Because it's not always clear to other people what I'm talking about, this is what I mean with making the surface level a 3x3 z-level The wilderness z-levels are gridlinked, instead of crosslinked, which just means the connections are consistent and not randomized. If you keep going right, you will always end up where you started again, eventually. This also removes the black border around the surface icebox z-level (cause you can just go there now) **Wilderness levels** I've added some Z-level templates that can be generated. They're incredibly basic, but all can spawn runes on them as well. - Snow planes (5x) - Ice planes (1x) - Forest planes (1x) - Mountain planes (1x) I've also tweaked surface generation quite a bit. It being completely covered in bones always felt weird, and the intersparsed rocks and chasms never sat right with me. The default overworldgen is now more like the Forested trait, but with more sparse trees. All of this is modular btw. You can increase the amount of z-levels, make any space z-level be unrandomized gridlinked or add your own wilderness z-levels (either to your own map or icebox) ## Why It's Good For The Game Icebox exploration is kind of depressing. We have this unique setting, but we can't really go anywhere? You can go down and find that one pool, which is about the peak of exploration of icebox. Now you can literally explore the entire round and get incredibly lost! It's also a great opportunity for mappers! (Especially since the templates I made were made rather quickly as I wasn't sure if this had merit). 2 extra z-levels isn't a lot, but it'll let us further develop planetary wilderness z-levels further without impacting load times that much. Maybe 3x3 icebox can be real in the future, but for now 1x3 icebox will have to do
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
/turf/open/misc/asteroid/snow/icemoon,
|
||||
/area/icemoon/surface/outdoors/nospawn)
|
||||
"sF" = (
|
||||
/turf/open/openspace/icemoon/keep_below,
|
||||
/turf/open/lava/plasma/ice_moon,
|
||||
/area/icemoon/surface/outdoors/nospawn)
|
||||
"tD" = (
|
||||
/obj/structure/flora/rock/pile/icy/style_random,
|
||||
@@ -148,7 +148,7 @@
|
||||
},
|
||||
/area/ruin/powered/shuttle)
|
||||
"wN" = (
|
||||
/turf/open/openspace/icemoon/keep_below,
|
||||
/turf/open/lava/plasma/ice_moon,
|
||||
/area/ruin/powered/shuttle)
|
||||
"ym" = (
|
||||
/obj/structure/chair/wood{
|
||||
|
||||
+10
-1
@@ -5,6 +5,7 @@
|
||||
"map_file": "IceBoxStation.dmm",
|
||||
"space_ruin_levels": 0,
|
||||
"space_empty_levels": 0,
|
||||
"wilderness_levels": 2,
|
||||
"planetary": 1,
|
||||
"give_players_hooks": 1,
|
||||
"shuttles": {
|
||||
@@ -13,6 +14,14 @@
|
||||
"whiteship": "whiteship_box",
|
||||
"emergency": "emergency_box"
|
||||
},
|
||||
"wilderness": {
|
||||
"directory": "map_files/IceWilderness",
|
||||
"rocky_planes.dmm": 10,
|
||||
"snow_planes.dmm": 1,
|
||||
"ice_planes.dmm": 1,
|
||||
"mountain.dmm": 1,
|
||||
"forest.dmm": 3
|
||||
},
|
||||
"traits": [
|
||||
{
|
||||
"Mining": true,
|
||||
@@ -32,7 +41,7 @@
|
||||
},
|
||||
{
|
||||
"Mining": true,
|
||||
"Linkage": null,
|
||||
"Linkage": "Grid",
|
||||
"Gravity": true,
|
||||
"Ice Ruins": true,
|
||||
"Weather_Snowstorm": true,
|
||||
|
||||
+33771
-33593
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+10
-1
@@ -44,7 +44,7 @@ Always compile, always use that verb, and always make sure that it works for wha
|
||||
#define SPACERUIN_MAP_EDGE_PAD 15
|
||||
|
||||
/// Distance from edge to move to another z-level
|
||||
#define TRANSITIONEDGE 7
|
||||
#define TRANSITIONEDGE 8
|
||||
|
||||
// Maploader bounds indices
|
||||
/// The maploader index for the maps minimum x
|
||||
@@ -118,6 +118,8 @@ Always compile, always use that verb, and always make sure that it works for wha
|
||||
#define SELFLOOPING "Self"
|
||||
// CROSSLINKED - mixed in with the cross-linked space pool
|
||||
#define CROSSLINKED "Cross"
|
||||
// GRIDLINKED - connected in a consistent grid
|
||||
#define GRIDLINKED "Grid"
|
||||
|
||||
// string - type path of the z-level's baseturf (defaults to space)
|
||||
#define ZTRAIT_BASETURF "Baseturf"
|
||||
@@ -132,6 +134,13 @@ Always compile, always use that verb, and always make sure that it works for wha
|
||||
#define ZTRAITS_STATION list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_STATION = TRUE)
|
||||
///Z level traits for Deep Space
|
||||
#define ZTRAITS_SPACE list(ZTRAIT_LINKAGE = CROSSLINKED, ZTRAIT_SPACE_RUINS = TRUE)
|
||||
///Z level traits for
|
||||
#define ZTRAITS_WILDS list(\
|
||||
ZTRAIT_LINKAGE = GRIDLINKED, \
|
||||
ZTRAIT_ICE_RUINS = TRUE, \
|
||||
ZTRAIT_SNOWSTORM = FALSE, \
|
||||
ZTRAIT_BASETURF = /turf/open/misc/asteroid/snow/icemoon)
|
||||
|
||||
///Z level traits for Lavaland
|
||||
#define ZTRAITS_LAVALAND list(\
|
||||
ZTRAIT_MINING = TRUE, \
|
||||
|
||||
@@ -528,6 +528,18 @@
|
||||
result = pick_weight(fill_with_ones(result))
|
||||
return result
|
||||
|
||||
/**
|
||||
* Like pick_weight, but decreases the value of the picked element by 1
|
||||
* For example, given the following list:
|
||||
* A = 6, B = 3, C = 1, D = 0
|
||||
* A would have a 60% chance of being picked, after which it would decrease by one and the new list would be
|
||||
* A = 5, B = 3, C = 1, D = 0
|
||||
* Tt would then have a 55.55...% to be picked, rinse and repeat
|
||||
*/
|
||||
/proc/pick_weight_take(list/list_to_pick)
|
||||
. = pick_weight(list_to_pick)
|
||||
list_to_pick[.]--
|
||||
|
||||
/**
|
||||
* Given a list, return a copy where values without defined weights are given weight 1.
|
||||
* For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1)
|
||||
|
||||
@@ -132,11 +132,20 @@ SUBSYSTEM_DEF(mapping)
|
||||
while (space_levels_so_far < current_map.space_ruin_levels)
|
||||
add_new_zlevel("Ruin Area [space_levels_so_far+1]", ZTRAITS_SPACE)
|
||||
++space_levels_so_far
|
||||
|
||||
// Create empty space levels
|
||||
while (space_levels_so_far < current_map.space_empty_levels + current_map.space_ruin_levels)
|
||||
empty_space = add_new_zlevel("Empty Area [space_levels_so_far+1]", list(ZTRAIT_LINKAGE = CROSSLINKED))
|
||||
++space_levels_so_far
|
||||
|
||||
if(current_map.wilderness_levels)
|
||||
var/list/FailedZs = list()
|
||||
|
||||
LoadGroup(FailedZs, "Wilderness Area", current_map.wilderness_directory, current_map.maps_to_spawn, default_traits = ZTRAITS_WILDS, height_autosetup = FALSE)
|
||||
|
||||
if(LAZYLEN(FailedZs))
|
||||
CRASH("Ice wilds failed to load!")
|
||||
|
||||
// Pick a random away mission.
|
||||
if(CONFIG_GET(flag/roundstart_away))
|
||||
createRandomZlevel(prob(CONFIG_GET(number/config_gateway_chance)))
|
||||
@@ -237,7 +246,6 @@ SUBSYSTEM_DEF(mapping)
|
||||
gravity_by_z_level[z_level_number] = max_gravity
|
||||
return max_gravity
|
||||
|
||||
|
||||
/**
|
||||
* ##setup_ruins
|
||||
*
|
||||
@@ -275,8 +283,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
|
||||
var/list/ice_ruins = levels_by_trait(ZTRAIT_ICE_RUINS)
|
||||
for (var/ice_z in ice_ruins)
|
||||
var/river_type = HAS_TRAIT(SSstation, STATION_TRAIT_FORESTED) ? /turf/open/lava/plasma/ice_moon : /turf/open/openspace/icemoon
|
||||
spawn_rivers(ice_z, 4, river_type, /area/icemoon/surface/outdoors/unexplored/rivers)
|
||||
spawn_rivers(ice_z, 6, /turf/open/lava/plasma/ice_moon, /area/icemoon/surface/outdoors/unexplored/rivers)
|
||||
|
||||
var/list/ice_ruins_underground = levels_by_trait(ZTRAIT_ICE_RUINS_UNDERGROUND)
|
||||
for (var/ice_z in ice_ruins_underground)
|
||||
|
||||
@@ -40,3 +40,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/mirage_holder)
|
||||
/atom/movable/mirage_holder
|
||||
name = "Mirage holder"
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
|
||||
/// If we, hypothetically, spawned on a turf that calls init (so non-space tiles), we would be transported to the other Z, which would be very bad
|
||||
/atom/movable/mirage_holder/forceMove(atom/destination)
|
||||
return FALSE
|
||||
|
||||
@@ -27,8 +27,15 @@
|
||||
var/traits = null
|
||||
var/space_ruin_levels = DEFAULT_SPACE_RUIN_LEVELS
|
||||
var/space_empty_levels = DEFAULT_SPACE_EMPTY_LEVELS
|
||||
|
||||
/// Boolean that tells us if this is a planetary station. (like IceBoxStation)
|
||||
var/planetary = FALSE
|
||||
/// How many z's to generate around a planetary station
|
||||
var/wilderness_levels = 0
|
||||
/// Directory to the wilderness area we can spawn in
|
||||
var/wilderness_directory
|
||||
/// Index of map names (inside wilderness_directory) with the amount to spawn. ("ice_planes" = 1) for one ice spawn
|
||||
var/list/maps_to_spawn = list()
|
||||
|
||||
///The type of mining Z-level that should be loaded.
|
||||
var/minetype = MINETYPE_LAVALAND
|
||||
@@ -194,6 +201,13 @@
|
||||
log_world("map_config space_empty_levels is not a number!")
|
||||
return
|
||||
|
||||
temp = json["wilderness_levels"]
|
||||
if (isnum(temp))
|
||||
wilderness_levels = temp
|
||||
else if (!isnull(temp))
|
||||
log_world("map_config wilderness_levels is not a number!")
|
||||
return
|
||||
|
||||
if ("minetype" in json)
|
||||
minetype = json["minetype"]
|
||||
|
||||
@@ -231,6 +245,17 @@
|
||||
if ("height_autosetup" in json)
|
||||
height_autosetup = json["height_autosetup"]
|
||||
|
||||
var/list/wilderness = json["wilderness"]
|
||||
// If we got wilderness levels, fetch them from the config
|
||||
if (islist(wilderness))
|
||||
wilderness_directory = wilderness["directory"]
|
||||
wilderness.Remove("directory")
|
||||
|
||||
// Just pick and take based on weight
|
||||
for(var/i in 1 to wilderness_levels)
|
||||
maps_to_spawn += pick_weight_take(wilderness)
|
||||
shuffle(maps_to_spawn)
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
// Check for unit tests to skip, no reason to check these if we're not running tests
|
||||
for(var/path_as_text in json["ignored_unit_tests"])
|
||||
|
||||
@@ -35,12 +35,15 @@
|
||||
)
|
||||
|
||||
/datum/map_generator/cave_generator/icemoon/surface
|
||||
flora_spawn_chance = 4
|
||||
weighted_open_turf_types = list(/turf/open/misc/asteroid/snow/icemoon = 1)
|
||||
flora_spawn_chance = 60
|
||||
weighted_mob_spawn_list = null
|
||||
initial_closed_chance = 53
|
||||
initial_closed_chance = 0
|
||||
birth_limit = 5
|
||||
death_limit = 4
|
||||
smoothing_iterations = 10
|
||||
|
||||
feature_spawn_chance = 0.15
|
||||
weighted_feature_spawn_list = list(
|
||||
/obj/structure/geyser/hollowwater = 10,
|
||||
/obj/structure/geyser/plasma_oxide = 10,
|
||||
@@ -49,9 +52,14 @@
|
||||
/obj/structure/geyser/wittel = 10,
|
||||
)
|
||||
|
||||
weighted_flora_spawn_list = list(
|
||||
/obj/structure/flora/ash/chilly = 2,
|
||||
/obj/structure/flora/grass/both/style_random = 20,
|
||||
/obj/structure/flora/tree/pine/style_random = 2,
|
||||
)
|
||||
|
||||
/// Surface snow generator variant for forested station trait, WITH FORESTSSSS
|
||||
/datum/map_generator/cave_generator/icemoon/surface/forested
|
||||
weighted_open_turf_types = list(/turf/open/misc/asteroid/snow/icemoon = 1)
|
||||
initial_closed_chance = 10
|
||||
|
||||
flora_spawn_chance = 80
|
||||
@@ -69,6 +77,10 @@
|
||||
mob_spawn_chance = 0.2
|
||||
weighted_mob_spawn_list = list(/mob/living/basic/deer/ice = 99, /mob/living/basic/tree = 1, /obj/effect/spawner/random/lavaland_mob/raptor = 15)
|
||||
|
||||
/datum/map_generator/cave_generator/icemoon/surface/rocky
|
||||
initial_closed_chance = 53
|
||||
mob_spawn_chance = 0.5
|
||||
|
||||
/datum/map_generator/cave_generator/icemoon/surface/noruins //use this for when you don't want ruins to spawn in a certain area
|
||||
|
||||
/datum/map_generator/cave_generator/icemoon/deep
|
||||
|
||||
@@ -217,8 +217,10 @@
|
||||
/// this is the area you use for stuff to not spawn, but if you still want weather.
|
||||
/area/icemoon/surface/outdoors/nospawn
|
||||
|
||||
// unless you roll forested trait lol (fuck you time green)
|
||||
/area/icemoon/surface/outdoors/nospawn/New()
|
||||
/area/icemoon/surface/outdoors/less_spawns
|
||||
icon_state = "less_spawns"
|
||||
|
||||
/area/icemoon/surface/outdoors/less_spawns/New()
|
||||
. = ..()
|
||||
// this area SOMETIMES does map generation. Often it doesn't at all
|
||||
// so it SHOULD NOT be used with the genturf turf type, as it is not always replaced
|
||||
@@ -227,6 +229,16 @@
|
||||
// flip this on, the generator has already disabled dangerous fauna
|
||||
area_flags = MOB_SPAWN_ALLOWED | FLORA_ALLOWED
|
||||
|
||||
/area/icemoon/surface/outdoors/always_forested
|
||||
icon_state = "forest"
|
||||
map_generator = /datum/map_generator/cave_generator/icemoon/surface/forested
|
||||
area_flags = MOB_SPAWN_ALLOWED | FLORA_ALLOWED | CAVES_ALLOWED
|
||||
|
||||
/area/icemoon/surface/outdoors/rocky
|
||||
icon_state = "rocky"
|
||||
map_generator = /datum/map_generator/cave_generator/icemoon/surface/rocky
|
||||
area_flags = MOB_SPAWN_ALLOWED | FLORA_ALLOWED | CAVES_ALLOWED
|
||||
|
||||
/area/icemoon/surface/outdoors/noteleport // for places like the cursed spring water
|
||||
area_flags = UNIQUE_AREA | FLORA_ALLOWED | NOTELEPORT
|
||||
|
||||
|
||||
@@ -236,6 +236,11 @@
|
||||
* * [mob][user]- the user building this structure
|
||||
*/
|
||||
/obj/item/construction/rcd/proc/rcd_create(atom/target, mob/user)
|
||||
if(isopenturf(target))
|
||||
var/turf/open/open = target
|
||||
if(!open.CanBuildHere())
|
||||
return NONE
|
||||
|
||||
var/list/rcd_results = target.rcd_vals(user, src) // does this atom allow for rcd actions?
|
||||
if(!rcd_results) // nope
|
||||
return NONE
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
/// Are burnt overlays smoothed? if they are we have to change a little bit about how we render them
|
||||
var/smooth_burnt = FALSE
|
||||
|
||||
/// Custom destination for mirages
|
||||
var/destination_z
|
||||
/// Custom destination for mirages
|
||||
var/destination_x
|
||||
/// Custom destination for mirages
|
||||
var/destination_y
|
||||
|
||||
/// Returns a list of every turf state considered "broken".
|
||||
/// Will be randomly chosen if a turf breaks at runtime.
|
||||
@@ -107,6 +113,55 @@
|
||||
. = ..()
|
||||
update_visuals()
|
||||
|
||||
//ATTACK GHOST IGNORING PARENT RETURN VALUE
|
||||
/turf/open/attack_ghost(mob/dead/observer/user)
|
||||
. = ..()
|
||||
if(destination_z)
|
||||
var/turf/T = locate(destination_x, destination_y, destination_z)
|
||||
user.forceMove(T)
|
||||
|
||||
/turf/open/proc/CanBuildHere()
|
||||
if(destination_z)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/turf/open/is_transition_turf()
|
||||
if(destination_x || destination_y || destination_z)
|
||||
return TRUE
|
||||
|
||||
/turf/open/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
|
||||
. = ..()
|
||||
if(!arrived || src != arrived.loc)
|
||||
return
|
||||
|
||||
if(!destination_z || !destination_x || !destination_y || arrived.pulledby || arrived.currently_z_moving)
|
||||
return
|
||||
|
||||
var/tx = destination_x
|
||||
var/ty = destination_y
|
||||
var/turf/DT = locate(tx, ty, destination_z)
|
||||
var/itercount = 0
|
||||
while(DT.density || istype(DT.loc,/area/shuttle)) // Extend towards the center of the map, trying to look for a better place to arrive
|
||||
if (itercount++ >= 100)
|
||||
log_game("SPACE Z-TRANSIT ERROR: Could not find a safe place to land [arrived] within 100 iterations.")
|
||||
break
|
||||
if (tx < 128)
|
||||
tx++
|
||||
else
|
||||
tx--
|
||||
if (ty < 128)
|
||||
ty++
|
||||
else
|
||||
ty--
|
||||
DT = locate(tx, ty, destination_z)
|
||||
|
||||
arrived.zMove(null, DT, ZMOVE_ALLOW_BUCKLED)
|
||||
|
||||
var/atom/movable/current_pull = arrived.pulling
|
||||
while (current_pull)
|
||||
var/turf/target_turf = get_step(current_pull.pulledby.loc, REVERSE_DIR(current_pull.pulledby.dir)) || current_pull.pulledby.loc
|
||||
current_pull.zMove(null, target_turf, ZMOVE_ALLOW_BUCKLED)
|
||||
current_pull = current_pull.pulling
|
||||
/**
|
||||
* Replace an open turf with another open turf while avoiding the pitfall of replacing plating with a floor tile, leaving a hole underneath.
|
||||
* This replaces the current turf if it is plating and is passed plating, is tile and is passed tile.
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
/turf/open/openspace/proc/CanCoverUp()
|
||||
return can_cover_up
|
||||
|
||||
/turf/open/openspace/proc/CanBuildHere()
|
||||
/turf/open/openspace/CanBuildHere()
|
||||
return can_build_on
|
||||
|
||||
/turf/open/openspace/attackby(obj/item/attacking_item, mob/user, list/modifiers)
|
||||
@@ -132,9 +132,6 @@
|
||||
return ..()
|
||||
|
||||
/turf/open/openspace/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
if(!CanBuildHere())
|
||||
return FALSE
|
||||
|
||||
if(the_rcd.mode == RCD_TURF && the_rcd.rcd_design_path == /turf/open/floor/plating/rcd)
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
|
||||
@@ -54,10 +54,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
|
||||
heat_capacity = 700000
|
||||
|
||||
var/destination_z
|
||||
var/destination_x
|
||||
var/destination_y
|
||||
|
||||
var/static/datum/gas_mixture/immutable/space/space_gas = new
|
||||
// We do NOT want atmos adjacent turfs
|
||||
init_air = FALSE
|
||||
@@ -87,12 +83,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
GLOB.starlight -= src
|
||||
return ..()
|
||||
|
||||
//ATTACK GHOST IGNORING PARENT RETURN VALUE
|
||||
/turf/open/space/attack_ghost(mob/dead/observer/user)
|
||||
if(destination_z)
|
||||
var/turf/T = locate(destination_x, destination_y, destination_z)
|
||||
user.forceMove(T)
|
||||
|
||||
/turf/open/space/TakeTemperature(temp)
|
||||
|
||||
/turf/open/space/RemoveLattice()
|
||||
@@ -132,11 +122,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
/turf/open/space/attack_paw(mob/user, list/modifiers)
|
||||
return attack_hand(user, modifiers)
|
||||
|
||||
/turf/open/space/proc/CanBuildHere()
|
||||
if(destination_z)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/turf/open/space/handle_slip()
|
||||
return
|
||||
|
||||
@@ -149,40 +134,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
else if(ismetaltile(attacking_item))
|
||||
build_with_floor_tiles(attacking_item, user)
|
||||
|
||||
|
||||
/turf/open/space/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
|
||||
. = ..()
|
||||
if(!arrived || src != arrived.loc)
|
||||
return
|
||||
|
||||
if(destination_z && destination_x && destination_y && !arrived.pulledby && !arrived.currently_z_moving)
|
||||
var/tx = destination_x
|
||||
var/ty = destination_y
|
||||
var/turf/DT = locate(tx, ty, destination_z)
|
||||
var/itercount = 0
|
||||
while(DT.density || istype(DT.loc,/area/shuttle)) // Extend towards the center of the map, trying to look for a better place to arrive
|
||||
if (itercount++ >= 100)
|
||||
log_game("SPACE Z-TRANSIT ERROR: Could not find a safe place to land [arrived] within 100 iterations.")
|
||||
break
|
||||
if (tx < 128)
|
||||
tx++
|
||||
else
|
||||
tx--
|
||||
if (ty < 128)
|
||||
ty++
|
||||
else
|
||||
ty--
|
||||
DT = locate(tx, ty, destination_z)
|
||||
|
||||
arrived.zMove(null, DT, ZMOVE_ALLOW_BUCKLED)
|
||||
|
||||
var/atom/movable/current_pull = arrived.pulling
|
||||
while (current_pull)
|
||||
var/turf/target_turf = get_step(current_pull.pulledby.loc, REVERSE_DIR(current_pull.pulledby.dir)) || current_pull.pulledby.loc
|
||||
current_pull.zMove(null, target_turf, ZMOVE_ALLOW_BUCKLED)
|
||||
current_pull = current_pull.pulling
|
||||
|
||||
|
||||
/turf/open/space/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent)
|
||||
return
|
||||
|
||||
@@ -194,11 +145,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/turf/open/space/is_transition_turf()
|
||||
if(destination_x || destination_y || destination_z)
|
||||
return TRUE
|
||||
|
||||
|
||||
/turf/open/space/acid_act(acidpwr, acid_volume)
|
||||
return FALSE
|
||||
|
||||
@@ -208,9 +154,6 @@ GLOBAL_LIST_EMPTY(starlight)
|
||||
|
||||
|
||||
/turf/open/space/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
|
||||
if(!CanBuildHere())
|
||||
return FALSE
|
||||
|
||||
if(the_rcd.mode == RCD_TURF)
|
||||
if(the_rcd.rcd_design_path == /turf/open/floor/plating/rcd)
|
||||
var/obj/structure/lattice/lattice = locate(/obj/structure/lattice, src)
|
||||
|
||||
@@ -18,5 +18,4 @@
|
||||
else // in case a single trait is passed in
|
||||
SSmapping.z_trait_levels[new_traits] += list(new_z)
|
||||
|
||||
|
||||
set_linkage(new_traits[ZTRAIT_LINKAGE])
|
||||
|
||||
@@ -60,39 +60,23 @@
|
||||
/datum/controller/subsystem/mapping/proc/setup_map_transitions() //listamania
|
||||
var/list/transition_levels = list()
|
||||
var/list/cached_z_list = z_list
|
||||
var/linkage
|
||||
for(var/datum/space_level/level as anything in cached_z_list)
|
||||
if (level.linkage == CROSSLINKED)
|
||||
transition_levels.Add(level)
|
||||
if(level.linkage != CROSSLINKED && level.linkage != GRIDLINKED)
|
||||
continue
|
||||
|
||||
var/grid_diameter = (length(transition_levels) * 2) + 1
|
||||
var/list/grid = new /list(grid_diameter ** 2)
|
||||
transition_levels.Add(level)
|
||||
|
||||
var/datum/space_transition_point/point
|
||||
for(var/x in 1 to grid_diameter)
|
||||
for(var/y in 1 to grid_diameter)
|
||||
point = new/datum/space_transition_point(x, y, grid)
|
||||
grid[CHORDS_TO_1D(x, y, grid_diameter)] = point
|
||||
for(point as anything in grid)
|
||||
point.set_neigbours(grid, grid_diameter)
|
||||
if(!isnull(linkage) && level.linkage != linkage)
|
||||
// Either you be gridlinked or crosslinked, both is uhhh... a headache
|
||||
stack_trace("Mixed linkages detected in z-level neighbour transitions!")
|
||||
continue
|
||||
linkage = level.linkage
|
||||
|
||||
var/center = round(grid_diameter / 2)
|
||||
point = grid[CHORDS_TO_1D(grid_diameter, center, center)]
|
||||
grid.Cut()
|
||||
|
||||
var/list/transition_pick = transition_levels.Copy()
|
||||
var/list/possible_points = list()
|
||||
var/list/used_points = list()
|
||||
while(transition_pick.len)
|
||||
var/datum/space_level/level = pick_n_take(transition_pick)
|
||||
level.xi = point.x
|
||||
level.yi = point.y
|
||||
point.spl = level
|
||||
possible_points |= point.neigbours
|
||||
used_points |= point
|
||||
possible_points.Remove(used_points)
|
||||
level.set_neigbours(used_points)
|
||||
point = pick(possible_points)
|
||||
CHECK_TICK
|
||||
if(linkage == CROSSLINKED)
|
||||
set_cross_linkages(transition_levels)
|
||||
else if(linkage == GRIDLINKED)
|
||||
set_grid_linkages(transition_levels)
|
||||
|
||||
// Now that we've handed out neighbors, we're gonna handle an edge case
|
||||
// Need to check if all our levels have neighbors in all directions
|
||||
@@ -141,7 +125,7 @@
|
||||
var/datum/space_level/neighbor = level.neigbours["[dirside]"]
|
||||
var/zdestination = neighbor.z_value
|
||||
|
||||
for(var/turf/open/space/S in turfblock)
|
||||
for(var/turf/open/S in turfblock)
|
||||
S.destination_x = x_target || S.x
|
||||
S.destination_y = y_target || S.y
|
||||
S.destination_z = zdestination
|
||||
@@ -162,4 +146,60 @@
|
||||
var/turf/place = locate(S.destination_x, S.destination_y, zdestination)
|
||||
S.AddElement(/datum/element/mirage_border, place, mirage_dir, range_cached)
|
||||
|
||||
/// Construct linkages randomly to get maze-like space transitions
|
||||
/// We do this by constructing a very large grid, and placing the levels randomly inside, and then filling out the empty spaces
|
||||
/datum/controller/subsystem/mapping/proc/set_cross_linkages(list/transition_levels)
|
||||
var/grid_diameter = (length(transition_levels) * 2) + 1
|
||||
var/list/grid = new /list(grid_diameter ** 2)
|
||||
|
||||
var/datum/space_transition_point/point
|
||||
for(var/x in 1 to grid_diameter)
|
||||
for(var/y in 1 to grid_diameter)
|
||||
point = new /datum/space_transition_point(x, y, grid)
|
||||
grid[CHORDS_TO_1D(x, y, grid_diameter)] = point
|
||||
for(point as anything in grid)
|
||||
point.set_neigbours(grid, grid_diameter)
|
||||
|
||||
var/center = round(grid_diameter / 2)
|
||||
point = grid[CHORDS_TO_1D(grid_diameter, center, center)]
|
||||
grid.Cut()
|
||||
|
||||
var/list/transition_pick = transition_levels.Copy()
|
||||
var/list/possible_points = list()
|
||||
var/list/used_points = list()
|
||||
|
||||
while(transition_pick.len)
|
||||
var/datum/space_level/level = pick_n_take(transition_pick)
|
||||
level.xi = point.x
|
||||
level.yi = point.y
|
||||
point.spl = level
|
||||
possible_points |= point.neigbours
|
||||
used_points |= point
|
||||
possible_points.Remove(used_points)
|
||||
level.set_neigbours(used_points)
|
||||
point = pick(possible_points)
|
||||
CHECK_TICK
|
||||
|
||||
/// Connect the z-levels in a non-randomized grid
|
||||
/datum/controller/subsystem/mapping/proc/set_grid_linkages(list/transition_levels)
|
||||
var/grid_diameter = ceil(sqrt(length(transition_levels)))
|
||||
var/list/grid = new /list(grid_diameter ** 2)
|
||||
|
||||
// Construct an imaginary grid with the right neighbours etc for our grid
|
||||
var/datum/space_transition_point/point
|
||||
for(var/x in 1 to grid_diameter)
|
||||
for(var/y in 1 to grid_diameter)
|
||||
point = new /datum/space_transition_point(x, y, grid)
|
||||
grid[CHORDS_TO_1D(x, y, grid_diameter)] = point
|
||||
|
||||
// Translate the grid we made to the z-levels
|
||||
var/list/used_points = list()
|
||||
for(var/i in 1 to transition_levels.len)
|
||||
var/datum/space_level/level = transition_levels[i]
|
||||
point = grid[i]
|
||||
level.xi = point.x
|
||||
level.yi = point.y
|
||||
point.spl = level
|
||||
used_points += point //this used_points list is kinda lame, you can remove it if you can find out what the slice function in byond is
|
||||
level.set_neigbours(used_points)
|
||||
#undef CHORDS_TO_1D
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 47 KiB |
Reference in New Issue
Block a user