diff --git a/config/monkestation/ruins.toml b/config/monkestation/ruins.toml new file mode 100644 index 000000000000..838b7f119661 --- /dev/null +++ b/config/monkestation/ruins.toml @@ -0,0 +1,2 @@ +["/datum/map_template/ruin/space/oldstation"] +always_place = true diff --git a/monkestation/code/datums/ruins.dm b/monkestation/code/datums/ruins.dm new file mode 100644 index 000000000000..62df9d83204e --- /dev/null +++ b/monkestation/code/datums/ruins.dm @@ -0,0 +1,32 @@ +GLOBAL_LIST_INIT(ruin_config, load_ruin_config()) +#define RUIN_CONFIG_FILE "config/monkestation/ruins.toml" + +/datum/map_template/ruin/New() + . = ..() + var/list/this_ruin_config = GLOB.ruin_config[type] + if(this_ruin_config) + var/overrides = 0 + for(var/variable in this_ruin_config) + if(!(variable in vars)) + stack_trace("Invalid ruin configuration variable [variable] in ruin ([type]) variable changes.") + continue + vars[variable] = this_ruin_config[variable] + overrides += 1 + log_config("Applied [overrides] var overrides for [type] from ruin config.") + +/proc/load_ruin_config() + . = list() + if(!fexists(RUIN_CONFIG_FILE)) + log_config("No ruin config file found, using empty config.") + return + var/list/ruin_config = rustg_read_toml_file(RUIN_CONFIG_FILE) + if(!length(ruin_config)) + log_config("ruin token config file is empty, using empty config.") + return + for(var/ruin_config_id in ruin_config) + var/ruin_path = text2path(ruin_config_id) + if(!ispath(ruin_path, /datum/map_template/ruin)) + continue + .[ruin_path] = ruin_config[ruin_config_id] + +#undef RUIN_CONFIG_FILE diff --git a/tgstation.dme b/tgstation.dme index 8d68c36eeb1d..648e1ec73178 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5717,6 +5717,7 @@ #include "monkestation\code\datums\interaction_particle.dm" #include "monkestation\code\datums\meta_tokens.dm" #include "monkestation\code\datums\patreon_data.dm" +#include "monkestation\code\datums\ruins.dm" #include "monkestation\code\datums\stamina_container.dm" #include "monkestation\code\datums\twitch_data.dm" #include "monkestation\code\datums\achievements\misc_achievements.dm"