Skip to content

Commit

Permalink
aaaa
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamySkrell committed May 6, 2024
1 parent 6ede3aa commit 5072679
Show file tree
Hide file tree
Showing 6 changed files with 63,175 additions and 61,952 deletions.
6 changes: 5 additions & 1 deletion code/modules/maps/map_template.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
height = bounds[MAP_MAXY] - bounds[MAP_MINX] + 1
return bounds

/datum/map_template/proc/load_new_z(var/no_changeturf = TRUE)
/datum/map_template/proc/load_new_z(var/no_changeturf = TRUE, var/datum/exoplanet_theme/theme = null)
RETURN_TYPE(/turf)

var/x = round((world.maxx - width)/2)
Expand Down Expand Up @@ -77,6 +77,10 @@
smooth_zlevel(world.maxz)
resort_all_areas()

//exoplanet???
if(istype(theme))
theme.generate_map(null, initial_z, 1, 1, 254, 254)

//initialize things that are normally initialized after map load
init_atoms(atoms_to_initialise)
init_shuttles(shuttle_state)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/overmap/exoplanets/themes/_theme.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
var/humidity_seed = rand(0, 50000)

for(var/turf/gen_turf in block(locate(min_x, min_y, z_to_gen), locate(max_x, max_y, z_to_gen)))

if(!istype(gen_turf, /turf/space))
continue

// Drift here gives us a bit of extra noise on the edges of biomes, to make it transition slightly more naturally
var/drift_x = (gen_turf.x + rand(-BIOME_RANDOM_SQUARE_DRIFT, BIOME_RANDOM_SQUARE_DRIFT)) / perlin_zoom
var/drift_y = (gen_turf.y + rand(-BIOME_RANDOM_SQUARE_DRIFT, BIOME_RANDOM_SQUARE_DRIFT)) / perlin_zoom
Expand Down
9 changes: 8 additions & 1 deletion maps/_common/mapsystem/map.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,14 @@
log_admin("Finished selecting away sites ([english_list(selected)]) for [totalbudget - (points + shippoints)] cost of [totalbudget] budget.")

for (var/datum/map_template/template in selected)
if (template.load_new_z())
// get the theme if any
var/datum/exoplanet_theme/theme = null
var/datum/map_template/ruin/away_site/away_site = template
if(istype(away_site) && away_site.theme)
theme = new away_site.theme()

// actually load it
if (template.load_new_z(theme=theme))
log_admin("Loaded away site [template]!")
else
log_admin("Failed loading away site [template]!")
Expand Down
Loading

0 comments on commit 5072679

Please sign in to comment.