Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-z away site exoplanet generation #19644

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 away site 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
Loading