Dehardcodes SSmapping (#65077)

Essentially SSmapping had a list for each theme of ruin (space, lava,
ice, ice underground). These were all filled with an if statement
checking the ruin templates type. Now, i've given ruins a ruin_type var, which is then used to dynamically add to a single list of ruins, which separates lists of ruins by ruin type.
Good for downstreams who may have more ruin types
Changelog

cl
refactor: Dehardcoded SSmapping ruin types.
/cl
This commit is contained in:
Seth Scherer
2022-03-02 17:32:43 +13:00
committed by GitHub
parent 880f0b9917
commit 4e9731712a
8 changed files with 64 additions and 54 deletions
+6 -12
View File
@@ -654,18 +654,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
exists[L.ruin_template] = landmark
var/list/names = list()
names += "---- Space Ruins ----"
for(var/name in SSmapping.space_ruins_templates)
names[name] = list(SSmapping.space_ruins_templates[name], ZTRAIT_SPACE_RUINS, list(/area/space))
names += "---- Lava Ruins ----"
for(var/name in SSmapping.lava_ruins_templates)
names[name] = list(SSmapping.lava_ruins_templates[name], ZTRAIT_LAVA_RUINS, list(/area/lavaland/surface/outdoors/unexplored))
names += "---- Ice Ruins ----"
for(var/name in SSmapping.ice_ruins_templates)
names[name] = list(SSmapping.ice_ruins_templates[name], ZTRAIT_ICE_RUINS, list(/area/icemoon/surface/outdoors/unexplored, /area/icemoon/underground/unexplored))
names += "---- Ice Underground Ruins ----"
for(var/name in SSmapping.ice_ruins_underground_templates)
names[name] = list(SSmapping.ice_ruins_underground_templates[name], ZTRAIT_ICE_RUINS_UNDERGROUND, list(/area/icemoon/underground/unexplored))
for (var/theme in SSmapping.themed_ruins)
names += "---- [theme] ----"
for (var/name in SSmapping.themed_ruins[theme])
var/datum/map_template/ruin/ruin = SSmapping.themed_ruins[theme][name]
names[name] = list(ruin, theme, list(ruin.default_area))
var/ruinname = input("Select ruin", "Spawn Ruin") as null|anything in sort_list(names)
var/data = names[ruinname]