Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TobleroneSwordfish committed Sep 5, 2024
2 parents 9a92843 + 2e5b3a8 commit f1a210c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
15 changes: 9 additions & 6 deletions code/modules/admin/terrainify.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ var/datum/station_zlevel_repair/station_repair = new
proc/clean_up_station_level(replace_with_cars, add_sub, remove_parallax = TRUE, season=null)
var/list/turfs_to_fix = get_turfs_to_fix()
clear_out_turfs(turfs_to_fix)

clear_around_beacons()
clear_out_turfs(get_beacon_turfs(), by_type[/obj/warp_beacon])

land_vehicle_fixup(replace_with_cars, add_sub)
copy_gas_to_airless()
Expand Down Expand Up @@ -132,12 +131,12 @@ var/datum/station_zlevel_repair/station_repair = new
if(istype(man, /obj/machinery/manufacturer/hangar) && (man.z == Z_LEVEL_STATION))
man.add_schematic(/datum/manufacture/sub/wheels)

proc/clear_around_beacons()
proc/get_beacon_turfs()
var/list/turfs_to_fix = list()
for(var/obj/warp_beacon/W in by_type[/obj/warp_beacon])
for(var/turf/T in range(4,W))
for(var/turf/T in range(5, W))
turfs_to_fix |= T
clear_out_turfs(turfs_to_fix, by_type[/obj/warp_beacon])
return turfs_to_fix

proc/get_ptl_beams()
. = list()
Expand Down Expand Up @@ -513,7 +512,7 @@ ABSTRACT_TYPE(/datum/terrainify)

station_repair.clean_up_station_level(params["vehicle"] & TERRAINIFY_VEHICLE_CARS, params["vehicle"] & TERRAINIFY_VEHICLE_FABS, FALSE)

log_terrainify( "turned space into an THE VOID.")
log_terrainify(user, "turned space into an THE VOID.")

/proc/generate_void(all_z_levels = FALSE)
station_repair.ambient_light = new /image/ambient
Expand Down Expand Up @@ -579,6 +578,7 @@ ABSTRACT_TYPE(/datum/terrainify)

// Path to market does not need to be cleared because it was converted to ice. Abyss will screw up everything!
var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix()
traveling_crate_turfs += station_repair.get_beacon_turfs()
for(var/turf/space/T in traveling_crate_turfs)
T.ReplaceWith(/turf/unsimulated/floor/arctic/snow/ice)
if(station_repair.allows_vehicles)
Expand Down Expand Up @@ -624,6 +624,7 @@ ABSTRACT_TYPE(/datum/terrainify)
LG.lava_percent = 25

var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix()
traveling_crate_turfs += station_repair.get_beacon_turfs()
for(var/turf/space/T in traveling_crate_turfs)
T.ReplaceWith(/turf/unsimulated/floor/auto/iomoon)
if(station_repair.allows_vehicles)
Expand Down Expand Up @@ -734,6 +735,7 @@ ABSTRACT_TYPE(/datum/terrainify)
station_repair.clean_up_station_level(params["vehicle"] & TERRAINIFY_VEHICLE_CARS, params["vehicle"] & TERRAINIFY_VEHICLE_FABS)

var/list/turf/traveling_crate_turfs = station_repair.get_turfs_to_fix()
traveling_crate_turfs += station_repair.get_beacon_turfs()
for(var/turf/unsimulated/wall/setpieces/martian/auto/T in traveling_crate_turfs)
T.ReplaceWith(/turf/unsimulated/floor/setpieces/martian/station_duststorm, force=TRUE)
if(station_repair.allows_vehicles)
Expand Down Expand Up @@ -943,6 +945,7 @@ ABSTRACT_TYPE(/datum/terrainify)
generator.generate_map()

var/list/turf/turfs_to_clear = station_repair.get_turfs_to_fix()
turfs_to_clear += station_repair.get_beacon_turfs()
generator.clear_walls(turfs_to_clear)

generator.generate_terrain(space, reuse_seed=TRUE, flags=MAPGEN_ALLOW_VEHICLES * station_repair.allows_vehicles)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/worldgen/mapgen/RoomMaze.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@
min_y = room_a.y + room_a.height * 0.5 + rand(-range, range)
max_y = min_y + prob(15)

if(max_x == src.gen_max_x || max_y == src.gen_max_y )
max_x = max_x
if(min_x < 0) min_x = 0
if(min_y < 0) min_y = 0
if(max_x > src.gen_max_x) max_x = src.gen_max_x
if(max_y > src.gen_max_y) max_y = src.gen_max_y

for(var/i in min_x to max_x)
for(var/j in min_y to max_y)
Expand Down
25 changes: 13 additions & 12 deletions code/turf/floors_unsimulated.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1131,19 +1131,20 @@ TYPEINFO(/turf/unsimulated/floor/auto)
var/connectdir = get_connected_directions_bitflag(list(src.type=TRUE), list(), TRUE, FALSE)
for (var/direction in alldirs)
var/turf/T = get_step(src, turn(direction, 180))
if (istype(T, /turf/unsimulated/floor/auto))
var/turf/unsimulated/floor/auto/TA = T
if (TA.edge_priority_level >= src.edge_priority_level)
T.ClearSpecificOverlays("edge_[direction]") // Cull overlaps
if(T)
if (istype(T, /turf/unsimulated/floor/auto))
var/turf/unsimulated/floor/auto/TA = T
if (TA.edge_priority_level >= src.edge_priority_level)
T.ClearSpecificOverlays("edge_[direction]") // Cull overlaps
continue
if(turn(direction, 180) & connectdir)
T.ClearSpecificOverlays("edge_[direction]") // Cull diagnals
continue
if(turn(direction, 180) & connectdir)
T.ClearSpecificOverlays("edge_[direction]") // Cull diagnals
continue
var/image/edge_overlay = image(src.icon, "[icon_state_edge][direction]")
edge_overlay.appearance_flags = PIXEL_SCALE | TILE_BOUND | RESET_COLOR | RESET_ALPHA
edge_overlay.layer = src.layer + (src.edge_priority_level / 1000)
edge_overlay.plane = PLANE_FLOOR
T.UpdateOverlays(edge_overlay, "edge_[direction]")
var/image/edge_overlay = image(src.icon, "[icon_state_edge][direction]")
edge_overlay.appearance_flags = PIXEL_SCALE | TILE_BOUND | RESET_COLOR | RESET_ALPHA
edge_overlay.layer = src.layer + (src.edge_priority_level / 1000)
edge_overlay.plane = PLANE_FLOOR
T.UpdateOverlays(edge_overlay, "edge_[direction]")

/turf/unsimulated/floor/auto/grass/swamp_grass
name = "swamp grass"
Expand Down

0 comments on commit f1a210c

Please sign in to comment.