Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamySkrell committed Jul 15, 2024
1 parent 4107142 commit 2c6fda8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
7 changes: 7 additions & 0 deletions html/changelogs/DreamySkrell-multiz-exoplanet-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

author: DreamySkrell

delete-after: True

changes:
- rscadd: "Multi-z exoplanet generation."
14 changes: 8 additions & 6 deletions maps/_common/mapsystem/map.dm
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,17 @@

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())
for(var/datum/map_template/template in selected)
var/bounds = template.load_new_z()
if(bounds)
// do away site exoplanet generation, if needed
var/datum/map_template/ruin/away_site/away_site = template
if(istype(away_site) && away_site.exoplanet_themes)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(world.maxz-1, 1, 1, 254, 254, marker_turf_type)
for(var/z_index = bounds[MAP_MINZ]; z_index <= bounds[MAP_MAXZ]; z_index++)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(z_index, 1, 1, 254, 254, marker_turf_type)
// fin
log_admin("Loaded away site [template]!")
else
Expand Down
22 changes: 12 additions & 10 deletions maps/away_sites_testing/away_sites_testing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@
//Spawn the away sites selected in the previous step
for(var/datum/map_template/ruin/away_site/away_site in away_sites_to_spawn)
// load the site
away_site.load_new_z()
var/bounds = away_site.load_new_z()

// do away site exoplanet generation, if needed
if(away_site.exoplanet_themes)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(world.maxz-1, 1, 1, 254, 254, marker_turf_type)
for(var/z_index = bounds[MAP_MINZ]; z_index <= bounds[MAP_MAXZ]; z_index++)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(z_index, 1, 1, 254, 254, marker_turf_type)

// fin
testing("[ascii_green]LOADING AWAY SITE:[ascii_reset] Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]")
Expand All @@ -64,14 +65,15 @@
var/datum/map_template/ruin/away_site/away_site = SSmapping.away_sites_templates[map]

// load the site
away_site.load_new_z()
var/bounds = away_site.load_new_z()

// do away site exoplanet generation, if needed
if(away_site.exoplanet_themes)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(world.maxz-1, 1, 1, 254, 254, marker_turf_type)
for(var/z_index = bounds[MAP_MINZ]; z_index <= bounds[MAP_MAXZ]; z_index++)
for(var/marker_turf_type in away_site.exoplanet_themes)
var/datum/exoplanet_theme/exoplanet_theme_type = away_site.exoplanet_themes[marker_turf_type]
var/datum/exoplanet_theme/exoplanet_theme = new exoplanet_theme_type()
exoplanet_theme.generate_map(z_index, 1, 1, 254, 254, marker_turf_type)

// fin
testing("[ascii_green]LOADING AWAY SITE:[ascii_reset] Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]")
Expand Down

0 comments on commit 2c6fda8

Please sign in to comment.