mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge branch 'master' of https://github.com/PolarisSS13/Polaris into polaris-sync-2018-04-04
# Conflicts: # code/modules/economy/lorenews.dm # code/modules/mob/living/simple_animal/animals/cat.dm # html/changelogs/.all_changelog.yml # maps/southern_cross/southern_cross-1.dmm
This commit is contained in:
@@ -13,6 +13,7 @@ var/list/global/map_templates = list()
|
||||
/datum/map_template
|
||||
var/name = "Default Template Name"
|
||||
var/desc = "Some text should go here. Maybe."
|
||||
var/template_group = null // If this is set, no more than one template in the same group will be spawned, per submap seeding.
|
||||
var/width = 0
|
||||
var/height = 0
|
||||
var/mappath = null
|
||||
@@ -67,7 +68,7 @@ var/list/global/map_templates = list()
|
||||
|
||||
admin_notice("<span class='danger'>Initializing newly created atom(s) in submap.</span>", R_DEBUG)
|
||||
SSatoms.InitializeAtoms(atoms)
|
||||
|
||||
|
||||
admin_notice("<span class='danger'>Initializing atmos pipenets and machinery in submap.</span>", R_DEBUG)
|
||||
SSmachines.setup_atmos_machinery(atmos_machines)
|
||||
|
||||
@@ -190,6 +191,7 @@ var/list/global/map_templates = list()
|
||||
CHECK_TICK
|
||||
|
||||
var/list/loaded_submap_names = list()
|
||||
var/list/template_groups_used = list() // Used to avoid spawning three seperate versions of the same PoI.
|
||||
|
||||
// Now lets start choosing some.
|
||||
while(budget > 0 && overall_sanity > 0)
|
||||
@@ -210,6 +212,14 @@ var/list/global/map_templates = list()
|
||||
|
||||
// Can we afford it?
|
||||
if(chosen_template.cost > budget)
|
||||
priority_submaps -= chosen_template
|
||||
potential_submaps -= chosen_template
|
||||
continue
|
||||
|
||||
// Did we already place down a very similar submap?
|
||||
if(chosen_template.template_group && chosen_template.template_group in template_groups_used)
|
||||
priority_submaps -= chosen_template
|
||||
potential_submaps -= chosen_template
|
||||
continue
|
||||
|
||||
// If so, try to place it.
|
||||
@@ -242,14 +252,21 @@ var/list/global/map_templates = list()
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
// For pretty maploading statistics.
|
||||
if(loaded_submap_names[chosen_template.name])
|
||||
loaded_submap_names[chosen_template.name] += 1
|
||||
else
|
||||
loaded_submap_names[chosen_template.name] = 1
|
||||
|
||||
// To avoid two 'related' similar submaps existing at the same time.
|
||||
if(chosen_template.template_group)
|
||||
template_groups_used += chosen_template.template_group
|
||||
|
||||
// To deduct the cost.
|
||||
if(chosen_template.cost >= 0)
|
||||
budget -= chosen_template.cost
|
||||
|
||||
// Remove the submap from our options.
|
||||
if(chosen_template in priority_submaps) // Always remove priority submaps.
|
||||
priority_submaps -= chosen_template
|
||||
else if(!chosen_template.allow_duplicates)
|
||||
|
||||
Reference in New Issue
Block a user