rename some mapping-related files (#29422)

This commit is contained in:
warriorstar-orion
2025-05-25 16:45:52 +00:00
committed by GitHub
parent 45e07189b3
commit 43fe113250
9 changed files with 30 additions and 28 deletions
+41
View File
@@ -0,0 +1,41 @@
/datum/map/boxstation
fluff_name = "NSS Cyberiad"
technical_name = "BoxStation"
map_path = "_maps/map_files/stations/boxstation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/cyberiad/"
welcome_sound = 'sound/AI/welcome_cyberiad.ogg'
/datum/map/metastation
fluff_name = "NSS Cerebron"
technical_name = "MetaStation"
map_path = "_maps/map_files/stations/metastation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/metastation/"
welcome_sound = 'sound/AI/welcome_cerebron.ogg'
/datum/map/deltastation
fluff_name = "NSS Kerberos"
technical_name = "DeltaStation"
map_path = "_maps/map_files/stations/deltastation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/deltastation/"
welcome_sound = 'sound/AI/welcome_kerberos.ogg'
/datum/map/cerestation
fluff_name = "NSS Farragus"
technical_name = "CereStation"
map_path = "_maps/map_files/stations/cerestation.dmm"
webmap_url = "https://webmap.affectedarc07.co.uk/maps/paradise/cerestation/"
min_players_random = 60
welcome_sound = 'sound/AI/welcome_farragus.ogg'
/datum/map/emeraldstation
fluff_name = "NSS Diagoras"
technical_name = "EmeraldStation"
map_path = "_maps/map_files/stations/emeraldstation.dmm"
webmap_url = "https://affectedarc07.co.uk/emerald.html"
welcome_sound = 'sound/AI/welcome_diagoras.ogg'
/datum/map/test_tiny
fluff_name = "test_tiny"
technical_name = "test_tiny"
map_path = "_maps/map_files/test_tiny/test_tiny.dmm"
voteable = FALSE
@@ -267,3 +267,25 @@
Sadly, in their mass production rush, they lack a RTG power source and rely on pacmans, with many of the pods being shipped with the wrong fuel inside."
allow_duplicates = FALSE // Less space on lavaland. Ideally we would figure out a way to ban this from spawning the same level as the mining base
always_place = TRUE // Since only one can spawn for now, might as well ensure it.
// MARK: Bridges
/datum/map_template/ruin/lavaland/zlvl_bridge
prefix = "_maps/map_files/RandomRuins/LavaRuins/zlvl_bridges/"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
name = "Vertical Bridge One"
suffix = "lavaland_zlvl_bridge_vertical_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
name = "Horizontal Bridge One"
suffix = "lavaland_zlvl_bridge_horizontal_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
+165
View File
@@ -0,0 +1,165 @@
/// Approximate lower bound of the walkable land area on Lavaland, north of the southern lava border.
#define LAVALAND_MIN_CAVE_Y 10
/// Approximate upper bound of the walkable land area on Lavaland, south of the Legion entrance.
#define LAVALAND_MAX_CAVE_Y 222
/// Effective probability modifier for spawning flora and fauna in oases.
#define OASIS_SPAWNER_PROB_MODIFIER 43
GLOBAL_LIST_INIT(caves_default_flora_spawns, list(
/obj/structure/flora/ash/cacti = 1,
/obj/structure/flora/ash/cap_shroom = 2,
/obj/structure/flora/ash/leaf_shroom = 2,
/obj/structure/flora/ash/rock/style_random = 1,
/obj/structure/flora/ash/stem_shroom = 2,
/obj/structure/flora/ash/tall_shroom = 2,
))
/proc/lavaland_caves_spawn_flora(turf/T)
var/flora_spawn = pickweight(GLOB.caves_default_flora_spawns)
for(var/obj/structure/flora/ash/F in range(4, T)) //Allows for growing patches, but not ridiculous stacks of flora
if(!istype(F, flora_spawn))
return
new flora_spawn(T)
/datum/caves_theme
var/name = "Not Specified"
var/seed
var/perlin_accuracy = 5
var/perlin_stamp_size = 10
var/perlin_lower_range = 0
var/perlin_upper_range = 0.3
var/fauna_scan_range = 12
var/megafauna_scan_range = 16
/datum/caves_theme/New()
seed = rand(1, 999999)
/datum/caves_theme/proc/setup()
var/result = rustlibs_dbp_generate("[seed]", "[perlin_accuracy]", "[perlin_stamp_size]", "[world.maxx]", "[perlin_lower_range]", "[perlin_upper_range]")
for(var/zlvl in levels_by_trait(ORE_LEVEL))
for(var/turf/T in block(1, 1, zlvl, world.maxx, world.maxy, zlvl))
if(!istype(get_area(T), /area/lavaland/surface/outdoors/unexplored))
continue
if(!istype(T, /turf/simulated/mineral))
continue
var/c = result[world.maxx * (T.y - 1) + T.x]
if(c == "1")
T.ChangeTurf(/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface)
on_change(T)
CHECK_TICK
/datum/caves_theme/proc/on_change(turf/T)
if(prob(2))
lavaland_caves_spawn_flora(T)
else if(prob(1))
new /obj/effect/spawner/random/lavaland_fauna(T)
/datum/caves_theme/proc/safe_replace(turf/T)
if(T.flags & NO_LAVA_GEN)
return FALSE
if(istype(T, /turf/template_noop))
return TRUE
if(!istype(get_area(T), /area/lavaland/surface/outdoors/unexplored))
return FALSE
if(istype(T, /turf/simulated/floor/chasm))
return FALSE
if(istype(T, /turf/simulated/floor/lava/lava_land_surface))
return FALSE
if(istype(T, /turf/simulated/floor/lava/mapping_lava))
return FALSE
return TRUE
/datum/caves_theme/classic
name = "Classic Caves"
/datum/caves_theme/burrows
name = "Blocked Burrows"
perlin_accuracy = 90
perlin_stamp_size = 7
perlin_lower_range = 0
perlin_upper_range = 0.3
/datum/caves_theme/burrows/on_change(turf/T)
if(prob(7))
new /obj/structure/flora/ash/rock/style_random(T)
else if(prob(5))
lavaland_caves_spawn_flora(T)
else if(prob(1))
new /obj/effect/spawner/random/lavaland_fauna(T)
/datum/caves_theme/deeprock/New()
. = ..()
fauna_scan_range = rand(4, 7)
megafauna_scan_range = rand(8, 16)
/datum/caves_theme/deeprock/proc/maybe_make_room(turf/T)
if(rand(1, 150) != 1)
return
for(var/turf/oasis_centroid in oasis_centroids)
if(get_dist(T, oasis_centroid) < oasis_padding)
return
oasis_centroids |= T
var/tempradius = rand(10, 15)
var/probmodifer = OASIS_SPAWNER_PROB_MODIFIER * tempradius
var/list/oasis_turfs = list()
for(var/turf/NT in circlerangeturfs(T, tempradius))
var/distance = (max(get_dist(T, NT), 1)) //Get dist throws -1 if same turf
if(safe_replace(NT) && prob(min(probmodifer / distance, 100)))
var/turf/changed = NT.ChangeTurf(/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface)
if(prob(5))
new /obj/effect/spawner/random/lavaland_fauna(changed)
else if(prob(10))
lavaland_caves_spawn_flora(changed)
oasis_turfs |= changed
if(prob(50))
tempradius = round(tempradius / 3)
var/oasis_laketype = pickweight(lake_weights)
if(oasis_laketype == /turf/simulated/floor/plating/asteroid)
new /obj/effect/spawner/oasisrock(T, tempradius)
for(var/turf/oasis in circlerangeturfs(T, tempradius))
if(safe_replace(oasis))
oasis.ChangeTurf(oasis_laketype)
oasis_turfs -= oasis
// Move tendrils out of the oasis
for(var/obj/effect/spawner/random/pool/tendril_spawner/O in circlerange(T, tempradius))
O.forceMove(pick_n_take(oasis_turfs))
return T
/datum/caves_theme/deeprock
name = "Deadly Deeprock"
perlin_stamp_size = 12
perlin_lower_range = 0
perlin_upper_range = 0.2
var/oasis_padding = 50
var/list/oasis_centroids = list()
var/lake_weights = list(
/turf/simulated/floor/lava/lava_land_surface = 4,
/turf/simulated/floor/lava/lava_land_surface/plasma = 4,
/turf/simulated/floor/chasm/straight_down/lava_land_surface = 4,
/turf/simulated/floor/lava/mapping_lava = 6,
/turf/simulated/floor/beach/away/water/lavaland_air = 1,
/turf/simulated/floor/plating/asteroid = 1
)
/datum/caves_theme/deeprock/on_change(turf/T)
maybe_make_room(T)
if(prob(3))
lavaland_caves_spawn_flora(T)
else if(prob(2))
new /obj/effect/spawner/random/lavaland_fauna(T)
#undef OASIS_SPAWNER_PROB_MODIFIER
#undef LAVALAND_MIN_CAVE_Y
#undef LAVALAND_MAX_CAVE_Y
@@ -0,0 +1,123 @@
/datum/lavaland_theme
/// Name of lavaland theme
var/name = "Not Specified"
/// Typepath of turf the `/turf/simulated/floor/lava/mapping_lava` will be changed to on Late Initialization
var/turf/simulated/floor/primary_turf_type
/// Icon state of planet present on background of station Z-level
var/planet_icon_state
var/list/built_bridges
/// Icon for glass floors
var/primary_turf_type_icon
/datum/lavaland_theme/New()
if(!primary_turf_type)
stack_trace("Turf type is `null` in `[type]` lavaland theme")
else if(!ispath(primary_turf_type))
stack_trace("Wrong turf type `[primary_turf_type.type]` in `[type]` lavaland theme")
built_bridges = list()
/**
* This proc should do all theme specific thing.
* Now it only generates rivers, but it can do all stuff you desire.
*/
/datum/lavaland_theme/proc/setup()
SHOULD_CALL_PARENT(TRUE)
setup_multisector()
/datum/lavaland_theme/proc/setup_multisector()
var/bridge_diameter = 14
var/interval = 20
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/space_level/level = GLOB.space_manager.get_zlev(zlvl)
if(!built_bridges["[zlvl]"])
built_bridges["[zlvl]"] = list()
for(var/d in level.neighbors)
if(d == Z_LEVEL_SOUTH)
var/datum/space_level/connected = level.get_connection(Z_LEVEL_SOUTH)
if(!built_bridges["[connected.zpos]"])
built_bridges["[connected.zpos]"] = list()
var/left_margin = TRANSITIONEDGE + 5
while(left_margin < world.maxx - TRANSITIONEDGE)
if(prob(50))
var/left_edge = rand(left_margin, left_margin + bridge_diameter)
var/loc = locate(left_edge, bridge_diameter / 2 + 1, level.zpos)
var/datum/map_template/ruin/lavaland/zlvl_bridge/template = GLOB.lavaland_zlvl_bridge_templates["lavaland_zlvl_bridge_vertical_1.dmm"]
template.load(loc, centered = TRUE)
// now make sure we line up another bridge on the linked map
loc = locate(left_edge, world.maxy - (bridge_diameter / 2) + 1, connected.zpos)
template.load(loc, centered = TRUE)
left_margin += interval
built_bridges["[zlvl]"]["[connected.zpos]"] = Z_LEVEL_SOUTH
built_bridges["[connected.zpos]"]["[zlvl]"] = Z_LEVEL_NORTH
else if(d == Z_LEVEL_EAST)
var/datum/space_level/connected = level.get_connection(Z_LEVEL_EAST)
if(!built_bridges["[connected.zpos]"])
built_bridges["[connected.zpos]"] = list()
var/north_margin = TRANSITIONEDGE + 5
while(north_margin < world.maxy - TRANSITIONEDGE)
if(prob(50))
var/north_edge = rand(north_margin, north_margin + bridge_diameter)
var/loc = locate(bridge_diameter / 2, north_edge, level.zpos)
var/datum/map_template/ruin/lavaland/zlvl_bridge/template = GLOB.lavaland_zlvl_bridge_templates["lavaland_zlvl_bridge_horizontal_1.dmm"]
template.load(loc, centered = TRUE)
// now make sure we line up another bridge on the linked map
loc = locate(world.maxx - (bridge_diameter / 2) + 1, north_edge, connected.zpos)
template.load(loc, centered = TRUE)
north_margin += interval
built_bridges["[zlvl]"]["[connected.zpos]"] = Z_LEVEL_EAST
built_bridges["[connected.zpos]"]["[zlvl]"] = Z_LEVEL_WEST
/datum/lavaland_theme/proc/get_bridge_direction(z1, z2)
if(z1 == z2)
return null
if(("[z1]" in built_bridges) && ("[z2]" in built_bridges["[z1]"]))
return built_bridges["[z1]"]["[z2]"]
if(("[z2]" in built_bridges) && ("[z1]" in built_bridges["[z2]"]))
return built_bridges["[z2]"]["[z1]"]
return null
/datum/lavaland_theme/lava
name = "lava"
primary_turf_type = /turf/simulated/floor/lava/lava_land_surface
planet_icon_state = "planet_lava"
primary_turf_type_icon = 'icons/turf/floors/lava.dmi'
/datum/lavaland_theme/lava/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/lava_spawner = new(zlvl)
lava_spawner.generate()
/datum/lavaland_theme/plasma
name = "plasma"
primary_turf_type = /turf/simulated/floor/lava/lava_land_surface/plasma
planet_icon_state = "planet_plasma"
primary_turf_type_icon = 'icons/turf/floors/liquidplasma.dmi'
/datum/lavaland_theme/plasma/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/spawner = new(zlvl)
spawner.generate(nodes = 2)
spawner.generate(nodes = 2) // twice
/datum/lavaland_theme/chasm
name = "chasm"
primary_turf_type = /turf/simulated/floor/chasm/straight_down/lava_land_surface
planet_icon_state = "planet_chasm"
primary_turf_type_icon = 'icons/turf/floors/Chasms.dmi'
/datum/lavaland_theme/chasm/setup()
. = ..()
for(var/zlvl in levels_by_trait(ORE_LEVEL))
var/datum/river_spawner/spawner = new(zlvl, spread_prob_ = 10, spread_prob_loss_ = 5)
spawner.generate(nodes = 6, min_x = 50, min_y = 7, max_x = 250, max_y = 225)
-356
View File
@@ -1,356 +0,0 @@
#define LONG_BRIDGE_THEME_CULT "cult"
#define LONG_BRIDGE_THEME_HIERO "hiero"
#define LONG_BRIDGE_THEME_CLOCKWORK "clockwork"
#define LONG_BRIDGE_THEME_STONE "stone"
#define LONG_BRIDGE_THEME_WOOD "wood"
#define LONG_BRIDGE_THEME_CATWALK "catwalk"
/**
* A spawner for dynamic bridges, largely with hardcoded expectations to be
* operating on Lavaland.
*
* It does this by starting at its spawn point, placed by a
* [/datum/river_spawner] during generation, and walking in each direction
* "forwards" and "backwards" until it reaches the maximum possible length of
* the bridge, or a tile that doesn't appear to be a valid "passage"
* (essentially a tile that doesn't have lava on both sides and thus wouldn't
* look good or make an effective bridge). If it manages to do this and find two
* tiles that work as the start and end of the bridge, it places the paths,
* pillars, and "cleans up" the tiles contiguous to its entrance and exit turfs,
* removing any lava if present.
*
* It attempts this first in the vertical direction, and then the horizontal. So
* "fowards" and "backwards" can mean NORTH/SOUTH or EAST/WEST depending on the
* direction it's attempting.
*
* There are several bridge "themes" implemented in `make_walkway()` and
* `make_pillar()`, and more can be added if desired.
*/
/obj/effect/spawner/dynamic_bridge
var/max_length = 8
var/min_length = 4
var/bridge_theme
var/list/forwards_backwards
var/list/side_to_side
var/turf/forward_goal
var/turf/backward_goal
/obj/effect/spawner/dynamic_bridge/Initialize(mapload)
. = ..()
if(!bridge_theme)
bridge_theme = pick(
LONG_BRIDGE_THEME_CULT,
LONG_BRIDGE_THEME_HIERO,
LONG_BRIDGE_THEME_CLOCKWORK,
LONG_BRIDGE_THEME_STONE,
LONG_BRIDGE_THEME_WOOD,
LONG_BRIDGE_THEME_CATWALK,
)
return INITIALIZE_HINT_LATELOAD
/obj/effect/spawner/dynamic_bridge/LateInitialize()
forwards_backwards = list(NORTH, SOUTH)
side_to_side = list(EAST, WEST)
if(attempt_bridge() != BRIDGE_SPAWN_SUCCESS)
forward_goal = null
backward_goal = null
forwards_backwards = list(EAST, WEST)
side_to_side = list(NORTH, SOUTH)
attempt_bridge()
qdel(src)
/// Returns whether the passed in turf is a valid "landing". A valid landing is
/// a tile that hasn't been reserved by another bridge, and has a non-lava tile
/// leading directly to it.
/obj/effect/spawner/dynamic_bridge/proc/valid_landing(turf/T, direction)
if(T.flags & LAVA_BRIDGE || T.flags & NO_LAVA_GEN)
return FALSE
var/turf/end = get_step(T, direction)
if(end.flags & LAVA_BRIDGE || !(ismineralturf(end) || istype(end, /turf/simulated/floor/plating/asteroid)))
return FALSE
var/area/A = get_area(end)
if(istype(A, /area/lavaland/surface/gulag_rock))
return FALSE
if(istype(A, /area/lavaland/surface/outdoors/outpost))
return FALSE
if(istype(A, /area/mine/outpost))
return FALSE
if(istype(A, /area/shuttle))
return FALSE
return TRUE
/obj/effect/spawner/dynamic_bridge/proc/bridgeable_turf(turf/T)
// Pre SSlatemapping, before we've replaced mapping turfs with their river theme
if(istype(T, /turf/simulated/floor/lava/mapping_lava))
return TRUE
// Everything else
if(istype(T, /turf/simulated/floor/chasm))
return TRUE
if(istype(T, /turf/simulated/floor/lava))
return TRUE
/// Returns whether the passed in turf is a valid "passage". A valid passage is
/// a lava tile that has lava on both sides of it. Invalid passage tiles do not
/// look good as bridge walkways and defeat the purpose of there is floor right
/// next to it.
/obj/effect/spawner/dynamic_bridge/proc/valid_passage(turf/T)
if(T.flags & LAVA_BRIDGE)
return FALSE
if(!bridgeable_turf(T))
return FALSE
if(!bridgeable_turf(get_step(T, side_to_side[1])))
return FALSE
if(!bridgeable_turf(get_step(T, side_to_side[2])))
return FALSE
var/area/A = get_area(T)
if(istype(A, /area/lavaland/surface/gulag_rock))
return FALSE
return TRUE
/obj/effect/spawner/dynamic_bridge/proc/make_pillar(turf/T)
for(var/obj/structure/spawner/S in T)
qdel(S)
for(var/mob/living/M in T)
qdel(M)
for(var/obj/structure/flora/F in T)
qdel(F)
switch(bridge_theme)
if(LONG_BRIDGE_THEME_CULT)
T.ChangeTurf(/turf/simulated/wall/cult)
if(LONG_BRIDGE_THEME_HIERO)
T.ChangeTurf(/turf/simulated/wall/indestructible/hierophant)
if(LONG_BRIDGE_THEME_CLOCKWORK)
T.ChangeTurf(/turf/simulated/wall/clockwork)
if(LONG_BRIDGE_THEME_STONE)
T.ChangeTurf(/turf/simulated/wall/cult)
if(LONG_BRIDGE_THEME_WOOD)
T.ChangeTurf(/turf/simulated/wall/mineral/wood/nonmetal)
if(LONG_BRIDGE_THEME_CATWALK)
new /obj/structure/lattice/catwalk/mining(T)
new /obj/structure/marker_beacon/dock_marker/collision(T)
T.flags |= LAVA_BRIDGE
/obj/structure/bridge_walkway
name = "floor"
icon = 'icons/turf/floors.dmi'
layer = ABOVE_OPEN_TURF_LAYER
anchored = TRUE
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
/obj/structure/bridge_walkway/Destroy()
var/turf/T = get_turf(src)
if(T)
T.layer = PLATING_LAYER
T.clear_filters()
return ..()
/obj/structure/bridge_walkway/cult
icon_state = "cult"
/obj/structure/bridge_walkway/hiero
icon = 'icons/turf/floors/hierophant_floor.dmi'
icon_state = "floor"
/obj/structure/bridge_walkway/clockwork
name = "clockwork floor"
icon_state = "clockwork_floor"
/obj/structure/bridge_walkway/clockwork/Initialize(mapload)
. = ..()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_crossed)
)
AddElement(/datum/element/connect_loc, loc_connections)
// Pretend to be a normal clockwork floor and duplicate its visual effect
/obj/structure/bridge_walkway/clockwork/proc/on_crossed(atom/crosser)
var/counter = 0
for(var/obj/effect/temp_visual/ratvar/floor/floor in contents)
if(++counter == 3)
return
if(!. && isliving(crosser))
addtimer(CALLBACK(src, PROC_REF(spawn_visual)), 0.2 SECONDS, TIMER_DELETE_ME)
/obj/structure/bridge_walkway/clockwork/proc/spawn_visual()
new /obj/effect/temp_visual/ratvar/floor(loc)
/obj/structure/bridge_walkway/wood
icon_state = "wood"
/obj/effect/spawner/dynamic_bridge/proc/make_walkway(turf/T)
for(var/obj/structure/spawner/S in T)
qdel(S)
for(var/mob/living/M in T)
qdel(M)
for(var/obj/structure/flora/F in T)
qdel(F)
switch(bridge_theme)
if(LONG_BRIDGE_THEME_CULT)
new /obj/structure/bridge_walkway/cult(T)
if(LONG_BRIDGE_THEME_HIERO)
new /obj/structure/bridge_walkway/hiero(T)
if(LONG_BRIDGE_THEME_CLOCKWORK)
new /obj/structure/bridge_walkway/clockwork(T)
if(LONG_BRIDGE_THEME_STONE)
// Stone tiles are different sizes and shapes so these are
// "safe-looking" arrangements.
switch(rand(1, 5))
if(1)
new /obj/structure/stone_tile/block(T)
var/obj/structure/stone_tile/block/cracked/C = new(T)
C.dir = NORTH
if(2)
new /obj/structure/stone_tile/slab(T)
if(3)
new /obj/structure/stone_tile/surrounding(T)
new /obj/structure/stone_tile/center(T)
if(4)
new /obj/structure/stone_tile/slab/cracked(T)
if(5)
new /obj/structure/stone_tile/burnt(T)
var/obj/structure/stone_tile/surrounding_tile/ST = new(T)
ST.dir = WEST
var/obj/structure/stone_tile/block/B = new(T)
B.dir = NORTH
if(LONG_BRIDGE_THEME_WOOD)
var/obj/structure/bridge_walkway/wood/tile = new(T)
if(prob(20))
tile.icon_state = pick("wood-broken", "wood-broken2", "wood-broken3", "wood-broken4", "wood-broken5", "wood-broken6", "wood-broken7")
if(LONG_BRIDGE_THEME_CATWALK)
new /obj/structure/lattice/catwalk/mining(T)
T.flags |= LAVA_BRIDGE
/// Make a tile safe for player passage, for use at the bridge entrance and exits
/obj/effect/spawner/dynamic_bridge/proc/cleanup_edge(turf/T)
if(bridgeable_turf(T))
T.ChangeTurf(/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface)
T.icon_state = "basalt" // hate
/obj/effect/spawner/dynamic_bridge/proc/attempt_bridge()
var/count = 1
var/walk_dir = forwards_backwards[1]
var/turf/forward_step = get_turf(src)
var/turf/backward_step = get_turf(src)
var/bad_passage = FALSE
while(count <= max_length && !(forward_goal && backward_goal) && !bad_passage)
if(walk_dir == forwards_backwards[1])
if(!forward_goal)
if(out_of_bounds(walk_dir, forward_step))
break // Out of bounds
forward_step = get_step(forward_step, walk_dir)
if(valid_landing(forward_step, walk_dir))
forward_goal = forward_step
else if(!valid_passage(forward_step))
bad_passage = TRUE
count++
walk_dir = forwards_backwards[2]
else
if(!backward_goal)
if(out_of_bounds(walk_dir, backward_step))
break // Out of bounds
backward_step = get_step(backward_step, walk_dir)
if(valid_landing(backward_step, walk_dir))
backward_goal = backward_step
else if(!valid_passage(backward_step))
bad_passage = TRUE
count++
walk_dir = forwards_backwards[1]
if(bad_passage)
return BRIDGE_SPAWN_BAD_TERRAIN
if(count < min_length)
return BRIDGE_SPAWN_TOO_NARROW
if(count > max_length)
return BRIDGE_SPAWN_TOO_WIDE
if(!bad_passage && count >= min_length && forward_goal && backward_goal)
for(var/turf/T in get_line(forward_goal, backward_goal))
make_walkway(T)
for(var/turf/T in list(
get_step(forward_goal, side_to_side[1]),
get_step(forward_goal, side_to_side[2]),
get_step(backward_goal, side_to_side[1]),
get_step(backward_goal, side_to_side[2])))
make_pillar(T)
for(var/turf/T in get_line(
get_step(get_step(forward_goal, side_to_side[1]), forwards_backwards[1]),
get_step(get_step(forward_goal, side_to_side[2]), forwards_backwards[1])))
cleanup_edge(T)
for(var/turf/T in get_line(
get_step(get_step(backward_goal, side_to_side[1]), forwards_backwards[2]),
get_step(get_step(backward_goal, side_to_side[2]), forwards_backwards[2])))
cleanup_edge(T)
return BRIDGE_SPAWN_SUCCESS
/// Checks if we are going out of bounds. Returns TRUE if we are close (less than or equal to 2 turfs) to a border
/obj/effect/spawner/dynamic_bridge/proc/out_of_bounds(direction, turf/current_turf)
if(!direction || !current_turf)
return TRUE
switch(direction)
if(NORTH)
return current_turf.y >= world.maxy - 2
if(EAST)
return current_turf.x >= world.maxx - 2
if(SOUTH)
return current_turf.y <= 2
if(WEST)
return current_turf.x <= 2
return TRUE
/obj/effect/spawner/dynamic_bridge/capsule
bridge_theme = LONG_BRIDGE_THEME_CATWALK
/obj/effect/spawner/dynamic_bridge/capsule/Initialize(mapload, thrown_dir)
. = ..()
if(thrown_dir in list(EAST, WEST))
forwards_backwards = list(EAST, WEST)
side_to_side = list(NORTH, SOUTH)
else
forwards_backwards = list(NORTH, SOUTH)
side_to_side = list(EAST, WEST)
return INITIALIZE_HINT_NORMAL
/datum/map_template/ruin/lavaland/zlvl_bridge
prefix = "_maps/map_files/RandomRuins/LavaRuins/zlvl_bridges/"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical
/datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
name = "Vertical Bridge One"
suffix = "lavaland_zlvl_bridge_vertical_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/vertical/one
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal
/datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
name = "Horizontal Bridge One"
suffix = "lavaland_zlvl_bridge_horizontal_1.dmm"
ci_exclude = /datum/map_template/ruin/lavaland/zlvl_bridge/horizontal/one
#undef LONG_BRIDGE_THEME_CULT
#undef LONG_BRIDGE_THEME_HIERO
#undef LONG_BRIDGE_THEME_CLOCKWORK
#undef LONG_BRIDGE_THEME_STONE
#undef LONG_BRIDGE_THEME_WOOD
#undef LONG_BRIDGE_THEME_CATWALK