Landmarks works (#19006)

Fixed some landmarks harddels.
Refactored various landmarks in their own subtype instead of using a
name-based switch system.
This commit is contained in:
Fluffy
2024-04-28 19:04:40 +02:00
committed by GitHub
parent fb05bfab41
commit 5c295f5a10
32 changed files with 645 additions and 937 deletions
@@ -18,9 +18,6 @@ SUBSYSTEM_DEF(finalize)
load_space_ruin()
if(GLOB.config.dungeon_chance > 0)
place_dungeon_spawns()
if(GLOB.config.generate_asteroid)
time = world.time
SSatlas.current_map.generate_asteroid()
@@ -66,49 +63,6 @@ SUBSYSTEM_DEF(finalize)
SSatlas.current_map.restricted_levels.Add(world.maxz)
QDEL_NULL(maploader)
/datum/controller/subsystem/finalize/proc/place_dungeon_spawns()
var/map_directory = "maps/dungeon_spawns/"
var/list/files = flist(map_directory)
var/start_time = world.time
var/dungeons_placed = 0
var/dmm_suite/maploader = new
var/dungeon_chance = GLOB.config.dungeon_chance
log_subsystem_mapfinalization("Attempting to create asteroid dungeons for [length(GLOB.asteroid_spawn)] different areas, with [length(files) - 1] possible dungeons, with a [dungeon_chance]% chance to spawn a dungeon per area.")
for(var/turf/spawn_location in GLOB.asteroid_spawn)
if(length(files) <= 0) //Sanity
log_subsystem_mapfinalization("There aren't enough dungeon map files to fill the entire dungeon map. There may be less dungeons than expected.")
break
if(prob(dungeon_chance))
var/chosen_dungeon = pick(files)
if(!dd_hassuffix(chosen_dungeon,".dmm")) //Don't read anything that isn't a map file
files -= chosen_dungeon
log_subsystem_mapfinalization_error("ALERT: [chosen_dungeon] is not a .dmm file! Skipping!")
continue
var/map_file = file("[map_directory][chosen_dungeon]")
if(isfile(map_file)) //Sanity
log_subsystem_mapfinalization("Loading dungeon '[chosen_dungeon]' at coordinates [spawn_location.x], [spawn_location.y], [spawn_location.z].")
maploader.load_map(map_file,spawn_location.x,spawn_location.y,spawn_location.z)
dungeons_placed += 1
else
log_subsystem_mapfinalization_error("ERROR: Something weird happened with the file: [chosen_dungeon].")
log_mapping("ERROR: Something weird happened with the file: [chosen_dungeon].")
if(dd_hassuffix(chosen_dungeon,"_unique.dmm")) //Unique dungeons should only spawn once.
files -= chosen_dungeon
log_subsystem_mapfinalization("Loaded [dungeons_placed] asteroid dungeons in [(world.time - start_time)/10] seconds.")
qdel(maploader)
/datum/controller/subsystem/finalize/proc/generate_contact_report()
if(!selected_mission)
return