diff --git a/code/__DEFINES/configuration.dm b/code/__DEFINES/configuration.dm
new file mode 100644
index 0000000000..c78dfb28ab
--- /dev/null
+++ b/code/__DEFINES/configuration.dm
@@ -0,0 +1,10 @@
+//config files
+#define CONFIG_DEF(X) /datum/config_entry/##X { resident_file = CURRENT_RESIDENT_FILE }; /datum/config_entry/##X
+#define CONFIG_GET(X) global.config.Get(/datum/config_entry/##X)
+#define CONFIG_SET(X, Y) global.config.Set(/datum/config_entry/##X, ##Y)
+
+#define CONFIG_MAPS_FILE "maps.txt"
+
+//flags
+#define CONFIG_ENTRY_LOCKED 1 //can't edit
+#define CONFIG_ENTRY_HIDDEN 2 //can't see value
diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm
index 8f3a0163b9..91508ded32 100644
--- a/code/__HELPERS/_logging.dm
+++ b/code/__HELPERS/_logging.dm
@@ -26,74 +26,74 @@
/proc/log_admin(text)
GLOB.admin_log.Add(text)
- if (config.log_admin)
+ if (CONFIG_GET(flag/log_admin))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]ADMIN: [text]")
//Items using this proc are stripped from public logs - use with caution
/proc/log_admin_private(text)
GLOB.admin_log.Add(text)
- if (config.log_admin)
+ if (CONFIG_GET(flag/log_admin))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]ADMINPRIVATE: [text]")
/proc/log_adminsay(text)
- if (config.log_adminchat)
+ if (CONFIG_GET(flag/log_adminchat))
log_admin_private("ASAY: [text]")
/proc/log_dsay(text)
- if (config.log_adminchat)
+ if (CONFIG_GET(flag/log_adminchat))
log_admin("DSAY: [text]")
/proc/log_game(text)
- if (config.log_game)
+ if (CONFIG_GET(flag/log_game))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]GAME: [text]")
/proc/log_vote(text)
- if (config.log_vote)
+ if (CONFIG_GET(flag/log_vote))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]VOTE: [text]")
/proc/log_access(text)
- if (config.log_access)
+ if (CONFIG_GET(flag/log_access))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]ACCESS: [text]")
/proc/log_say(text)
- if (config.log_say)
+ if (CONFIG_GET(flag/log_say))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]SAY: [text]")
/proc/log_prayer(text)
- if (config.log_prayer)
+ if (CONFIG_GET(flag/log_prayer))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]PRAY: [text]")
/proc/log_law(text)
- if (config.log_law)
+ if (CONFIG_GET(flag/log_law))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]LAW: [text]")
/proc/log_ooc(text)
- if (config.log_ooc)
+ if (CONFIG_GET(flag/log_ooc))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]OOC: [text]")
/proc/log_whisper(text)
- if (config.log_whisper)
+ if (CONFIG_GET(flag/log_whisper))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]WHISPER: [text]")
/proc/log_emote(text)
- if (config.log_emote)
+ if (CONFIG_GET(flag/log_emote))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]EMOTE: [text]")
/proc/log_attack(text)
- if (config.log_attack)
+ if (CONFIG_GET(flag/log_attack))
WRITE_FILE(GLOB.world_attack_log, "\[[time_stamp()]]ATTACK: [text]")
/proc/log_pda(text)
- if (config.log_pda)
+ if (CONFIG_GET(flag/log_pda))
WRITE_FILE(GLOB.world_pda_log, "\[[time_stamp()]]PDA: [text]")
/proc/log_comment(text)
- if (config.log_pda)
+ if (CONFIG_GET(flag/log_pda))
//reusing the PDA option because I really don't think news comments are worth a config option
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]COMMENT: [text]")
/proc/log_chat(text)
- if (config.log_pda)
+ if (CONFIG_GET(flag/log_pda))
WRITE_FILE(GLOB.world_game_log, "\[[time_stamp()]]CHAT: [text]")
/proc/log_qdel(text)
@@ -102,6 +102,10 @@
/proc/log_sql(text)
WRITE_FILE(GLOB.sql_error_log, "\[[time_stamp()]]SQL: [text]")
+/proc/log_config(text)
+ WRITE_FILE(GLOB.config_error_log, text)
+ SEND_TEXT(world.log, text)
+
//This replaces world.log so it displays both in DD and the file
/proc/log_world(text)
WRITE_FILE(GLOB.world_runtime_log, text)
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index c040e264e6..e38a6826f9 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -314,10 +314,11 @@
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
-/proc/get_candidates(be_special_type, afk_bracket = config.inactivity_period, jobbanType)
+/proc/get_candidates(be_special_type, afk_bracket = CONFIG_GET(number/inactivity_period), jobbanType)
var/list/candidates = list()
// Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000))
- while(!candidates.len && afk_bracket < config.afk_period)
+ var/afk_period = CONFIG_GET(number/afk_period)
+ while(!candidates.len && afk_bracket < afk_period)
for(var/mob/dead/observer/G in GLOB.player_list)
if(G.client != null)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm
index 1af231f893..0b79afb941 100644
--- a/code/__HELPERS/global_lists.dm
+++ b/code/__HELPERS/global_lists.dm
@@ -1,116 +1,115 @@
-//////////////////////////
-/////Initial Building/////
-//////////////////////////
-
-/proc/make_datum_references_lists()
- //hair
- init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list)
- //facial hair
- init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list)
- //underwear
- init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f)
- //undershirt
- init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f)
- //socks
- init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list)
- //lizard bodyparts (blizzard intensifies)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/lizard, GLOB.animated_tails_list_lizard)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, GLOB.animated_tails_list_human)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, GLOB.wings_open_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, GLOB.frills_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, GLOB.spines_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/spines_animated, GLOB.animated_spines_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, GLOB.legs_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.r_wings_list,roundstart = TRUE)
-
- //citadel code
- //mammal bodyparts (fucking furries)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_body_markings, GLOB.mam_body_markings_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_tails, GLOB.mam_tails_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_ears, GLOB.mam_ears_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_tails_animated, GLOB.mam_tails_animated_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/taur, GLOB.taur_list)
- //avian bodyparts (i swear this isn't starbound)
-// init_sprite_accessory_subtypes(/datum/sprite_accessory/beaks/avian, GLOB.avian_beaks_list)
-// init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/avian, GLOB.avian_tails_list)
-// init_sprite_accessory_subtypes(/datum/sprite_accessory/avian_wings, GLOB.avian_wings_list)
-// init_sprite_accessory_subtypes(/datum/sprite_accessory/avian_open_wings, GLOB.avian_open_wings_list)
- //xeno parts (hiss?)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_head, GLOB.xeno_head_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_tail, GLOB.xeno_tail_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_dorsal, GLOB.xeno_dorsal_list)
- //genitals
- init_sprite_accessory_subtypes(/datum/sprite_accessory/penis, GLOB.cock_shapes_list)
-
- for(var/K in GLOB.cock_shapes_list)
- var/datum/sprite_accessory/penis/value = GLOB.cock_shapes_list[K]
- GLOB.cock_shapes_icons[K] = value.icon_state
-
- init_sprite_accessory_subtypes(/datum/sprite_accessory/vagina, GLOB.vagina_shapes_list)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/breasts, GLOB.breasts_shapes_list)
- GLOB.breasts_size_list = list("a","b","c","d","e") //We need the list to choose from initialized, but it's no longer a sprite_accessory thing.
-
- //Species
- for(var/spath in subtypesof(/datum/species))
- var/datum/species/S = new spath()
- if(S.roundstart)
- GLOB.roundstart_species[S.id] = S.type
- GLOB.species_list[S.id] = S.type
-
- //Surgeries
- for(var/path in subtypesof(/datum/surgery))
- GLOB.surgeries_list += new path()
-
- //Materials
- for(var/path in subtypesof(/datum/material))
- var/datum/material/D = new path()
- GLOB.materials_list[D.id] = D
-
- //Techs
- for(var/path in subtypesof(/datum/tech))
- var/datum/tech/D = new path()
- GLOB.tech_list[D.id] = D
-
- //Emotes
- for(var/path in subtypesof(/datum/emote))
- var/datum/emote/E = new path()
- E.emote_list[E.key] = E
-
- init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes)
-
-/* // Uncomment to debug chemical reaction list.
-/client/verb/debug_chemical_list()
-
- for (var/reaction in chemical_reactions_list)
- . += "chemical_reactions_list\[\"[reaction]\"\] = \"[chemical_reactions_list[reaction]]\"\n"
- if(islist(chemical_reactions_list[reaction]))
- var/list/L = chemical_reactions_list[reaction]
- for(var/t in L)
- . += " has: [t]\n"
- to_chat(world, .)
-*/
-
-//creates every subtype of prototype (excluding prototype) and adds it to list L.
-//if no list/L is provided, one is created.
-/proc/init_subtypes(prototype, list/L)
- if(!istype(L))
- L = list()
- for(var/path in subtypesof(prototype))
- L += new path()
- return L
-
-//returns a list of paths to every subtype of prototype (excluding prototype)
-//if no list/L is provided, one is created.
-/proc/init_paths(prototype, list/L)
- if(!istype(L))
- L = list()
- for(var/path in subtypesof(prototype))
- L+= path
- return L
+//////////////////////////
+/////Initial Building/////
+//////////////////////////
+
+/proc/make_datum_references_lists()
+ //hair
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list)
+ //facial hair
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list)
+ //underwear
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f)
+ //undershirt
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f)
+ //socks
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list)
+ //lizard bodyparts (blizzard intensifies)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/lizard, GLOB.animated_tails_list_lizard)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, GLOB.animated_tails_list_human)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, GLOB.wings_open_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, GLOB.frills_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, GLOB.spines_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/spines_animated, GLOB.animated_spines_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, GLOB.legs_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.r_wings_list,roundstart = TRUE)
+
+ //citadel code
+ //mammal bodyparts (fucking furries)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_body_markings, GLOB.mam_body_markings_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_tails, GLOB.mam_tails_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_ears, GLOB.mam_ears_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/mam_tails_animated, GLOB.mam_tails_animated_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/taur, GLOB.taur_list)
+ //avian bodyparts (i swear this isn't starbound)
+// init_sprite_accessory_subtypes(/datum/sprite_accessory/beaks/avian, GLOB.avian_beaks_list)
+// init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/avian, GLOB.avian_tails_list)
+// init_sprite_accessory_subtypes(/datum/sprite_accessory/avian_wings, GLOB.avian_wings_list)
+// init_sprite_accessory_subtypes(/datum/sprite_accessory/avian_open_wings, GLOB.avian_open_wings_list)
+ //xeno parts (hiss?)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_head, GLOB.xeno_head_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_tail, GLOB.xeno_tail_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/xeno_dorsal, GLOB.xeno_dorsal_list)
+ //genitals
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/penis, GLOB.cock_shapes_list)
+
+ for(var/K in GLOB.cock_shapes_list)
+ var/datum/sprite_accessory/penis/value = GLOB.cock_shapes_list[K]
+ GLOB.cock_shapes_icons[K] = value.icon_state
+
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/vagina, GLOB.vagina_shapes_list)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/breasts, GLOB.breasts_shapes_list)
+ GLOB.breasts_size_list = list("a","b","c","d","e") //We need the list to choose from initialized, but it's no longer a sprite_accessory thing.
+
+
+ //Species
+ for(var/spath in subtypesof(/datum/species))
+ var/datum/species/S = new spath()
+ GLOB.species_list[S.id] = spath
+
+ //Surgeries
+ for(var/path in subtypesof(/datum/surgery))
+ GLOB.surgeries_list += new path()
+
+ //Materials
+ for(var/path in subtypesof(/datum/material))
+ var/datum/material/D = new path()
+ GLOB.materials_list[D.id] = D
+
+ //Techs
+ for(var/path in subtypesof(/datum/tech))
+ var/datum/tech/D = new path()
+ GLOB.tech_list[D.id] = D
+
+ //Emotes
+ for(var/path in subtypesof(/datum/emote))
+ var/datum/emote/E = new path()
+ E.emote_list[E.key] = E
+
+ init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes)
+
+/* // Uncomment to debug chemical reaction list.
+/client/verb/debug_chemical_list()
+
+ for (var/reaction in chemical_reactions_list)
+ . += "chemical_reactions_list\[\"[reaction]\"\] = \"[chemical_reactions_list[reaction]]\"\n"
+ if(islist(chemical_reactions_list[reaction]))
+ var/list/L = chemical_reactions_list[reaction]
+ for(var/t in L)
+ . += " has: [t]\n"
+ to_chat(world, .)
+*/
+
+//creates every subtype of prototype (excluding prototype) and adds it to list L.
+//if no list/L is provided, one is created.
+/proc/init_subtypes(prototype, list/L)
+ if(!istype(L))
+ L = list()
+ for(var/path in subtypesof(prototype))
+ L += new path()
+ return L
+
+//returns a list of paths to every subtype of prototype (excluding prototype)
+//if no list/L is provided, one is created.
+/proc/init_paths(prototype, list/L)
+ if(!istype(L))
+ L = list()
+ for(var/path in subtypesof(prototype))
+ L+= path
+ return L
diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index ed855c33b9..de606b137e 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -220,7 +220,6 @@ GLOBAL_LIST_INIT(skin_tones, list(
))
GLOBAL_LIST_EMPTY(species_list)
-GLOBAL_LIST_EMPTY(roundstart_species)
/proc/age2agedescription(age)
switch(age)
diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm
index 67179e8c8f..bfcfd23f50 100644
--- a/code/__HELPERS/names.dm
+++ b/code/__HELPERS/names.dm
@@ -1,246 +1,248 @@
-#define ION_FILE "ion_laws.json"
-
-/proc/lizard_name(gender)
- if(gender == MALE)
- return "[pick(GLOB.lizard_names_male)]-[pick(GLOB.lizard_names_male)]"
- else
- return "[pick(GLOB.lizard_names_female)]-[pick(GLOB.lizard_names_female)]"
-
-/proc/plasmaman_name()
- return "[pick(GLOB.plasmaman_names)] \Roman[rand(1,99)]"
-
-/proc/church_name()
- var/static/church_name
- if (church_name)
- return church_name
-
- var/name = ""
-
- name += pick("Holy", "United", "First", "Second", "Last")
-
- if (prob(20))
- name += " Space"
-
- name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
- name += " of [religion_name()]"
-
- return name
-
-GLOBAL_VAR(command_name)
-/proc/command_name()
- if (GLOB.command_name)
- return GLOB.command_name
-
- var/name = "Central Command"
-
- GLOB.command_name = name
- return name
-
-/proc/change_command_name(name)
-
- GLOB.command_name = name
-
- return name
-
-/proc/religion_name()
- var/static/religion_name
- if (religion_name)
- return religion_name
-
- var/name = ""
-
- name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob")
- name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity")
-
- return capitalize(name)
-
-/proc/station_name()
- if(!GLOB.station_name)
- var/newname
- if(config && config.station_name)
- newname = config.station_name
- else
- newname = new_station_name()
-
- set_station_name(newname)
-
- return GLOB.station_name
-
-/proc/set_station_name(newname)
- GLOB.station_name = newname
-
- if(config && config.server_name)
- world.name = "[config.server_name][config.server_name==GLOB.station_name ? "" : ": [GLOB.station_name]"]"
- else
- world.name = GLOB.station_name
-
-
-/proc/new_station_name()
- var/random = rand(1,5)
- var/name = ""
- var/new_station_name = ""
-
- //Rare: Pre-Prefix
- if (prob(10))
- name = pick(GLOB.station_prefixes)
- new_station_name = name + " "
- name = ""
-
- // Prefix
- for(var/holiday_name in SSevents.holidays)
- if(holiday_name == "Friday the 13th")
- random = 13
- var/datum/holiday/holiday = SSevents.holidays[holiday_name]
- name = holiday.getStationPrefix()
- //get normal name
- if(!name)
- name = pick(GLOB.station_names)
- if(name)
- new_station_name += name + " "
-
- // Suffix
- name = pick(GLOB.station_suffixes)
- new_station_name += name + " "
-
- // ID Number
- switch(random)
- if(1)
- new_station_name += "[rand(1, 99)]"
- if(2)
- new_station_name += pick(GLOB.greek_letters)
- if(3)
- new_station_name += "\Roman[rand(1,99)]"
- if(4)
- new_station_name += pick(GLOB.phonetic_alphabet)
- if(5)
- new_station_name += pick(GLOB.numbers_as_words)
- if(13)
- new_station_name += pick("13","XIII","Thirteen")
- return new_station_name
-
-/proc/syndicate_name()
- var/static/syndicate_name
- if (syndicate_name)
- return syndicate_name
-
- var/name = ""
-
- // Prefix
- name += pick("Clandestine", "Prima", "Blue", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Bonk", "Gene", "Gib")
-
- // Suffix
- if (prob(80))
- name += " "
-
- // Full
- if (prob(60))
- name += pick("Syndicate", "Consortium", "Collective", "Corporation", "Group", "Holdings", "Biotech", "Industries", "Systems", "Products", "Chemicals", "Enterprises", "Family", "Creations", "International", "Intergalactic", "Interplanetary", "Foundation", "Positronics", "Hive")
- // Broken
- else
- name += pick("Syndi", "Corp", "Bio", "System", "Prod", "Chem", "Inter", "Hive")
- name += pick("", "-")
- name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Code")
- // Small
- else
- name += pick("-", "*", "")
- name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Gen", "Star", "Dyne", "Code", "Hive")
-
- syndicate_name = name
- return name
-
-
-//Traitors and traitor silicons will get these. Revs will not.
-GLOBAL_VAR(syndicate_code_phrase) //Code phrase for traitors.
-GLOBAL_VAR(syndicate_code_response) //Code response for traitors.
-
- /*
- Should be expanded.
- How this works:
- Instead of "I'm looking for James Smith," the traitor would say "James Smith" as part of a conversation.
- Another traitor may then respond with: "They enjoy running through the void-filled vacuum of the derelict."
- The phrase should then have the words: James Smith.
- The response should then have the words: run, void, and derelict.
- This way assures that the code is suited to the conversation and is unpredicatable.
- Obviously, some people will be better at this than others but in theory, everyone should be able to do it and it only enhances roleplay.
- Can probably be done through "{ }" but I don't really see the practical benefit.
- One example of an earlier system is commented below.
- /N
- */
-
-/proc/generate_code_phrase(return_list=FALSE)//Proc is used for phrase and response in master_controller.dm
-
- if(!return_list)
- . = ""
- else
- . = list()
-
- var/words = pick(//How many words there will be. Minimum of two. 2, 4 and 5 have a lesser chance of being selected. 3 is the most likely.
- 50; 2,
- 200; 3,
- 50; 4,
- 25; 5
- )
-
- var/list/safety = list(1,2,3)//Tells the proc which options to remove later on.
- var/nouns = strings(ION_FILE, "ionabstract")
- var/objects = strings(ION_FILE, "ionobjects")
- var/adjectives = strings(ION_FILE, "ionadjectives")
- var/threats = strings(ION_FILE, "ionthreats")
- var/foods = strings(ION_FILE, "ionfood")
- var/drinks = strings(ION_FILE, "iondrinks")
- var/list/locations = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks //if null, defaults to drinks instead.
-
- var/list/names = list()
- for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest.
- names += t.fields["name"]
-
- var/maxwords = words//Extra var to check for duplicates.
-
- for(words,words>0,words--)//Randomly picks from one of the choices below.
-
- if(words==1&&(1 in safety)&&(2 in safety))//If there is only one word remaining and choice 1 or 2 have not been selected.
- safety = list(pick(1,2))//Select choice 1 or 2.
- else if(words==1&&maxwords==2)//Else if there is only one word remaining (and there were two originally), and 1 or 2 were chosen,
- safety = list(3)//Default to list 3
-
- switch(pick(safety))//Chance based on the safety list.
- if(1)//1 and 2 can only be selected once each to prevent more than two specific names/places/etc.
- switch(rand(1,2))//Mainly to add more options later.
- if(1)
- if(names.len&&prob(70))
- . += pick(names)
- else
- if(prob(10))
- . += pick(lizard_name(MALE),lizard_name(FEMALE))
- else
- var/new_name = pick(pick(GLOB.first_names_male,GLOB.first_names_female))
- new_name += " "
- new_name += pick(GLOB.last_names)
- . += new_name
- if(2)
- . += pick(get_all_jobs())//Returns a job.
- safety -= 1
- if(2)
- switch(rand(1,3))//Food, drinks, or things. Only selectable once.
- if(1)
- . += lowertext(pick(drinks))
- if(2)
- . += lowertext(pick(foods))
- if(3)
- . += lowertext(pick(locations))
- safety -= 2
- if(3)
- switch(rand(1,4))//Abstract nouns, objects, adjectives, threats. Can be selected more than once.
- if(1)
- . += lowertext(pick(nouns))
- if(2)
- . += lowertext(pick(objects))
- if(3)
- . += lowertext(pick(adjectives))
- if(4)
- . += lowertext(pick(threats))
- if(!return_list)
- if(words==1)
- . += "."
- else
- . += ", "
+#define ION_FILE "ion_laws.json"
+
+/proc/lizard_name(gender)
+ if(gender == MALE)
+ return "[pick(GLOB.lizard_names_male)]-[pick(GLOB.lizard_names_male)]"
+ else
+ return "[pick(GLOB.lizard_names_female)]-[pick(GLOB.lizard_names_female)]"
+
+/proc/plasmaman_name()
+ return "[pick(GLOB.plasmaman_names)] \Roman[rand(1,99)]"
+
+/proc/church_name()
+ var/static/church_name
+ if (church_name)
+ return church_name
+
+ var/name = ""
+
+ name += pick("Holy", "United", "First", "Second", "Last")
+
+ if (prob(20))
+ name += " Space"
+
+ name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses")
+ name += " of [religion_name()]"
+
+ return name
+
+GLOBAL_VAR(command_name)
+/proc/command_name()
+ if (GLOB.command_name)
+ return GLOB.command_name
+
+ var/name = "Central Command"
+
+ GLOB.command_name = name
+ return name
+
+/proc/change_command_name(name)
+
+ GLOB.command_name = name
+
+ return name
+
+/proc/religion_name()
+ var/static/religion_name
+ if (religion_name)
+ return religion_name
+
+ var/name = ""
+
+ name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob")
+ name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity")
+
+ return capitalize(name)
+
+/proc/station_name()
+ if(!GLOB.station_name)
+ var/newname
+ var/config_station_name = CONFIG_GET(string/stationname)
+ if(config_station_name)
+ newname = config_station_name
+ else
+ newname = new_station_name()
+
+ set_station_name(newname)
+
+ return GLOB.station_name
+
+/proc/set_station_name(newname)
+ GLOB.station_name = newname
+
+ var/config_server_name = CONFIG_GET(string/servername)
+ if(config_server_name)
+ world.name = "[config_server_name][config_server_name == GLOB.station_name ? "" : ": [GLOB.station_name]"]"
+ else
+ world.name = GLOB.station_name
+
+
+/proc/new_station_name()
+ var/random = rand(1,5)
+ var/name = ""
+ var/new_station_name = ""
+
+ //Rare: Pre-Prefix
+ if (prob(10))
+ name = pick(GLOB.station_prefixes)
+ new_station_name = name + " "
+ name = ""
+
+ // Prefix
+ for(var/holiday_name in SSevents.holidays)
+ if(holiday_name == "Friday the 13th")
+ random = 13
+ var/datum/holiday/holiday = SSevents.holidays[holiday_name]
+ name = holiday.getStationPrefix()
+ //get normal name
+ if(!name)
+ name = pick(GLOB.station_names)
+ if(name)
+ new_station_name += name + " "
+
+ // Suffix
+ name = pick(GLOB.station_suffixes)
+ new_station_name += name + " "
+
+ // ID Number
+ switch(random)
+ if(1)
+ new_station_name += "[rand(1, 99)]"
+ if(2)
+ new_station_name += pick(GLOB.greek_letters)
+ if(3)
+ new_station_name += "\Roman[rand(1,99)]"
+ if(4)
+ new_station_name += pick(GLOB.phonetic_alphabet)
+ if(5)
+ new_station_name += pick(GLOB.numbers_as_words)
+ if(13)
+ new_station_name += pick("13","XIII","Thirteen")
+ return new_station_name
+
+/proc/syndicate_name()
+ var/static/syndicate_name
+ if (syndicate_name)
+ return syndicate_name
+
+ var/name = ""
+
+ // Prefix
+ name += pick("Clandestine", "Prima", "Blue", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Bonk", "Gene", "Gib")
+
+ // Suffix
+ if (prob(80))
+ name += " "
+
+ // Full
+ if (prob(60))
+ name += pick("Syndicate", "Consortium", "Collective", "Corporation", "Group", "Holdings", "Biotech", "Industries", "Systems", "Products", "Chemicals", "Enterprises", "Family", "Creations", "International", "Intergalactic", "Interplanetary", "Foundation", "Positronics", "Hive")
+ // Broken
+ else
+ name += pick("Syndi", "Corp", "Bio", "System", "Prod", "Chem", "Inter", "Hive")
+ name += pick("", "-")
+ name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Code")
+ // Small
+ else
+ name += pick("-", "*", "")
+ name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Gen", "Star", "Dyne", "Code", "Hive")
+
+ syndicate_name = name
+ return name
+
+
+//Traitors and traitor silicons will get these. Revs will not.
+GLOBAL_VAR(syndicate_code_phrase) //Code phrase for traitors.
+GLOBAL_VAR(syndicate_code_response) //Code response for traitors.
+
+ /*
+ Should be expanded.
+ How this works:
+ Instead of "I'm looking for James Smith," the traitor would say "James Smith" as part of a conversation.
+ Another traitor may then respond with: "They enjoy running through the void-filled vacuum of the derelict."
+ The phrase should then have the words: James Smith.
+ The response should then have the words: run, void, and derelict.
+ This way assures that the code is suited to the conversation and is unpredicatable.
+ Obviously, some people will be better at this than others but in theory, everyone should be able to do it and it only enhances roleplay.
+ Can probably be done through "{ }" but I don't really see the practical benefit.
+ One example of an earlier system is commented below.
+ /N
+ */
+
+/proc/generate_code_phrase(return_list=FALSE)//Proc is used for phrase and response in master_controller.dm
+
+ if(!return_list)
+ . = ""
+ else
+ . = list()
+
+ var/words = pick(//How many words there will be. Minimum of two. 2, 4 and 5 have a lesser chance of being selected. 3 is the most likely.
+ 50; 2,
+ 200; 3,
+ 50; 4,
+ 25; 5
+ )
+
+ var/list/safety = list(1,2,3)//Tells the proc which options to remove later on.
+ var/nouns = strings(ION_FILE, "ionabstract")
+ var/objects = strings(ION_FILE, "ionobjects")
+ var/adjectives = strings(ION_FILE, "ionadjectives")
+ var/threats = strings(ION_FILE, "ionthreats")
+ var/foods = strings(ION_FILE, "ionfood")
+ var/drinks = strings(ION_FILE, "iondrinks")
+ var/list/locations = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks //if null, defaults to drinks instead.
+
+ var/list/names = list()
+ for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest.
+ names += t.fields["name"]
+
+ var/maxwords = words//Extra var to check for duplicates.
+
+ for(words,words>0,words--)//Randomly picks from one of the choices below.
+
+ if(words==1&&(1 in safety)&&(2 in safety))//If there is only one word remaining and choice 1 or 2 have not been selected.
+ safety = list(pick(1,2))//Select choice 1 or 2.
+ else if(words==1&&maxwords==2)//Else if there is only one word remaining (and there were two originally), and 1 or 2 were chosen,
+ safety = list(3)//Default to list 3
+
+ switch(pick(safety))//Chance based on the safety list.
+ if(1)//1 and 2 can only be selected once each to prevent more than two specific names/places/etc.
+ switch(rand(1,2))//Mainly to add more options later.
+ if(1)
+ if(names.len&&prob(70))
+ . += pick(names)
+ else
+ if(prob(10))
+ . += pick(lizard_name(MALE),lizard_name(FEMALE))
+ else
+ var/new_name = pick(pick(GLOB.first_names_male,GLOB.first_names_female))
+ new_name += " "
+ new_name += pick(GLOB.last_names)
+ . += new_name
+ if(2)
+ . += pick(get_all_jobs())//Returns a job.
+ safety -= 1
+ if(2)
+ switch(rand(1,3))//Food, drinks, or things. Only selectable once.
+ if(1)
+ . += lowertext(pick(drinks))
+ if(2)
+ . += lowertext(pick(foods))
+ if(3)
+ . += lowertext(pick(locations))
+ safety -= 2
+ if(3)
+ switch(rand(1,4))//Abstract nouns, objects, adjectives, threats. Can be selected more than once.
+ if(1)
+ . += lowertext(pick(nouns))
+ if(2)
+ . += lowertext(pick(objects))
+ if(3)
+ . += lowertext(pick(adjectives))
+ if(4)
+ . += lowertext(pick(threats))
+ if(!return_list)
+ if(words==1)
+ . += "."
+ else
+ . += ", "
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index ce8f9f9bd2..04fb2f32f7 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -19,7 +19,7 @@
return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that
/proc/format_table_name(table as text)
- return global.sqlfdbktableprefix + table
+ return CONFIG_GET(string/feedback_tableprefix) + table
/*
* Text sanitization
@@ -594,7 +594,7 @@ GLOBAL_LIST_INIT(binary, list("0","1"))
//in the json file and have it be reflected in the in game item/mob it came from.
//(That's what things like savefiles are for) Note that this list is not shuffled.
/proc/twitterize(list/proposed, filename, cullshort = 1, storemax = 1000)
- if(!islist(proposed) || !filename || !config.log_twitter)
+ if(!islist(proposed) || !filename || !CONFIG_GET(flag/log_twitter))
return
//Regular expressions are, as usual, absolute magic
diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm
index 60b5d82940..46d6c2ce5c 100644
--- a/code/__HELPERS/type2type.dm
+++ b/code/__HELPERS/type2type.dm
@@ -554,3 +554,24 @@
else
return /datum
return text2path(copytext(string_type, 1, last_slash))
+
+//returns a string the last bit of a type, without the preceeding '/'
+/proc/type2top(the_type)
+ //handle the builtins manually
+ if(!ispath(the_type))
+ return
+ switch(the_type)
+ if(/datum)
+ return "datum"
+ if(/atom)
+ return "atom"
+ if(/obj)
+ return "obj"
+ if(/mob)
+ return "mob"
+ if(/area)
+ return "area"
+ if(/turf)
+ return "turf"
+ else //regex everything else (works for /proc too)
+ return lowertext(replacetext("[the_type]", "[type2parent(the_type)]/", ""))
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index c2398982c2..905babe848 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -1266,7 +1266,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types())
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
-#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qel(L[I]); L.Cut(); }
+#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }
/proc/______qdel_list_wrapper(list/L) //the underscores are to encourage people not to use this directly.
QDEL_LIST(L)
diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm
index 83bf3cfb5a..391744e34c 100644
--- a/code/_globalvars/configuration.dm
+++ b/code/_globalvars/configuration.dm
@@ -1,4 +1,4 @@
-GLOBAL_REAL(config, /datum/configuration)
+GLOBAL_REAL(config, /datum/controller/configuration)
GLOBAL_DATUM_INIT(revdata, /datum/getrev, new)
@@ -11,9 +11,7 @@ GLOBAL_VAR_INIT(hub_visibility, FALSE)
GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently
GLOBAL_VAR_INIT(dooc_allowed, TRUE)
-GLOBAL_VAR_INIT(abandon_allowed, TRUE)
GLOBAL_VAR_INIT(enter_allowed, TRUE)
-GLOBAL_VAR_INIT(guests_allowed, TRUE)
GLOBAL_VAR_INIT(shuttle_frozen, FALSE)
GLOBAL_VAR_INIT(shuttle_left, FALSE)
GLOBAL_VAR_INIT(tinted_weldhelh, TRUE)
@@ -25,10 +23,16 @@ GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch
GLOBAL_VAR_INIT(Debug2, FALSE)
//This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage
+//Protecting these because the proper way to edit them is with the config/secrets
GLOBAL_VAR_INIT(MAX_EX_DEVESTATION_RANGE, 3)
+GLOBAL_PROTECT(MAX_EX_DEVESTATION_RANGE)
GLOBAL_VAR_INIT(MAX_EX_HEAVY_RANGE, 7)
+GLOBAL_PROTECT(MAX_EX_HEAVY_RANGE)
GLOBAL_VAR_INIT(MAX_EX_LIGHT_RANGE, 14)
+GLOBAL_PROTECT(MAX_EX_LIGHT_RANGE)
GLOBAL_VAR_INIT(MAX_EX_FLASH_RANGE, 14)
+GLOBAL_PROTECT(MAX_EX_FLASH_RANGE)
GLOBAL_VAR_INIT(MAX_EX_FLAME_RANGE, 14)
+GLOBAL_PROTECT(MAX_EX_FLAME_RANGE)
GLOBAL_VAR_INIT(DYN_EX_SCALE, 0.5)
diff --git a/code/_globalvars/sensitive.dm b/code/_globalvars/sensitive.dm
deleted file mode 100644
index e1a02621ac..0000000000
--- a/code/_globalvars/sensitive.dm
+++ /dev/null
@@ -1,16 +0,0 @@
-//Server API key
-GLOBAL_REAL_VAR(comms_key) = "default_pwd"
-GLOBAL_REAL_VAR(comms_allowed) = FALSE //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable)
-
-GLOBAL_REAL_VAR(medal_hub)
-GLOBAL_REAL_VAR(medal_pass) = " "
-GLOBAL_REAL_VAR(medals_enabled) = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls.
-
-// MySQL configuration
-
-GLOBAL_REAL_VAR(sqladdress) = "localhost"
-GLOBAL_REAL_VAR(sqlport) = "3306"
-GLOBAL_REAL_VAR(sqlfdbkdb) = "test"
-GLOBAL_REAL_VAR(sqlfdbklogin) = "root"
-GLOBAL_REAL_VAR(sqlfdbkpass) = ""
-GLOBAL_REAL_VAR(sqlfdbktableprefix) = ""
diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm
index 0c0baccc56..1e4a574e13 100644
--- a/code/controllers/configuration.dm
+++ b/code/controllers/configuration.dm
@@ -1,296 +1,156 @@
-//Configuraton defines //TODO: Move all yes/no switches into bitflags
-
-//Used by jobs_have_maint_access
-#define ASSISTANTS_HAVE_MAINT_ACCESS 1
-#define SECURITY_HAS_MAINT_ACCESS 2
-#define EVERYONE_HAS_MAINT_ACCESS 4
-
GLOBAL_VAR_INIT(config_dir, "config/")
GLOBAL_PROTECT(config_dir)
+/datum/controller/configuration
+ name = "Configuration"
+
+ var/hiding_entries_by_type = TRUE //Set for readability, admins can set this to FALSE if they want to debug it
+ var/list/entries
+ var/list/entries_by_type
+
+ var/list/maplist
+ var/datum/map_config/defaultmap
+
+ var/list/modes // allowed modes
+ var/list/gamemode_cache
+ var/list/votable_modes // votable modes
+ var/list/mode_names
+ var/list/mode_reports
+ var/list/mode_false_report_weight
+
+/datum/controller/configuration/New()
+ config = src
+ var/list/config_files = InitEntries()
+ LoadModes()
+ for(var/I in config_files)
+ LoadEntries(I)
+ if(Get(/datum/config_entry/flag/maprotation))
+ loadmaplist(CONFIG_MAPS_FILE)
+
+/datum/controller/configuration/Destroy()
+ entries_by_type.Cut()
+ QDEL_LIST_ASSOC_VAL(entries)
+ QDEL_LIST_ASSOC_VAL(maplist)
+ QDEL_NULL(defaultmap)
+
+ config = null
-/datum/configuration/can_vv_get(var_name)
- var/static/list/banned_gets = list("autoadmin", "autoadmin_rank")
- if (var_name in banned_gets)
- return FALSE
return ..()
-/datum/configuration/vv_edit_var(var_name, var_value)
- var/static/list/banned_edits = list("cross_address", "cross_allowed", "autoadmin", "autoadmin_rank", "invoke_youtubedl")
- if(var_name in banned_edits)
- return FALSE
- return ..()
+/datum/controller/configuration/proc/InitEntries()
+ var/list/_entries = list()
+ entries = _entries
+ var/list/_entries_by_type = list()
+ entries_by_type = _entries_by_type
-/datum/configuration
- var/name = "Configuration" // datum name
+ . = list()
- var/autoadmin = 0
- var/autoadmin_rank = "Game Admin"
+ for(var/I in typesof(/datum/config_entry)) //typesof is faster in this case
+ var/datum/config_entry/E = I
+ if(initial(E.abstract_type) == I)
+ continue
+ E = new I
+ _entries_by_type[I] = E
+ var/esname = E.name
+ var/datum/config_entry/test = _entries[esname]
+ if(test)
+ log_config("Error: [test.type] has the same name as [E.type]: [esname]! Not initializing [E.type]!")
+ qdel(E)
+ continue
+ _entries[esname] = E
+ .[E.resident_file] = TRUE
- var/server_name = null // server name (the name of the game window)
- var/server_sql_name = null // short form server name used for the DB
- var/station_name = null // station name (the name of the station in-game)
- var/lobby_countdown = 120 // In between round countdown.
- var/round_end_countdown = 25 // Post round murder death kill countdown
- var/hub = 0
+/datum/controller/configuration/proc/RemoveEntry(datum/config_entry/CE)
+ entries -= CE.name
+ entries_by_type -= CE.type
- var/log_ooc = 0 // log OOC channel
- var/log_access = 0 // log login/logout
- var/log_say = 0 // log client say
- var/log_admin = 0 // log admin actions
- var/log_game = 0 // log game events
- var/log_vote = 0 // log voting
- var/log_whisper = 0 // log client whisper
- var/log_prayer = 0 // log prayers
- var/log_law = 0 // log lawchanges
- var/log_emote = 0 // log emotes
- var/log_attack = 0 // log attack messages
- var/log_adminchat = 0 // log admin chat messages
- var/log_pda = 0 // log pda messages
- var/log_twitter = 0 // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.
- var/log_world_topic = 0 // log all world.Topic() calls
- var/sql_enabled = 0 // for sql switching
- var/allow_admin_ooccolor = 0 // Allows admins with relevant permissions to have their own ooc colour
- var/allow_vote_restart = 0 // allow votes to restart
- var/allow_vote_mode = 0 // allow votes to change mode
- var/vote_delay = 6000 // minimum time between voting sessions (deciseconds, 10 minute default)
- var/vote_period = 600 // length of voting period (deciseconds, default 1 minute)
- var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi)
- var/vote_no_dead = 0 // dead people can't vote (tbi)
- var/del_new_on_log = 1 // del's new players if they log before they spawn in
- var/allow_Metadata = 0 // Metadata is supported.
- var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
- var/fps = 20
- var/allow_holidays = 0 //toggles whether holiday-specific content should be used
- var/tick_limit_mc_init = TICK_LIMIT_MC_INIT_DEFAULT //SSinitialization throttling
+/datum/controller/configuration/proc/LoadEntries(filename)
+ log_config("Loading config file [filename]...")
+ var/list/lines = world.file2list("[GLOB.config_dir][filename]")
+ var/list/_entries = entries
+ for(var/L in lines)
+ if(!L)
+ continue
- var/hostedby = null
- var/respawn = 1
- var/guest_jobban = 1
- var/usewhitelist = 0
- var/inactivity_period = 3000 //time in ds until a player is considered inactive
- var/afk_period = 6000 //time in ds until a player is considered afk and kickable
- var/kick_inactive = FALSE //force disconnect for inactive players
- var/load_jobs_from_txt = 0
- var/automute_on = 0 //enables automuting/spam prevention
- var/minimal_access_threshold = 0 //If the number of players is larger than this threshold, minimal access will be turned on.
- var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access.
- var/jobs_have_maint_access = 0 //Who gets maint access? See defines above.
- var/sec_start_brig = 0 //makes sec start in brig or dept sec posts
+ if(copytext(L, 1, 2) == "#")
+ continue
- var/server
- var/banappeals
- var/wikiurl = "http://www.tgstation13.org/wiki" // Default wiki link.
- var/forumurl = "http://tgstation13.org/phpBB/index.php" //default forums
- var/rulesurl = "http://www.tgstation13.org/wiki/Rules" // default rules
- var/githuburl = "https://www.github.com/tgstation/-tg-station" //default github
- var/githubrepoid
+ var/pos = findtext(L, " ")
+ var/entry = null
+ var/value = null
- var/forbid_singulo_possession = 0
- var/useircbot = 0
+ if(pos)
+ entry = lowertext(copytext(L, 1, pos))
+ value = copytext(L, pos + 1)
+ else
+ entry = lowertext(L)
- var/check_randomizer = 0
+ if(!entry)
+ continue
- var/panic_server_name
- var/panic_address //Reconnect a player this linked server if this server isn't accepting new players
+ var/datum/config_entry/E = _entries[entry]
+ if(!E)
+ log_config("Unknown setting in configuration: '[entry]'")
+ continue
- var/invoke_youtubedl
+ if(filename != E.resident_file)
+ log_config("Found [entry] in [filename] when it should have been in [E.resident_file]! Ignoring.")
+ continue
- //IP Intel vars
- var/ipintel_email
- var/ipintel_rating_bad = 1
- var/ipintel_save_good = 12
- var/ipintel_save_bad = 1
- var/ipintel_domain = "check.getipintel.net"
+ var/validated = E.ValidateAndSet(value)
+ if(!validated)
+ log_config("Failed to validate setting \"[value]\" for [entry]")
+ else if(E.modified && !E.dupes_allowed)
+ log_config("Duplicate setting for [entry] ([value]) detected! Using latest.")
- var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt
- var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt
- var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database
- var/use_account_age_for_jobs = 0 //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected.
- var/see_own_notes = 0 //Can players see their own admin notes (read-only)? Config option in config.txt
- var/note_fresh_days
- var/note_stale_days
+ if(validated)
+ E.modified = TRUE
- var/use_exp_tracking = FALSE
- var/use_exp_restrictions_heads = FALSE
- var/use_exp_restrictions_heads_hours = 0
- var/use_exp_restrictions_heads_department = FALSE
- var/use_exp_restrictions_other = FALSE
- var/use_exp_restrictions_admin_bypass = FALSE
+/datum/controller/configuration/can_vv_get(var_name)
+ return (var_name != "entries_by_type" || !hiding_entries_by_type) && ..()
- //Population cap vars
- var/soft_popcap = 0
- var/hard_popcap = 0
- var/extreme_popcap = 0
- var/soft_popcap_message = "Be warned that the server is currently serving a high number of users, consider using alternative game servers."
- var/hard_popcap_message = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers."
- var/extreme_popcap_message = "The server is currently serving a high number of users, find alternative servers."
+/datum/controller/configuration/vv_edit_var(var_name, var_value)
+ return !(var_name in list("entries_by_type", "entries")) && ..()
- //game_options.txt configs
- var/force_random_names = 0
- var/list/mode_names = list()
- var/list/mode_reports = list()
- var/list/mode_false_report_weight = list()
- var/list/modes = list() // allowed modes
- var/list/votable_modes = list() // votable modes
- var/list/probabilities = list() // relative probability of each mode
- var/list/min_pop = list() // overrides for acceptible player counts in a mode
- var/list/max_pop = list()
- var/list/repeated_mode_adjust = list() // weight adjustments for recent modes
- var/humans_need_surnames = 0
- var/allow_ai = 0 // allow ai job
- var/forbid_secborg = 0 // disallow secborg module to be chosen.
- var/forbid_peaceborg = 0
- var/panic_bunker = 0 // prevents new people it hasn't seen before from connecting
- var/notify_new_player_age = 0 // how long do we notify admins of a new player
- var/notify_new_player_account_age = 0 // how long do we notify admins of a new byond account
- var/irc_first_connection_alert = 0 // do we notify the irc channel when somebody is connecting for the first time?
+/datum/controller/configuration/stat_entry()
+ if(!statclick)
+ statclick = new/obj/effect/statclick/debug(null, "Edit", src)
+ stat("[name]:", statclick)
- var/traitor_scaling_coeff = 6 //how much does the amount of players get divided by to determine traitors
- var/brother_scaling_coeff = 25 //how many players per brother team
- var/changeling_scaling_coeff = 6 //how much does the amount of players get divided by to determine changelings
- var/security_scaling_coeff = 8 //how much does the amount of players get divided by to determine open security officer positions
- var/abductor_scaling_coeff = 15 //how many players per abductor team
+/datum/controller/configuration/proc/Get(entry_type)
+ if(IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "\ref[src]")
+ log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]")
+ return
+ var/datum/config_entry/E = entry_type
+ var/entry_is_abstract = initial(E.abstract_type) == entry_type
+ if(entry_is_abstract)
+ CRASH("Tried to retrieve an abstract config_entry: [entry_type]")
+ E = entries_by_type[entry_type]
+ if(!E)
+ CRASH("Missing config entry for [entry_type]!")
+ return E.value
- var/traitor_objectives_amount = 2
- var/brother_objectives_amount = 2
- var/protect_roles_from_antagonist = 0 //If security and such can be traitor/cult/other
- var/protect_assistant_from_antagonist = 0 //If assistants can be traitor/cult/other
- var/enforce_human_authority = 0 //If non-human species are barred from joining as a head of staff
- var/allow_latejoin_antagonists = 0 // If late-joining players can be traitor/changeling
- var/list/continuous = list() // which roundtypes continue if all antagonists die
- var/list/midround_antag = list() // which roundtypes use the midround antagonist system
- var/midround_antag_time_check = 60 // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system
- var/midround_antag_life_check = 0.7 // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist
- var/shuttle_refuel_delay = 12000
- var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen
- var/mutant_races = 0 //players can choose their mutant race before joining the game
- var/list/roundstart_races = list() //races you can play as from the get go. If left undefined the game's roundstart var for species is used
- var/mutant_humans = 0 //players can pick mutant bodyparts for humans before joining the game
+/datum/controller/configuration/proc/Set(entry_type, new_val)
+ if(IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Set" && GLOB.LastAdminCalledTargetRef == "\ref[src]")
+ log_admin_private("Config rewrite of [entry_type] to [new_val] attempted by [key_name(usr)]")
+ return
+ var/datum/config_entry/E = entry_type
+ var/entry_is_abstract = initial(E.abstract_type) == entry_type
+ if(entry_is_abstract)
+ CRASH("Tried to retrieve an abstract config_entry: [entry_type]")
+ E = entries_by_type[entry_type]
+ if(!E)
+ CRASH("Missing config entry for [entry_type]!")
+ return E.ValidateAndSet(new_val)
- var/no_summon_guns //No
- var/no_summon_magic //Fun
- var/no_summon_events //Allowed
-
- var/intercept = 1 //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes.
- var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
- var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
- var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed."
- var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
- var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
- var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
-
- var/revival_pod_plants = FALSE
- var/revival_cloning = FALSE
- var/revival_brain_life = -1
-
- var/rename_cyborg = 0
- var/ooc_during_round = 0
- var/emojis = 0
- var/no_credits_round_end = FALSE
-
- //Used for modifying movement speed for mobs.
- //Unversal modifiers
- var/run_speed = 0
- var/walk_speed = 0
-
- //Mob specific modifiers. NOTE: These will affect different mob types in different ways
- var/human_delay = 0
- var/robot_delay = 0
- var/monkey_delay = 0
- var/alien_delay = 0
- var/slime_delay = 0
- var/animal_delay = 0
-
- var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour.
- var/ghost_interaction = 0
-
- var/silent_ai = 0
- var/silent_borg = 0
-
- var/damage_multiplier = 1 //Modifier for damage to all mobs. Impacts healing as well.
-
- var/allowwebclient = 0
- var/webclientmembersonly = 0
-
- var/sandbox_autoclose = FALSE // close the sandbox panel after spawning an item, potentially reducing griff
-
- var/default_laws = 0 //Controls what laws the AI spawns with.
- var/silicon_max_law_amount = 12
- var/list/lawids = list()
-
- var/list/law_weights = list()
-
- var/assistant_cap = -1
-
- var/starlight = 0
- var/generate_minimaps = 0
- var/grey_assistants = 0
-
- var/id_console_jobslot_delay = 30
-
- var/lavaland_budget = 60
- var/space_budget = 16
-
- var/aggressive_changelog = 0
-
- var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors
-
- var/autoconvert_notes = 0 //if all connecting player's notes should attempt to be converted to the database
-
- var/announce_admin_logout = 0
- var/announce_admin_login = 0
-
- var/list/datum/map_config/maplist = list()
- var/datum/map_config/defaultmap = null
- var/maprotation = 1
- var/maprotatechancedelta = 0.75
- var/allow_map_voting = TRUE
-
- // Enables random events mid-round when set to 1
- var/allow_random_events = 0
-
- // Multipliers for random events minimal starting time and minimal players amounts
- var/events_min_time_mul = 1
- var/events_min_players_mul = 1
-
- // The object used for the clickable stat() button.
- var/obj/effect/statclick/statclick
-
- var/client_warn_version = 0
- var/client_warn_message = "Your version of byond may have issues or be blocked from accessing this server in the future."
- var/client_error_version = 0
- var/client_error_message = "Your version of byond is too old, may have issues, and is blocked from accessing this server."
-
- var/cross_name = "Other server"
- var/cross_address = "byond://"
- var/cross_allowed = FALSE
- var/showircname = 0
-
- var/list/gamemode_cache = null
-
- var/minutetopiclimit
- var/secondtopiclimit
-
- var/error_cooldown = 600 // The "cooldown" time for each occurrence of a unique error
- var/error_limit = 50 // How many occurrences before the next will silence them
- var/error_silence_time = 6000 // How long a unique error will be silenced for
- var/error_msg_delay = 50 // How long to wait between messaging admins about occurrences of a unique error
-
- var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
- var/arrivals_shuttle_require_undocked = FALSE //Require the arrivals shuttle to be undocked before latejoiners can join
- var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join
-
- var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart.
-
- var/irc_announce_new_game = FALSE
-
- var/list/policies = list()
-
- var/debug_admin_hrefs = FALSE //turns off admin href token protection for debugging purposes
-
-/datum/configuration/New()
- gamemode_cache = typecacheof(/datum/game_mode,TRUE)
+/datum/controller/configuration/proc/LoadModes()
+ gamemode_cache = typecacheof(/datum/game_mode, TRUE)
+ modes = list()
+ mode_names = list()
+ mode_reports = list()
+ mode_false_report_weight = list()
+ votable_modes = list()
+ var/list/probabilities = Get(/datum/config_entry/keyed_number_list/probability)
for(var/T in gamemode_cache)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
@@ -298,7 +158,6 @@ GLOBAL_PROTECT(config_dir)
if(M.config_tag)
if(!(M.config_tag in modes)) // ensure each mode is added only once
- WRITE_FILE(GLOB.config_error_log, "Adding game mode [M.name] ([M.config_tag]) to configuration.")
modes += M.config_tag
mode_names[M.config_tag] = M.name
probabilities[M.config_tag] = M.probability
@@ -309,558 +168,7 @@ GLOBAL_PROTECT(config_dir)
qdel(M)
votable_modes += "secret"
- Reload()
-
-/datum/configuration/proc/Reload()
- load("config.txt")
- load("comms.txt", "comms")
- load("game_options.txt","game_options")
- load("policies.txt", "policies")
- loadsql("dbconfig.txt")
- reload_custom_roundstart_items_list()
- if (maprotation)
- loadmaplist("maps.txt")
-
- // apply some settings from config..
- GLOB.abandon_allowed = respawn
-
-/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
- filename = "[GLOB.config_dir][filename]"
- var/list/Lines = world.file2list(filename)
-
- for(var/t in Lines)
- if(!t)
- continue
-
- t = trim(t)
- if(length(t) == 0)
- continue
- else if(copytext(t, 1, 2) == "#")
- continue
-
- var/pos = findtext(t, " ")
- var/name = null
- var/value = null
-
- if(pos)
- name = lowertext(copytext(t, 1, pos))
- value = copytext(t, pos + 1)
- else
- name = lowertext(t)
-
- if(!name)
- continue
-
- if(type == "config")
- switch(name)
- if("hub")
- hub = 1
- if("admin_legacy_system")
- admin_legacy_system = 1
- if("ban_legacy_system")
- ban_legacy_system = 1
- if("use_age_restriction_for_jobs")
- use_age_restriction_for_jobs = 1
- if("use_account_age_for_jobs")
- use_account_age_for_jobs = 1
- if("use_exp_tracking")
- use_exp_tracking = TRUE
- if("use_exp_restrictions_heads")
- use_exp_restrictions_heads = TRUE
- if("use_exp_restrictions_heads_hours")
- use_exp_restrictions_heads_hours = text2num(value)
- if("use_exp_restrictions_heads_department")
- use_exp_restrictions_heads_department = TRUE
- if("use_exp_restrictions_other")
- use_exp_restrictions_other = TRUE
- if("use_exp_restrictions_admin_bypass")
- use_exp_restrictions_admin_bypass = TRUE
- if("lobby_countdown")
- lobby_countdown = text2num(value)
- if("round_end_countdown")
- round_end_countdown = text2num(value)
- if("log_ooc")
- log_ooc = 1
- if("log_access")
- log_access = 1
- if("log_say")
- log_say = 1
- if("log_admin")
- log_admin = 1
- if("log_prayer")
- log_prayer = 1
- if("log_law")
- log_law = 1
- if("log_game")
- log_game = 1
- if("log_vote")
- log_vote = 1
- if("log_whisper")
- log_whisper = 1
- if("log_attack")
- log_attack = 1
- if("log_emote")
- log_emote = 1
- if("log_adminchat")
- log_adminchat = 1
- if("log_pda")
- log_pda = 1
- if("log_twitter")
- log_twitter = 1
- if("log_world_topic")
- log_world_topic = 1
- if("allow_admin_ooccolor")
- allow_admin_ooccolor = 1
- if("allow_vote_restart")
- allow_vote_restart = 1
- if("allow_vote_mode")
- allow_vote_mode = 1
- if("no_dead_vote")
- vote_no_dead = 1
- if("default_no_vote")
- vote_no_default = 1
- if("vote_delay")
- vote_delay = text2num(value)
- if("vote_period")
- vote_period = text2num(value)
- if("norespawn")
- respawn = 0
- if("servername")
- server_name = value
- if("serversqlname")
- server_sql_name = value
- if("stationname")
- station_name = value
- if("hostedby")
- hostedby = value
- if("server")
- server = value
- if("banappeals")
- banappeals = value
- if("wikiurl")
- wikiurl = value
- if("forumurl")
- forumurl = value
- if("rulesurl")
- rulesurl = value
- if("githuburl")
- githuburl = value
- if("githubrepoid")
- githubrepoid = value
- if("guest_jobban")
- guest_jobban = 1
- if("guest_ban")
- GLOB.guests_allowed = 0
- if("usewhitelist")
- usewhitelist = TRUE
- if("allow_metadata")
- allow_Metadata = 1
- if("id_console_jobslot_delay")
- id_console_jobslot_delay = text2num(value)
- if("inactivity_period")
- inactivity_period = text2num(value) * 10 //documented as seconds in config.txt
- if("afk_period")
- afk_period = text2num(value) * 10 // ^^^
- if("kick_inactive")
- kick_inactive = TRUE
- if("load_jobs_from_txt")
- load_jobs_from_txt = 1
- if("forbid_singulo_possession")
- forbid_singulo_possession = 1
- if("popup_admin_pm")
- popup_admin_pm = 1
- if("allow_holidays")
- allow_holidays = 1
- if("useircbot") //tgs2 support
- useircbot = 1
- if("ticklag")
- var/ticklag = text2num(value)
- if(ticklag > 0)
- fps = 10 / ticklag
- if("tick_limit_mc_init")
- tick_limit_mc_init = text2num(value)
- if("fps")
- fps = text2num(value)
- if("automute_on")
- automute_on = 1
- if("panic_server_name")
- if (value != "\[Put the name here\]")
- panic_server_name = value
- if("panic_server_address")
- if(value != "byond://address:port")
- panic_address = value
- if("invoke_youtubedl")
- invoke_youtubedl = value
- if("show_irc_name")
- showircname = 1
- if("see_own_notes")
- see_own_notes = 1
- if("note_fresh_days")
- note_fresh_days = text2num(value)
- if("note_stale_days")
- note_stale_days = text2num(value)
- if("soft_popcap")
- soft_popcap = text2num(value)
- if("hard_popcap")
- hard_popcap = text2num(value)
- if("extreme_popcap")
- extreme_popcap = text2num(value)
- if("soft_popcap_message")
- soft_popcap_message = value
- if("hard_popcap_message")
- hard_popcap_message = value
- if("extreme_popcap_message")
- extreme_popcap_message = value
- if("panic_bunker")
- panic_bunker = 1
- if("notify_new_player_age")
- notify_new_player_age = text2num(value)
- if("notify_new_player_account_age")
- notify_new_player_account_age = text2num(value)
- if("irc_first_connection_alert")
- irc_first_connection_alert = 1
- if("check_randomizer")
- check_randomizer = 1
- if("ipintel_email")
- if (value != "ch@nge.me")
- ipintel_email = value
- if("ipintel_rating_bad")
- ipintel_rating_bad = text2num(value)
- if("ipintel_domain")
- ipintel_domain = value
- if("ipintel_save_good")
- ipintel_save_good = text2num(value)
- if("ipintel_save_bad")
- ipintel_save_bad = text2num(value)
- if("aggressive_changelog")
- aggressive_changelog = 1
- if("autoconvert_notes")
- autoconvert_notes = 1
- if("allow_webclient")
- allowwebclient = 1
- if("webclient_only_byond_members")
- webclientmembersonly = 1
- if("announce_admin_logout")
- announce_admin_logout = 1
- if("announce_admin_login")
- announce_admin_login = 1
- if("maprotation")
- maprotation = 1
- if("allow_map_voting")
- allow_map_voting = text2num(value)
- if("maprotationchancedelta")
- maprotatechancedelta = text2num(value)
- if("autoadmin")
- autoadmin = 1
- if(value)
- autoadmin_rank = ckeyEx(value)
- if("generate_minimaps")
- generate_minimaps = 1
- if("client_warn_version")
- client_warn_version = text2num(value)
- if("client_warn_message")
- client_warn_message = value
- if("client_error_version")
- client_error_version = text2num(value)
- if("client_error_message")
- client_error_message = value
- if("minute_topic_limit")
- minutetopiclimit = text2num(value)
- if("second_topic_limit")
- secondtopiclimit = text2num(value)
- if("error_cooldown")
- error_cooldown = text2num(value)
- if("error_limit")
- error_limit = text2num(value)
- if("error_silence_time")
- error_silence_time = text2num(value)
- if("error_msg_delay")
- error_msg_delay = text2num(value)
- if("irc_announce_new_game")
- irc_announce_new_game = TRUE
- if("debug_admin_hrefs")
- debug_admin_hrefs = TRUE
- else
-#if DM_VERSION > 511
-#error Replace the line below with WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'")
-#endif
- HandleCommsConfig(name, value) //TODO: Deprecate this eventually
- else if(type == "comms")
- HandleCommsConfig(name, value)
- else if(type == "game_options")
- switch(name)
- if("damage_multiplier")
- damage_multiplier = text2num(value)
- if("revival_pod_plants")
- revival_pod_plants = TRUE
- if("revival_cloning")
- revival_cloning = TRUE
- if("revival_brain_life")
- revival_brain_life = text2num(value)
- if("rename_cyborg")
- rename_cyborg = 1
- if("ooc_during_round")
- ooc_during_round = 1
- if("emojis")
- emojis = 1
- if("no_credits_round_end")
- no_credits_round_end = TRUE
- if("run_delay")
- run_speed = text2num(value)
- if("walk_delay")
- walk_speed = text2num(value)
- if("human_delay")
- human_delay = text2num(value)
- if("robot_delay")
- robot_delay = text2num(value)
- if("monkey_delay")
- monkey_delay = text2num(value)
- if("alien_delay")
- alien_delay = text2num(value)
- if("slime_delay")
- slime_delay = text2num(value)
- if("animal_delay")
- animal_delay = text2num(value)
- if("alert_red_upto")
- alert_desc_red_upto = value
- if("alert_red_downto")
- alert_desc_red_downto = value
- if("alert_blue_downto")
- alert_desc_blue_downto = value
- if("alert_blue_upto")
- alert_desc_blue_upto = value
- if("alert_green")
- alert_desc_green = value
- if("alert_delta")
- alert_desc_delta = value
- if("no_intercept_report")
- intercept = 0
- if("assistants_have_maint_access")
- jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS
- if("security_has_maint_access")
- jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS
- if("everyone_has_maint_access")
- jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS
- if("sec_start_brig")
- sec_start_brig = 1
- if("gateway_delay")
- gateway_delay = text2num(value)
- if("continuous")
- var/mode_name = lowertext(value)
- if(mode_name in modes)
- continuous[mode_name] = 1
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown continuous configuration definition: [mode_name].")
- if("midround_antag")
- var/mode_name = lowertext(value)
- if(mode_name in modes)
- midround_antag[mode_name] = 1
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown midround antagonist configuration definition: [mode_name].")
- if("midround_antag_time_check")
- midround_antag_time_check = text2num(value)
- if("midround_antag_life_check")
- midround_antag_life_check = text2num(value)
- if("min_pop")
- var/pop_pos = findtext(value, " ")
- var/mode_name = null
- var/mode_value = null
-
- if(pop_pos)
- mode_name = lowertext(copytext(value, 1, pop_pos))
- mode_value = copytext(value, pop_pos + 1)
- if(mode_name in modes)
- min_pop[mode_name] = text2num(mode_value)
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown minimum population configuration definition: [mode_name].")
- else
- WRITE_FILE(GLOB.config_error_log, "Incorrect minimum population configuration definition: [mode_name] [mode_value].")
- if("max_pop")
- var/pop_pos = findtext(value, " ")
- var/mode_name = null
- var/mode_value = null
-
- if(pop_pos)
- mode_name = lowertext(copytext(value, 1, pop_pos))
- mode_value = copytext(value, pop_pos + 1)
- if(mode_name in modes)
- max_pop[mode_name] = text2num(mode_value)
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown maximum population configuration definition: [mode_name].")
- else
- WRITE_FILE(GLOB.config_error_log, "Incorrect maximum population configuration definition: [mode_name] [mode_value].")
- if("shuttle_refuel_delay")
- shuttle_refuel_delay = text2num(value)
- if("show_game_type_odds")
- show_game_type_odds = 1
- if("ghost_interaction")
- ghost_interaction = 1
- if("traitor_scaling_coeff")
- traitor_scaling_coeff = text2num(value)
- if("brother_scaling_coeff")
- brother_scaling_coeff = text2num(value)
- if("changeling_scaling_coeff")
- changeling_scaling_coeff = text2num(value)
- if("security_scaling_coeff")
- security_scaling_coeff = text2num(value)
- if("abductor_scaling_coeff")
- abductor_scaling_coeff = text2num(value)
- if("traitor_objectives_amount")
- traitor_objectives_amount = text2num(value)
- if("brother_objectives_amount")
- brother_objectives_amount = text2num(value)
- if("probability")
- var/prob_pos = findtext(value, " ")
- var/prob_name = null
- var/prob_value = null
-
- if(prob_pos)
- prob_name = lowertext(copytext(value, 1, prob_pos))
- prob_value = copytext(value, prob_pos + 1)
- if(prob_name in modes)
- probabilities[prob_name] = text2num(prob_value)
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown game mode probability configuration definition: [prob_name].")
- else
- WRITE_FILE(GLOB.config_error_log, "Incorrect probability configuration definition: [prob_name] [prob_value].")
- if("repeated_mode_adjust")
- if(value)
- repeated_mode_adjust.Cut()
- var/values = splittext(value," ")
- for(var/v in values)
- repeated_mode_adjust += text2num(v)
- else
- WRITE_FILE(GLOB.config_error_log, "Incorrect round weight adjustment configuration definition for [value].")
- if("protect_roles_from_antagonist")
- protect_roles_from_antagonist = 1
- if("protect_assistant_from_antagonist")
- protect_assistant_from_antagonist = 1
- if("enforce_human_authority")
- enforce_human_authority = 1
- if("allow_latejoin_antagonists")
- allow_latejoin_antagonists = 1
- if("allow_random_events")
- allow_random_events = 1
-
- if("events_min_time_mul")
- events_min_time_mul = text2num(value)
- if("events_min_players_mul")
- events_min_players_mul = text2num(value)
-
- if("minimal_access_threshold")
- minimal_access_threshold = text2num(value)
- if("jobs_have_minimal_access")
- jobs_have_minimal_access = 1
- if("humans_need_surnames")
- humans_need_surnames = 1
- if("force_random_names")
- force_random_names = 1
- if("allow_ai")
- allow_ai = 1
- if("disable_secborg")
- forbid_secborg = 1
- if("disable_peaceborg")
- forbid_peaceborg = 1
- if("silent_ai")
- silent_ai = 1
- if("silent_borg")
- silent_borg = 1
- if("sandbox_autoclose")
- sandbox_autoclose = 1
- if("default_laws")
- default_laws = text2num(value)
- if("random_laws")
- var/law_id = lowertext(value)
- lawids += law_id
- if("law_weight")
- // Value is in the form "LAWID,NUMBER"
- var/list/L = splittext(value, ",")
- if(L.len != 2)
- WRITE_FILE(GLOB.config_error_log, "Invalid LAW_WEIGHT: " + t)
- continue
- var/lawid = L[1]
- var/weight = text2num(L[2])
- law_weights[lawid] = weight
-
- if("silicon_max_law_amount")
- silicon_max_law_amount = text2num(value)
- if("join_with_mutant_race")
- mutant_races = 1
- if("roundstart_races")
- var/race_id = lowertext(value)
- for(var/species_id in GLOB.species_list)
- if(species_id == race_id)
- roundstart_races += GLOB.species_list[species_id]
- GLOB.roundstart_species[species_id] = GLOB.species_list[species_id]
- if("join_with_mutant_humans")
- mutant_humans = 1
- if("assistant_cap")
- assistant_cap = text2num(value)
- if("starlight")
- starlight = 1
- if("grey_assistants")
- grey_assistants = 1
- if("lavaland_budget")
- lavaland_budget = text2num(value)
- if("space_budget")
- space_budget = text2num(value)
- if("no_summon_guns")
- no_summon_guns = 1
- if("no_summon_magic")
- no_summon_magic = 1
- if("no_summon_events")
- no_summon_events = 1
- if("reactionary_explosions")
- reactionary_explosions = 1
- if("bombcap")
- var/BombCap = text2num(value)
- if (!BombCap)
- continue
- if (BombCap < 4)
- BombCap = 4
-
- GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4)
- GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2)
- GLOB.MAX_EX_LIGHT_RANGE = BombCap
- GLOB.MAX_EX_FLASH_RANGE = BombCap
- GLOB.MAX_EX_FLAME_RANGE = BombCap
- if("arrivals_shuttle_dock_window")
- arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value))
- if("arrivals_shuttle_require_undocked")
- arrivals_shuttle_require_undocked = TRUE
- if("arrivals_shuttle_require_safe_latejoin")
- arrivals_shuttle_require_safe_latejoin = TRUE
- if("mice_roundstart")
- mice_roundstart = text2num(value)
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'")
- else if(type == "policies")
- policies[name] = value
-
- fps = round(fps)
- if(fps <= 0)
- fps = initial(fps)
-
-/datum/configuration/proc/HandleCommsConfig(name, value)
- switch(name)
- if("comms_key")
- global.comms_key = value
- if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins
- global.comms_allowed = TRUE
- if("cross_server_address")
- cross_address = value
- if(value != "byond:\\address:port")
- cross_allowed = TRUE
- if("cross_comms_name")
- cross_name = value
- if("medal_hub_address")
- global.medal_hub = value
- if("medal_hub_password")
- global.medal_pass = value
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'")
-
-/datum/configuration/proc/loadmaplist(filename)
+/datum/controller/configuration/proc/loadmaplist(filename)
filename = "[GLOB.config_dir][filename]"
var/list/Lines = world.file2list(filename)
@@ -895,7 +203,7 @@ GLOBAL_PROTECT(config_dir)
if ("map")
currentmap = new ("_maps/[data].json")
if(currentmap.defaulted)
- log_world("Failed to load map config for [data]!")
+ log_config("Failed to load map config for [data]!")
if ("minplayers","minplayer")
currentmap.config_min_users = text2num(data)
if ("maxplayers","maxplayer")
@@ -905,6 +213,7 @@ GLOBAL_PROTECT(config_dir)
if ("default","defaultmap")
defaultmap = currentmap
if ("endmap")
+ LAZYINITLIST(maplist)
maplist[currentmap.map_name] = currentmap
currentmap = null
if ("disabled")
@@ -913,51 +222,7 @@ GLOBAL_PROTECT(config_dir)
WRITE_FILE(GLOB.config_error_log, "Unknown command in map vote config: '[command]'")
-/datum/configuration/proc/loadsql(filename)
- filename = "[GLOB.config_dir][filename]"
- var/list/Lines = world.file2list(filename)
- for(var/t in Lines)
- if(!t)
- continue
-
- t = trim(t)
- if(length(t) == 0)
- continue
- else if(copytext(t, 1, 2) == "#")
- continue
-
- var/pos = findtext(t, " ")
- var/name = null
- var/value = null
-
- if(pos)
- name = lowertext(copytext(t, 1, pos))
- value = copytext(t, pos + 1)
- else
- name = lowertext(t)
-
- if(!name)
- continue
-
- switch(name)
- if("sql_enabled")
- sql_enabled = 1
- if("address")
- global.sqladdress = value
- if("port")
- global.sqlport = value
- if("feedback_database")
- global.sqlfdbkdb = value
- if("feedback_login")
- global.sqlfdbklogin = value
- if("feedback_password")
- global.sqlfdbkpass = value
- if("feedback_tableprefix")
- global.sqlfdbktableprefix = value
- else
- WRITE_FILE(GLOB.config_error_log, "Unknown setting in configuration: '[name]'")
-
-/datum/configuration/proc/pick_mode(mode_name)
+/datum/controller/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
// their information, but it is the only way (at least that I know of).
// ^ This guy didn't try hard enough
@@ -968,8 +233,12 @@ GLOBAL_PROTECT(config_dir)
return new T
return new /datum/game_mode/extended()
-/datum/configuration/proc/get_runnable_modes()
+/datum/controller/configuration/proc/get_runnable_modes()
var/list/datum/game_mode/runnable_modes = new
+ var/list/probabilities = Get(/datum/config_entry/keyed_number_list/probability)
+ var/list/min_pop = Get(/datum/config_entry/keyed_number_list/min_pop)
+ var/list/max_pop = Get(/datum/config_entry/keyed_number_list/max_pop)
+ var/list/repeated_mode_adjust = Get(/datum/config_entry/number_list/repeated_mode_adjust)
for(var/T in gamemode_cache)
var/datum/game_mode/M = new T()
if(!(M.config_tag in modes))
@@ -994,8 +263,11 @@ GLOBAL_PROTECT(config_dir)
runnable_modes[M] = final_weight
return runnable_modes
-/datum/configuration/proc/get_runnable_midround_modes(crew)
+/datum/controller/configuration/proc/get_runnable_midround_modes(crew)
var/list/datum/game_mode/runnable_modes = new
+ var/list/probabilities = Get(/datum/config_entry/keyed_number_list/probability)
+ var/list/min_pop = Get(/datum/config_entry/keyed_number_list/min_pop)
+ var/list/max_pop = Get(/datum/config_entry/keyed_number_list/max_pop)
for(var/T in (gamemode_cache - SSticker.mode.type))
var/datum/game_mode/M = new T()
if(!(M.config_tag in modes))
@@ -1013,9 +285,3 @@ GLOBAL_PROTECT(config_dir)
continue
runnable_modes[M] = probabilities[M.config_tag]
return runnable_modes
-
-/datum/configuration/proc/stat_entry()
- if(!statclick)
- statclick = new/obj/effect/statclick/debug(null, "Edit", src)
-
- stat("[name]:", statclick)
diff --git a/code/controllers/configuration/config_entry.dm b/code/controllers/configuration/config_entry.dm
index b439743a79..5358073dbe 100644
--- a/code/controllers/configuration/config_entry.dm
+++ b/code/controllers/configuration/config_entry.dm
@@ -51,13 +51,7 @@
return FALSE
return ..()
-/datum/config_entry/proc/VASProcCallGuard(str_val)
- . = !(IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "ValidateAndSet" && GLOB.LastAdminCalledTargetRef == "\ref[src]")
- if(!.)
- log_admin_private("Config set of [type] to [str_val] attempted by [key_name(usr)]")
-
/datum/config_entry/proc/ValidateAndSet(str_val)
- VASProcCallGuard(str_val)
CRASH("Invalid config entry type!")
/datum/config_entry/proc/ValidateKeyedList(str_val, list_mode, splitter)
@@ -98,8 +92,6 @@
return var_name != "auto_trim" && ..()
/datum/config_entry/string/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
value = auto_trim ? trim(str_val) : str_val
return TRUE
@@ -111,8 +103,6 @@
var/min_val = -INFINITY
/datum/config_entry/number/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
value = Clamp(integer ? round(temp) : temp, min_val, max_val)
@@ -130,8 +120,6 @@
abstract_type = /datum/config_entry/flag
/datum/config_entry/flag/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
value = text2num(trim(str_val)) != 0
return TRUE
@@ -140,8 +128,6 @@
value = list()
/datum/config_entry/number_list/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
str_val = trim(str_val)
var/list/new_list = list()
var/list/values = splittext(str_val," ")
@@ -161,8 +147,6 @@
dupes_allowed = TRUE
/datum/config_entry/keyed_flag_list/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
return ValidateKeyedList(str_val, LIST_MODE_FLAG, " ")
/datum/config_entry/keyed_number_list
@@ -175,8 +159,6 @@
return var_name != "splitter" && ..()
/datum/config_entry/keyed_number_list/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
return ValidateKeyedList(str_val, LIST_MODE_NUM, splitter)
/datum/config_entry/keyed_string_list
@@ -189,8 +171,6 @@
return var_name != "splitter" && ..()
/datum/config_entry/keyed_string_list/ValidateAndSet(str_val)
- if(!VASProcCallGuard(str_val))
- return FALSE
return ValidateKeyedList(str_val, LIST_MODE_TEXT, splitter)
#undef LIST_MODE_NUM
diff --git a/code/controllers/configuration/entries/comms.dm b/code/controllers/configuration/entries/comms.dm
new file mode 100644
index 0000000000..bf099f6cb6
--- /dev/null
+++ b/code/controllers/configuration/entries/comms.dm
@@ -0,0 +1,22 @@
+#define CURRENT_RESIDENT_FILE "comms.txt"
+
+CONFIG_DEF(string/comms_key)
+ protection = CONFIG_ENTRY_HIDDEN
+
+/datum/config_entry/string/comms_key/ValidateAndSet(str_val)
+ return str_val != "default_pwd" && length(str_val) > 6 && ..()
+
+CONFIG_DEF(string/cross_server_address)
+ protection = CONFIG_ENTRY_LOCKED
+
+/datum/config_entry/string/cross_server_address/ValidateAndSet(str_val)
+ return str_val != "byond:\\address:port" && ..()
+
+CONFIG_DEF(string/cross_comms_name)
+
+GLOBAL_VAR_INIT(medals_enabled, TRUE) //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls.
+
+CONFIG_DEF(string/medal_hub_address)
+
+CONFIG_DEF(string/medal_hub_password)
+ protection = CONFIG_ENTRY_HIDDEN
\ No newline at end of file
diff --git a/code/controllers/configuration/entries/config.dm b/code/controllers/configuration/entries/config.dm
new file mode 100644
index 0000000000..cabb6dca27
--- /dev/null
+++ b/code/controllers/configuration/entries/config.dm
@@ -0,0 +1,387 @@
+#define CURRENT_RESIDENT_FILE "config.txt"
+
+CONFIG_DEF(flag/autoadmin) // if autoadmin is enabled
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/autoadmin_rank) // the rank for autoadmins
+ value = "Game Master"
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/servername) // server name (the name of the game window)
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/serversqlname) // short form server name used for the DB
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/stationname) // station name (the name of the station in-game)
+
+CONFIG_DEF(number/lobby_countdown) // In between round countdown.
+ value = 120
+ min_val = 0
+
+CONFIG_DEF(number/round_end_countdown) // Post round murder death kill countdown
+ value = 25
+ min_val = 0
+
+CONFIG_DEF(flag/hub) // if the game appears on the hub or not
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_ooc) // log OOC channel
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_access) // log login/logout
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_say) // log client say
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_admin) // log admin actions
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_prayer) // log prayers
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_law) // log lawchanges
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_game) // log game events
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_vote) // log voting
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_whisper) // log client whisper
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_attack) // log attack messages
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_emote) // log emotes
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_adminchat) // log admin chat messages
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_pda) // log pda messages
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_twitter) // log certain expliotable parrots and other such fun things in a JSON file of twitter valid phrases.
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/log_world_topic) // log all world.Topic() calls
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/allow_admin_ooccolor) // Allows admins with relevant permissions to have their own ooc colour
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/allow_vote_restart) // allow votes to restart
+
+CONFIG_DEF(flag/allow_vote_mode) // allow votes to change mode
+
+CONFIG_DEF(number/vote_delay) // minimum time between voting sessions (deciseconds, 10 minute default)
+ value = 6000
+ min_val = 0
+
+CONFIG_DEF(number/vote_period) // length of voting period (deciseconds, default 1 minute)
+ value = 600
+ min_val = 0
+
+CONFIG_DEF(flag/default_no_vote) // vote does not default to nochange/norestart
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/no_dead_vote) // dead people can't vote
+
+CONFIG_DEF(flag/allow_metadata) // Metadata is supported.
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/popup_admin_pm) // adminPMs to non-admins show in a pop-up 'reply' window when set
+
+CONFIG_DEF(number/fps)
+ value = 20
+ min_val = 1
+ max_val = 100 //byond will start crapping out at 50, so this is just ridic
+ var/sync_validate = FALSE
+
+/datum/config_entry/number/fps/ValidateAndSet(str_val)
+ . = ..()
+ if(.)
+ sync_validate = TRUE
+ var/datum/config_entry/number/ticklag/TL = config.entries_by_type[/datum/config_entry/number/ticklag]
+ if(!TL.sync_validate)
+ TL.ValidateAndSet(10 / value)
+ sync_validate = FALSE
+
+CONFIG_DEF(number/ticklag)
+ integer = FALSE
+ var/sync_validate = FALSE
+
+/datum/config_entry/number/ticklag/New() //ticklag weirdly just mirrors fps
+ var/datum/config_entry/CE = /datum/config_entry/number/fps
+ value = 10 / initial(CE.value)
+ ..()
+
+/datum/config_entry/number/ticklag/ValidateAndSet(str_val)
+ . = text2num(str_val) > 0 && ..()
+ if(.)
+ sync_validate = TRUE
+ var/datum/config_entry/number/fps/FPS = config.entries_by_type[/datum/config_entry/number/fps]
+ if(!FPS.sync_validate)
+ FPS.ValidateAndSet(10 / value)
+ sync_validate = FALSE
+
+CONFIG_DEF(flag/allow_holidays)
+
+CONFIG_DEF(number/tick_limit_mc_init) //SSinitialization throttling
+ value = TICK_LIMIT_MC_INIT_DEFAULT
+ min_val = 0 //oranges warned us
+ integer = FALSE
+
+CONFIG_DEF(flag/admin_legacy_system) //Defines whether the server uses the legacy admin system with admins.txt or the SQL system
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/hostedby)
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/norespawn)
+
+CONFIG_DEF(flag/guest_jobban)
+
+CONFIG_DEF(flag/usewhitelist)
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/ban_legacy_system) //Defines whether the server uses the legacy banning system with the files in /data or the SQL system.
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/use_age_restriction_for_jobs) //Do jobs use account age restrictions? --requires database
+
+CONFIG_DEF(flag/use_account_age_for_jobs) //Uses the time they made the account for the job restriction stuff. New player joining alerts should be unaffected.
+
+CONFIG_DEF(flag/use_exp_tracking)
+
+CONFIG_DEF(flag/use_exp_restrictions_heads)
+
+CONFIG_DEF(number/use_exp_restrictions_heads_hours)
+ value = 0
+ min_val = 0
+
+CONFIG_DEF(flag/use_exp_restrictions_heads_department)
+
+CONFIG_DEF(flag/use_exp_restrictions_other)
+
+CONFIG_DEF(flag/use_exp_restrictions_admin_bypass)
+
+CONFIG_DEF(string/server)
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/banappeals)
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/wikiurl)
+ protection = CONFIG_ENTRY_LOCKED
+ value = "http://www.tgstation13.org/wiki"
+
+CONFIG_DEF(string/forumurl)
+ protection = CONFIG_ENTRY_LOCKED
+ value = "http://tgstation13.org/phpBB/index.php"
+
+CONFIG_DEF(string/rulesurl)
+ protection = CONFIG_ENTRY_LOCKED
+ value = "http://www.tgstation13.org/wiki/Rules"
+
+CONFIG_DEF(string/githuburl)
+ protection = CONFIG_ENTRY_LOCKED
+ value = "https://www.github.com/tgstation/-tg-station"
+
+CONFIG_DEF(number/githubrepoid)
+ protection = CONFIG_ENTRY_LOCKED
+ value = null
+ min_val = 0
+
+CONFIG_DEF(flag/guest_ban)
+
+CONFIG_DEF(number/id_console_jobslot_delay)
+ value = 30
+ min_val = 0
+
+CONFIG_DEF(number/inactivity_period) //time in ds until a player is considered inactive)
+ value = 3000
+ min_val = 0
+
+/datum/config_entry/number/inactivity_period/ValidateAndSet(str_val)
+ . = ..()
+ if(.)
+ value *= 10 //documented as seconds in config.txt
+
+CONFIG_DEF(number/afk_period) //time in ds until a player is considered inactive)
+ value = 3000
+ min_val = 0
+
+/datum/config_entry/number/afk_period/ValidateAndSet(str_val)
+ . = ..()
+ if(.)
+ value *= 10 //documented as seconds in config.txt
+
+CONFIG_DEF(flag/kick_inactive) //force disconnect for inactive players
+
+CONFIG_DEF(flag/load_jobs_from_txt)
+
+CONFIG_DEF(flag/forbid_singulo_possession)
+
+CONFIG_DEF(flag/useircbot) //tgs2 support
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/automute_on) //enables automuting/spam prevention
+
+CONFIG_DEF(string/panic_server_name)
+ protection = CONFIG_ENTRY_LOCKED
+
+/datum/config_entry/string/panic_server_name/ValidateAndSet(str_val)
+ return str_val != "\[Put the name here\]" && ..()
+
+CONFIG_DEF(string/panic_address) //Reconnect a player this linked server if this server isn't accepting new players
+
+/datum/config_entry/string/panic_address/ValidateAndSet(str_val)
+ return str_val != "byond://address:port" && ..()
+
+CONFIG_DEF(string/invoke_youtubedl)
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(flag/show_irc_name)
+
+CONFIG_DEF(flag/see_own_notes) //Can players see their own admin notes (read-only)?
+
+CONFIG_DEF(number/note_fresh_days)
+ value = null
+ min_val = 0
+ integer = FALSE
+
+CONFIG_DEF(number/note_stale_days)
+ value = null
+ min_val = 0
+ integer = FALSE
+
+CONFIG_DEF(flag/maprotation)
+
+CONFIG_DEF(number/maprotatechancedelta)
+ value = 0.75
+ min_val = 0
+ max_val = 1
+ integer = FALSE
+
+CONFIG_DEF(number/soft_popcap)
+ value = null
+ min_val = 0
+
+CONFIG_DEF(number/hard_popcap)
+ value = null
+ min_val = 0
+
+CONFIG_DEF(number/extreme_popcap)
+ value = null
+ min_val = 0
+
+CONFIG_DEF(string/soft_popcap_message)
+ value = "Be warned that the server is currently serving a high number of users, consider using alternative game servers."
+
+CONFIG_DEF(string/hard_popcap_message)
+ value = "The server is currently serving a high number of users, You cannot currently join. You may wait for the number of living crew to decline, observe, or find alternative servers."
+
+CONFIG_DEF(string/extreme_popcap_message)
+ value = "The server is currently serving a high number of users, find alternative servers."
+
+CONFIG_DEF(flag/panic_bunker) // prevents people the server hasn't seen before from connecting
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(number/notify_new_player_age) // how long do we notify admins of a new player
+ min_val = -1
+
+CONFIG_DEF(number/notify_new_player_account_age) // how long do we notify admins of a new byond account
+ min_val = 0
+
+CONFIG_DEF(flag/irc_first_connection_alert) // do we notify the irc channel when somebody is connecting for the first time?
+
+CONFIG_DEF(flag/check_randomizer)
+
+CONFIG_DEF(string/ipintel_email)
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+/datum/config_entry/string/ipintel_email/ValidateAndSet(str_val)
+ return str_val != "ch@nge.me" && ..()
+
+CONFIG_DEF(number/ipintel_rating_bad)
+ value = 1
+ integer = FALSE
+ min_val = 0
+ max_val = 1
+
+CONFIG_DEF(number/ipintel_save_good)
+ protection = CONFIG_ENTRY_LOCKED
+ value = 12
+ min_val = 0
+
+CONFIG_DEF(number/ipintel_save_bad)
+ protection = CONFIG_ENTRY_LOCKED
+ value = 1
+ min_val = 0
+
+CONFIG_DEF(string/ipintel_domain)
+ protection = CONFIG_ENTRY_LOCKED
+ value = "check.getipintel.net"
+
+CONFIG_DEF(flag/aggressive_changelog)
+
+CONFIG_DEF(flag/autoconvert_notes) //if all connecting player's notes should attempt to be converted to the database
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(flag/allow_webclient)
+
+CONFIG_DEF(flag/webclient_only_byond_members)
+
+CONFIG_DEF(flag/announce_admin_logout)
+
+CONFIG_DEF(flag/announce_admin_login)
+
+CONFIG_DEF(flag/allow_map_voting)
+
+CONFIG_DEF(flag/generate_minimaps)
+
+CONFIG_DEF(number/client_warn_version)
+ value = null
+ min_val = 500
+ max_val = DM_VERSION - 1
+
+CONFIG_DEF(string/client_warn_message)
+ value = "Your version of byond may have issues or be blocked from accessing this server in the future."
+
+CONFIG_DEF(number/client_error_version)
+ value = null
+ min_val = 500
+ max_val = DM_VERSION - 1
+
+CONFIG_DEF(string/client_error_message)
+ value = "Your version of byond is too old, may have issues, and is blocked from accessing this server."
+
+CONFIG_DEF(number/minute_topic_limit)
+ value = null
+ min_val = 0
+
+CONFIG_DEF(number/second_topic_limit)
+ value = null
+ min_val = 0
+
+CONFIG_DEF(number/error_cooldown) // The "cooldown" time for each occurrence of a unique error)
+ value = 600
+ min_val = 0
+
+CONFIG_DEF(number/error_limit) // How many occurrences before the next will silence them
+ value = 50
+
+CONFIG_DEF(number/error_silence_time) // How long a unique error will be silenced for
+ value = 6000
+
+CONFIG_DEF(number/error_msg_delay) // How long to wait between messaging admins about occurrences of a unique error
+ value = 50
+
+CONFIG_DEF(flag/irc_announce_new_game)
+
+CONFIG_DEF(flag/debug_admin_hrefs)
\ No newline at end of file
diff --git a/code/controllers/configuration/entries/dbconfig.dm b/code/controllers/configuration/entries/dbconfig.dm
new file mode 100644
index 0000000000..c46880686a
--- /dev/null
+++ b/code/controllers/configuration/entries/dbconfig.dm
@@ -0,0 +1,28 @@
+#define CURRENT_RESIDENT_FILE "dbconfig.txt"
+
+CONFIG_DEF(flag/sql_enabled) // for sql switching
+ protection = CONFIG_ENTRY_LOCKED
+
+CONFIG_DEF(string/address)
+ value = "localhost"
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(number/port)
+ value = 3306
+ min_val = 0
+ max_val = 65535
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(string/feedback_database)
+ value = "test"
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(string/feedback_login)
+ value = "root"
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(string/feedback_password)
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
+
+CONFIG_DEF(string/feedback_tableprefix)
+ protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN
diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm
new file mode 100644
index 0000000000..106804a576
--- /dev/null
+++ b/code/controllers/configuration/entries/game_options.dm
@@ -0,0 +1,266 @@
+#define CURRENT_RESIDENT_FILE "game_options.txt"
+
+CONFIG_DEF(number_list/repeated_mode_adjust)
+
+CONFIG_DEF(keyed_number_list/probability)
+
+/datum/config_entry/keyed_number_list/probability/ValidateKeyName(key_name)
+ return key_name in config.modes
+
+CONFIG_DEF(keyed_number_list/max_pop)
+
+/datum/config_entry/keyed_number_list/max_pop/ValidateKeyName(key_name)
+ return key_name in config.modes
+
+CONFIG_DEF(keyed_number_list/min_pop)
+
+/datum/config_entry/keyed_number_list/min_pop/ValidateKeyName(key_name)
+ return key_name in config.modes
+
+CONFIG_DEF(keyed_flag_list/continuous) // which roundtypes continue if all antagonists die
+
+/datum/config_entry/keyed_flag_list/continuous/ValidateKeyName(key_name)
+ return key_name in config.modes
+
+CONFIG_DEF(keyed_flag_list/midround_antag) // which roundtypes use the midround antagonist system
+
+/datum/config_entry/keyed_flag_list/midround_antag/ValidateKeyName(key_name)
+ return key_name in config.modes
+
+CONFIG_DEF(keyed_string_list/policy)
+
+CONFIG_DEF(number/damage_multiplier)
+ value = 1
+ integer = FALSE
+
+CONFIG_DEF(number/minimal_access_threshold) //If the number of players is larger than this threshold, minimal access will be turned on.
+ min_val = 0
+
+CONFIG_DEF(flag/jobs_have_minimal_access) //determines whether jobs use minimal access or expanded access.
+
+CONFIG_DEF(flag/assistants_have_maint_access)
+
+CONFIG_DEF(flag/security_has_maint_access)
+
+CONFIG_DEF(flag/everyone_has_maint_access)
+
+CONFIG_DEF(flag/sec_start_brig) //makes sec start in brig instead of dept sec posts
+
+CONFIG_DEF(flag/force_random_names)
+
+CONFIG_DEF(flag/humans_need_surnames)
+
+CONFIG_DEF(flag/allow_ai) // allow ai job
+
+CONFIG_DEF(flag/disable_secborg) // disallow secborg module to be chosen.
+
+CONFIG_DEF(flag/disable_peaceborg)
+
+CONFIG_DEF(number/traitor_scaling_coeff) //how much does the amount of players get divided by to determine traitors
+ value = 6
+ min_val = 1
+
+CONFIG_DEF(number/brother_scaling_coeff) //how many players per brother team
+ value = 25
+ min_val = 1
+
+CONFIG_DEF(number/changeling_scaling_coeff) //how much does the amount of players get divided by to determine changelings
+ value = 6
+ min_val = 1
+
+CONFIG_DEF(number/security_scaling_coeff) //how much does the amount of players get divided by to determine open security officer positions
+ value = 8
+ min_val = 1
+
+CONFIG_DEF(number/abductor_scaling_coeff) //how many players per abductor team
+ value = 15
+ min_val = 1
+
+CONFIG_DEF(number/traitor_objectives_amount)
+ value = 2
+ min_val = 0
+
+CONFIG_DEF(number/brother_objectives_amount)
+ value = 2
+ min_val = 0
+
+CONFIG_DEF(flag/reactionary_explosions) //If we use reactionary explosions, explosions that react to walls and doors
+
+CONFIG_DEF(flag/protect_roles_from_antagonist) //If security and such can be traitor/cult/other
+
+CONFIG_DEF(flag/protect_assistant_from_antagonist) //If assistants can be traitor/cult/other
+
+CONFIG_DEF(flag/enforce_human_authority) //If non-human species are barred from joining as a head of staff
+
+CONFIG_DEF(flag/allow_latejoin_antagonists) // If late-joining players can be traitor/changeling
+
+CONFIG_DEF(number/midround_antag_time_check) // How late (in minutes) you want the midround antag system to stay on, setting this to 0 will disable the system
+ value = 60
+ min_val = 0
+
+CONFIG_DEF(number/midround_antag_life_check) // A ratio of how many people need to be alive in order for the round not to immediately end in midround antagonist
+ value = 0.7
+ integer = FALSE
+ min_val = 0
+ max_val = 1
+
+CONFIG_DEF(number/shuttle_refuel_delay)
+ value = 12000
+ min_val = 0
+
+CONFIG_DEF(flag/show_game_type_odds) //if set this allows players to see the odds of each roundtype on the get revision screen
+
+CONFIG_DEF(flag/join_with_mutant_race) //players can choose their mutant race before joining the game
+
+CONFIG_DEF(keyed_flag_list/roundstart_races) //races you can play as from the get go. If left undefined the game's roundstart var for species is used
+ var/first_edit = TRUE
+
+/datum/config_entry/keyed_flag_list/roundstart_races/New()
+ for(var/I in subtypesof(/datum/species))
+ var/datum/species/S = I
+ if(initial(S.roundstart))
+ value[initial(S.id)] = TRUE
+ ..()
+
+/datum/config_entry/keyed_flag_list/roundstart_races/ValidateAndSet(str_val)
+ var/list/old_val
+ if(first_edit)
+ old_val = value
+ old_val = old_val.Copy()
+ . = ..()
+ if(first_edit)
+ if(!.)
+ value = old_val
+ else
+ first_edit = FALSE
+
+CONFIG_DEF(flag/join_with_mutant_humans) //players can pick mutant bodyparts for humans before joining the game
+
+CONFIG_DEF(flag/no_summon_guns) //No
+
+CONFIG_DEF(flag/no_summon_magic) //Fun
+
+CONFIG_DEF(flag/no_summon_events) //Allowed
+
+CONFIG_DEF(flag/no_intercept_report) //Whether or not to send a communications intercept report roundstart. This may be overriden by gamemodes.
+
+CONFIG_DEF(number/arrivals_shuttle_dock_window) //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
+ value = 55
+ min_val = 30
+
+CONFIG_DEF(flag/arrivals_shuttle_require_undocked) //Require the arrivals shuttle to be undocked before latejoiners can join
+
+CONFIG_DEF(flag/arrivals_shuttle_require_safe_latejoin) //Require the arrivals shuttle to be operational in order for latejoiners to join
+
+CONFIG_DEF(string/alert_green)
+ value = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
+
+CONFIG_DEF(string/alert_blue_upto)
+ value = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
+
+CONFIG_DEF(string/alert_blue_downto)
+ value = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed."
+
+CONFIG_DEF(string/alert_red_upto)
+ value = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
+
+CONFIG_DEF(string/alert_red_downto)
+ value = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
+
+CONFIG_DEF(string/alert_delta)
+ value = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
+
+CONFIG_DEF(flag/revival_pod_plants)
+
+CONFIG_DEF(flag/revival_cloning)
+
+CONFIG_DEF(number/revival_brain_life)
+ value = -1
+ min_val = -1
+
+CONFIG_DEF(flag/rename_cyborg)
+
+CONFIG_DEF(flag/ooc_during_round)
+
+CONFIG_DEF(flag/emojis)
+
+CONFIG_DEF(number/run_delay) //Used for modifying movement speed for mobs.
+
+CONFIG_DEF(number/walk_delay)
+
+
+CONFIG_DEF(number/human_delay) //Mob specific modifiers. NOTE: These will affect different mob types in different ways
+CONFIG_DEF(number/robot_delay)
+CONFIG_DEF(number/monkey_delay)
+CONFIG_DEF(number/alien_delay)
+CONFIG_DEF(number/slime_delay)
+CONFIG_DEF(number/animal_delay)
+
+CONFIG_DEF(number/gateway_delay) //How long the gateway takes before it activates. Default is half an hour.
+ value = 18000
+ min_val = 0
+
+CONFIG_DEF(flag/ghost_interaction)
+
+CONFIG_DEF(flag/silent_ai)
+CONFIG_DEF(flag/silent_borg)
+
+CONFIG_DEF(flag/sandbox_autoclose) // close the sandbox panel after spawning an item, potentially reducing griff
+
+CONFIG_DEF(number/default_laws) //Controls what laws the AI spawns with.
+ value = 0
+ min_val = 0
+ max_val = 3
+
+CONFIG_DEF(number/silicon_max_law_amount)
+ value = 12
+ min_val = 0
+
+CONFIG_DEF(keyed_flag_list/random_laws)
+
+CONFIG_DEF(keyed_number_list/law_weight)
+ splitter = ","
+
+CONFIG_DEF(number/assistant_cap)
+ value = -1
+ min_val = -1
+
+CONFIG_DEF(flag/starlight)
+CONFIG_DEF(flag/grey_assistants)
+
+CONFIG_DEF(number/lavaland_budget)
+ value = 60
+ min_val = 0
+
+CONFIG_DEF(number/space_budget)
+ value = 16
+ min_val = 0
+
+CONFIG_DEF(flag/allow_random_events) // Enables random events mid-round when set
+
+CONFIG_DEF(number/events_min_time_mul) // Multipliers for random events minimal starting time and minimal players amounts
+ value = 1
+ min_val = 0
+ integer = FALSE
+
+CONFIG_DEF(number/events_min_players_mul)
+ value = 1
+ min_val = 0
+ integer = FALSE
+
+CONFIG_DEF(number/mice_roundstart)
+ value = 10
+ min_val = 0
+
+CONFIG_DEF(number/bombcap)
+ value = 14
+ min_val = 4
+
+/datum/config_entry/number/bombcap/ValidateAndSet(str_val)
+ . = ..()
+ if(.)
+ GLOB.MAX_EX_DEVESTATION_RANGE = round(value / 4)
+ GLOB.MAX_EX_HEAVY_RANGE = round(value / 2)
+ GLOB.MAX_EX_LIGHT_RANGE = value
+ GLOB.MAX_EX_FLASH_RANGE = value
+ GLOB.MAX_EX_FLAME_RANGE = value
diff --git a/code/controllers/master.dm b/code/controllers/master.dm
index 11c460e326..6ed3121179 100644
--- a/code/controllers/master.dm
+++ b/code/controllers/master.dm
@@ -169,7 +169,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
var/start_timeofday = REALTIMEOFDAY
// Initialize subsystems.
- current_ticklimit = config.tick_limit_mc_init
+ current_ticklimit = CONFIG_GET(number/tick_limit_mc_init)
for (var/datum/controller/subsystem/SS in subsystems)
if (SS.flags & SS_NO_INIT)
continue
@@ -189,7 +189,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
sortTim(subsystems, /proc/cmp_subsystem_display)
// Set world options.
world.sleep_offline = 1
- world.fps = config.fps
+ world.fps = CONFIG_GET(number/fps)
var/initialized_tod = REALTIMEOFDAY
sleep(1)
initializations_finished_with_no_players_logged_in = initialized_tod < REALTIMEOFDAY - 10
diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm
index 2870305c3e..56238d5b85 100644
--- a/code/controllers/subsystem/blackbox.dm
+++ b/code/controllers/subsystem/blackbox.dm
@@ -38,7 +38,7 @@ SUBSYSTEM_DEF(blackbox)
var/datum/DBQuery/query_record_playercount = SSdbcore.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port, round_id) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', '[GLOB.round_id]')")
query_record_playercount.Execute()
- if(config.use_exp_tracking)
+ if(CONFIG_GET(flag/use_exp_tracking))
if((triggertime < 0) || (world.time > (triggertime +3000))) //subsystem fires once at roundstart then once every 10 minutes. a 5 min check skips the first fire. The <0 is midnight rollover check
update_exp(10,FALSE)
diff --git a/code/controllers/subsystem/dbcore.dm b/code/controllers/subsystem/dbcore.dm
index 864274b8fb..12a5342e33 100644
--- a/code/controllers/subsystem/dbcore.dm
+++ b/code/controllers/subsystem/dbcore.dm
@@ -54,32 +54,27 @@ SUBSYSTEM_DEF(dbcore)
if(failed_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to connect anymore.
return FALSE
- if(!config.sql_enabled)
+ if(!CONFIG_GET(flag/sql_enabled))
return FALSE
- var/user = global.sqlfdbklogin
- var/pass = global.sqlfdbkpass
- var/db = global.sqlfdbkdb
- var/address = global.sqladdress
- var/port = global.sqlport
+ var/user = CONFIG_GET(string/feedback_login)
+ var/pass = CONFIG_GET(string/feedback_password)
+ var/db = CONFIG_GET(string/feedback_database)
+ var/address = CONFIG_GET(string/address)
+ var/port = CONFIG_GET(number/port)
- doConnect("dbi:mysql:[db]:[address]:[port]", user, pass)
+ _dm_db_connect(_db_con, "dbi:mysql:[db]:[address]:[port]", user, pass, Default_Cursor, null)
. = IsConnected()
if (!.)
log_sql("Connect() failed | [ErrorMsg()]")
++failed_connections
-/datum/controller/subsystem/dbcore/proc/doConnect(dbi_handler, user_handler, password_handler)
- if(!config.sql_enabled)
- return FALSE
- return _dm_db_connect(_db_con, dbi_handler, user_handler, password_handler, Default_Cursor, null)
-
/datum/controller/subsystem/dbcore/proc/Disconnect()
failed_connections = 0
return _dm_db_close(_db_con)
/datum/controller/subsystem/dbcore/proc/IsConnected()
- if(!config.sql_enabled)
+ if(!CONFIG_GET(flag/sql_enabled))
return FALSE
return _dm_db_is_connected(_db_con)
@@ -87,7 +82,7 @@ SUBSYSTEM_DEF(dbcore)
return _dm_db_quote(_db_con, str)
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
- if(!config.sql_enabled)
+ if(!CONFIG_GET(flag/sql_enabled))
return "Database disabled by configuration"
return _dm_db_error_msg(_db_con)
diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm
index 7816a6bdf8..f435d7e819 100644
--- a/code/controllers/subsystem/events.dm
+++ b/code/controllers/subsystem/events.dm
@@ -56,7 +56,7 @@ SUBSYSTEM_DEF(events)
//selects a random event based on whether it can occur and it's 'weight'(probability)
/datum/controller/subsystem/events/proc/spawnEvent()
set waitfor = FALSE //for the admin prompt
- if(!config.allow_random_events)
+ if(!CONFIG_GET(flag/allow_random_events))
// var/datum/round_event_control/E = locate(/datum/round_event_control/dust) in control
// if(E) E.runEvent()
return
@@ -171,7 +171,7 @@ SUBSYSTEM_DEF(events)
//sets up the holidays and holidays list
/datum/controller/subsystem/events/proc/getHoliday()
- if(!config.allow_holidays)
+ if(!CONFIG_GET(flag/allow_holidays))
return // Holiday stuff was not enabled in the config!
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm
index d64739698a..1eb6c75cc5 100644
--- a/code/controllers/subsystem/job.dm
+++ b/code/controllers/subsystem/job.dm
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(job)
/datum/controller/subsystem/job/Initialize(timeofday)
if(!occupations.len)
SetupOccupations()
- if(config.load_jobs_from_txt)
+ if(CONFIG_GET(flag/load_jobs_from_txt))
LoadJobs()
..()
@@ -106,7 +106,7 @@ SUBSYSTEM_DEF(job)
if(player.mind && job.title in player.mind.restricted_roles)
Debug("FOC incompatible with antagonist role, Player: [player]")
continue
- if(config.enforce_human_authority && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
+ if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
Debug("FOC non-human failed, Player: [player]")
continue
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
@@ -143,7 +143,7 @@ SUBSYSTEM_DEF(job)
Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]")
continue
- if(config.enforce_human_authority && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
+ if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
Debug("GRJ non-human failed, Player: [player]")
continue
@@ -245,11 +245,12 @@ SUBSYSTEM_DEF(job)
setup_officer_positions()
//Jobs will have fewer access permissions if the number of players exceeds the threshold defined in game_options.txt
- if(config.minimal_access_threshold)
- if(config.minimal_access_threshold > unassigned.len)
- config.jobs_have_minimal_access = 0
+ var/mat = CONFIG_GET(number/minimal_access_threshold)
+ if(mat)
+ if(mat > unassigned.len)
+ CONFIG_SET(flag/jobs_have_minimal_access, FALSE)
else
- config.jobs_have_minimal_access = 1
+ CONFIG_SET(flag/jobs_have_minimal_access, TRUE)
//Shuffle players and jobs
unassigned = shuffle(unassigned)
@@ -317,7 +318,7 @@ SUBSYSTEM_DEF(job)
Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]")
continue
- if(config.enforce_human_authority && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
+ if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features))
Debug("DO non-human failed, Player: [player], Job:[job.title]")
continue
@@ -415,8 +416,8 @@ SUBSYSTEM_DEF(job)
to_chat(M, "To speak on your departments radio, use the :h button. To see others, look closely at your headset.")
if(job.req_admin_notify)
to_chat(M, "You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.")
- if(config.minimal_access_threshold)
- to_chat(M, "As this station was initially staffed with a [config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.")
+ if(CONFIG_GET(number/minimal_access_threshold))
+ to_chat(M, "As this station was initially staffed with a [CONFIG_GET(flag/jobs_have_minimal_access) ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card.")
if(job && H)
job.after_spawn(H, M)
@@ -429,9 +430,10 @@ SUBSYSTEM_DEF(job)
if(!J)
throw EXCEPTION("setup_officer_positions(): Security officer job is missing")
- if(config.security_scaling_coeff > 0)
+ var/ssc = CONFIG_GET(number/security_scaling_coeff)
+ if(ssc > 0)
if(J.spawn_positions > 0)
- var/officer_positions = min(12, max(J.spawn_positions, round(unassigned.len/config.security_scaling_coeff))) //Scale between configured minimum and 12 officers
+ var/officer_positions = min(12, max(J.spawn_positions, round(unassigned.len / ssc))) //Scale between configured minimum and 12 officers
Debug("Setting open security officer positions to [officer_positions]")
J.total_positions = officer_positions
J.spawn_positions = officer_positions
@@ -491,8 +493,10 @@ SUBSYSTEM_DEF(job)
SSblackbox.add_details("job_preferences",tmp_str)
/datum/controller/subsystem/job/proc/PopcapReached()
- if(config.hard_popcap || config.extreme_popcap)
- var/relevent_cap = max(config.hard_popcap, config.extreme_popcap)
+ var/hpc = CONFIG_GET(number/hard_popcap)
+ var/epc = CONFIG_GET(number/extreme_popcap)
+ if(hpc || epc)
+ var/relevent_cap = max(hpc, epc)
if((initial_players_to_assign - unassigned.len) >= relevent_cap)
return 1
return 0
diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm
index 78e8b150c3..989c5b43c4 100644
--- a/code/controllers/subsystem/lighting.dm
+++ b/code/controllers/subsystem/lighting.dm
@@ -16,7 +16,7 @@ SUBSYSTEM_DEF(lighting)
/datum/controller/subsystem/lighting/Initialize(timeofday)
if(!initialized)
- if (config.starlight)
+ if (CONFIG_GET(flag/starlight))
for(var/I in GLOB.sortedAreas)
var/area/A = I
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm
index 9549cf7b18..ab2ba54431 100644
--- a/code/controllers/subsystem/mapping.dm
+++ b/code/controllers/subsystem/mapping.dm
@@ -43,7 +43,7 @@ SUBSYSTEM_DEF(mapping)
loading_ruins = TRUE
var/mining_type = config.minetype
if (mining_type == "lavaland")
- seedRuins(list(ZLEVEL_LAVALAND), global.config.lavaland_budget, /area/lavaland/surface/outdoors/unexplored, lava_ruins_templates)
+ seedRuins(list(ZLEVEL_LAVALAND), CONFIG_GET(number/lavaland_budget), /area/lavaland/surface/outdoors/unexplored, lava_ruins_templates)
spawn_rivers()
// deep space ruins
@@ -55,7 +55,7 @@ SUBSYSTEM_DEF(mapping)
else
space_zlevels += i
- seedRuins(space_zlevels, global.config.space_budget, /area/space, space_ruins_templates)
+ seedRuins(space_zlevels, CONFIG_GET(number/space_budget), /area/space, space_ruins_templates)
loading_ruins = FALSE
repopulate_sorted_areas()
// Set up Z-level transistions.
@@ -141,7 +141,8 @@ SUBSYSTEM_DEF(mapping)
var/players = GLOB.clients.len
var/list/mapvotes = list()
//count votes
- if(global.config.allow_map_voting)
+ var/amv = CONFIG_GET(flag/allow_map_voting)
+ if(amv)
for (var/client/c in GLOB.clients)
var/vote = c.prefs.preferred_map
if (!vote)
@@ -174,7 +175,7 @@ SUBSYSTEM_DEF(mapping)
mapvotes.Remove(map)
continue
- if(global.config.allow_map_voting)
+ if(amv)
mapvotes[map] = mapvotes[map]*VM.voteweight
var/pickedmap = pickweight(mapvotes)
diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm
index 4e58212b44..463b82b13e 100644
--- a/code/controllers/subsystem/minimap.dm
+++ b/code/controllers/subsystem/minimap.dm
@@ -9,7 +9,7 @@ SUBSYSTEM_DEF(minimap)
/datum/controller/subsystem/minimap/Initialize(timeofday)
var/hash = md5(SSmapping.config.GetFullMapPath())
- if(config.generate_minimaps)
+ if(CONFIG_GET(flag/generate_minimaps))
if(hash == trim(file2text(hash_path())))
for(var/z in z_levels) //We have these files cached, let's register them
register_asset("minimap_[z].png", fcopy_rsc(map_path(z)))
diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm
index 87b06cd587..0b8fa750b6 100644
--- a/code/controllers/subsystem/server_maint.dm
+++ b/code/controllers/subsystem/server_maint.dm
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(server_maint)
var/list/currentrun
/datum/controller/subsystem/server_maint/Initialize(timeofday)
- if (config.hub)
+ if (CONFIG_GET(flag/hub))
world.update_hub_visibility(TRUE)
..()
@@ -21,16 +21,19 @@ SUBSYSTEM_DEF(server_maint)
var/list/currentrun = src.currentrun
var/round_started = SSticker.HasRoundStarted()
+ var/kick_inactive = CONFIG_GET(flag/kick_inactive)
+ var/afk_period
+ if(kick_inactive)
+ afk_period = CONFIG_GET(number/afk_period)
for(var/I in currentrun)
var/client/C = I
//handle kicking inactive players
- if(round_started && config.kick_inactive)
- if(C.is_afk(config.afk_period))
- var/cmob = C.mob
- if(!(isobserver(cmob) || (isdead(cmob) && C.holder)))
- log_access("AFK: [key_name(C)]")
- to_chat(C, "You have been inactive for more than [DisplayTimeText(config.afk_period)] and have been disconnected.")
- qdel(C)
+ if(round_started && kick_inactive && C.is_afk(afk_period))
+ var/cmob = C.mob
+ if(!(isobserver(cmob) || (isdead(cmob) && C.holder)))
+ log_access("AFK: [key_name(C)]")
+ to_chat(C, "You have been inactive for more than [DisplayTimeText(afk_period)] and have been disconnected.")
+ qdel(C)
if (!(!C || world.time - C.connection_time < PING_BUFFER_TIME || C.inactivity >= (wait-1)))
winset(C, null, "command=.update_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")
@@ -40,7 +43,7 @@ SUBSYSTEM_DEF(server_maint)
/datum/controller/subsystem/server_maint/Shutdown()
kick_clients_in_lobby("The round came to an end with you in the lobby.", TRUE) //second parameter ensures only afk clients are kicked
- var/server = config.server
+ var/server = CONFIG_GET(string/server)
for(var/thing in GLOB.clients)
if(!thing)
continue
diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm
index 2b1080049e..3ebc414a02 100644
--- a/code/controllers/subsystem/shuttle.dm
+++ b/code/controllers/subsystem/shuttle.dm
@@ -176,9 +176,9 @@ SUBSYSTEM_DEF(shuttle)
Good luck.")
return
emergency = backup_shuttle
-
- if(world.time - SSticker.round_start_time < config.shuttle_refuel_delay)
- to_chat(user, "The emergency shuttle is refueling. Please wait [DisplayTimeText((world.time - SSticker.round_start_time) - config.shuttle_refuel_delay)] before trying again.")
+ var/srd = CONFIG_GET(number/shuttle_refuel_delay)
+ if(world.time - SSticker.round_start_time < srd)
+ to_chat(user, "The emergency shuttle is refueling. Please wait [DisplayTimeText((world.time - SSticker.round_start_time) - srd)] before trying again.")
return
switch(emergency.mode)
diff --git a/code/controllers/subsystem/squeak.dm b/code/controllers/subsystem/squeak.dm
index 964d970e2b..0148011e8b 100644
--- a/code/controllers/subsystem/squeak.dm
+++ b/code/controllers/subsystem/squeak.dm
@@ -10,7 +10,7 @@ SUBSYSTEM_DEF(squeak)
var/list/exposed_wires = list()
/datum/controller/subsystem/squeak/Initialize(timeofday)
- trigger_migration(config.mice_roundstart)
+ trigger_migration(CONFIG_GET(number/mice_roundstart))
return ..()
/datum/controller/subsystem/squeak/proc/trigger_migration(num_mice=10)
diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index 3932eada60..2a43d7a844 100755
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -79,13 +79,13 @@ SUBSYSTEM_DEF(ticker)
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase()
..()
- start_at = world.time + (config.lobby_countdown * 10)
+ start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
/datum/controller/subsystem/ticker/fire()
switch(current_state)
if(GAME_STATE_STARTUP)
if(Master.initializations_finished_with_no_players_logged_in)
- start_at = world.time + (config.lobby_countdown * 10)
+ start_at = world.time + (CONFIG_GET(number/lobby_countdown) * 10)
for(var/client/C in GLOB.clients)
window_flash(C, ignorepref = TRUE) //let them know lobby has opened up.
to_chat(world, "Welcome to [station_name()]!")
@@ -207,7 +207,7 @@ SUBSYSTEM_DEF(ticker)
else
mode.announce()
- if(!config.ooc_during_round)
+ if(!CONFIG_GET(flag/ooc_during_round))
toggle_ooc(FALSE) // Turn it off
CHECK_TICK
@@ -429,7 +429,7 @@ SUBSYSTEM_DEF(ticker)
CHECK_TICK
- if(config.cross_allowed)
+ if(CONFIG_GET(string/cross_server_address))
send_news_report()
CHECK_TICK
@@ -495,7 +495,8 @@ SUBSYSTEM_DEF(ticker)
to_chat(world, "Tip of the round: [html_encode(m)]")
/datum/controller/subsystem/ticker/proc/check_queue()
- if(!queued_players.len || !config.hard_popcap)
+ var/hpc = CONFIG_GET(number/hard_popcap)
+ if(!queued_players.len || !hpc)
return
queue_delay++
@@ -503,7 +504,7 @@ SUBSYSTEM_DEF(ticker)
switch(queue_delay)
if(5) //every 5 ticks check if there is a slot available
- if(living_player_count() < config.hard_popcap)
+ if(living_player_count() < hpc)
if(next_in_line && next_in_line.client)
to_chat(next_in_line, "A slot has opened! You have approximately 20 seconds to join. \>\>Join Game\<\<")
SEND_SOUND(next_in_line, sound('sound/misc/notice1.ogg'))
@@ -517,7 +518,7 @@ SUBSYSTEM_DEF(ticker)
queue_delay = 0
/datum/controller/subsystem/ticker/proc/check_maprotate()
- if (!config.maprotation)
+ if (!CONFIG_GET(flag/maprotation))
return
if (SSshuttle.emergency && SSshuttle.emergency.mode != SHUTTLE_ESCAPE || SSshuttle.canRecall())
return
@@ -527,7 +528,7 @@ SUBSYSTEM_DEF(ticker)
maprotatechecked = 1
//map rotate chance defaults to 75% of the length of the round (in minutes)
- if (!prob((world.time/600)*config.maprotatechancedelta))
+ if (!prob((world.time/600)*CONFIG_GET(number/maprotatechancedelta)))
return
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/.proc/maprotate)
@@ -687,7 +688,7 @@ SUBSYSTEM_DEF(ticker)
return
if(!delay)
- delay = config.round_end_countdown * 10
+ delay = CONFIG_GET(number/round_end_countdown) * 10
var/skip_delay = check_rights()
if(delay_end && !skip_delay)
diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm
index 0ea16b32d8..d377329312 100644
--- a/code/controllers/subsystem/vote.dm
+++ b/code/controllers/subsystem/vote.dm
@@ -18,7 +18,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/fire() //called by master_controller
if(mode)
- time_remaining = round((started_time + config.vote_period - world.time)/10)
+ time_remaining = round((started_time + CONFIG_GET(number/vote_period) - world.time)/10)
if(time_remaining < 0)
result()
@@ -54,7 +54,7 @@ SUBSYSTEM_DEF(vote)
if(votes > greatest_votes)
greatest_votes = votes
//default-vote for everyone who didn't vote
- if(!config.vote_no_default && choices.len)
+ if(!CONFIG_GET(flag/default_no_vote) && choices.len)
var/list/non_voters = GLOB.directory.Copy()
non_voters -= voted
for (var/non_voter_ckey in non_voters)
@@ -146,7 +146,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/submit_vote(vote)
if(mode)
- if(config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
+ if(CONFIG_GET(flag/no_dead_vote) && usr.stat == DEAD && !usr.client.holder)
return 0
if(!(usr.ckey in voted))
if(vote && 1<=vote && vote<=choices.len)
@@ -158,7 +158,7 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key)
if(!mode)
if(started_time)
- var/next_allowed_time = (started_time + config.vote_delay)
+ var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay))
if(mode)
to_chat(usr, "There is already a vote in progress! please wait for it to finish.")
return 0
@@ -198,8 +198,9 @@ SUBSYSTEM_DEF(vote)
if(mode == "custom")
text += "\n[question]"
log_vote(text)
- to_chat(world, "\n[text]\nType vote or click here to place your votes.\nYou have [DisplayTimeText(config.vote_period)] to vote.")
- time_remaining = round(config.vote_period/10)
+ var/vp = CONFIG_GET(number/vote_period)
+ to_chat(world, "\n[text]\nType vote or click here to place your votes.\nYou have [DisplayTimeText(vp)] to vote.")
+ time_remaining = round(vp/10)
for(var/c in GLOB.clients)
var/client/C = c
var/datum/action/vote/V = new
@@ -238,20 +239,22 @@ SUBSYSTEM_DEF(vote)
else
. += "
Start a vote:
- "
//restart
- if(trialmin || config.allow_vote_restart)
+ var/avr = CONFIG_GET(flag/allow_vote_restart)
+ if(trialmin || avr)
. += "Restart"
else
. += "Restart (Disallowed)"
if(trialmin)
- . += "\t([config.allow_vote_restart?"Allowed":"Disallowed"])"
+ . += "\t([avr ? "Allowed" : "Disallowed"])"
. += "
- "
//gamemode
- if(trialmin || config.allow_vote_mode)
+ var/avm = CONFIG_GET(flag/allow_vote_mode)
+ if(trialmin || avm)
. += "GameMode"
else
. += "GameMode (Disallowed)"
if(trialmin)
- . += "\t([config.allow_vote_mode?"Allowed":"Disallowed"])"
+ . += "\t([avm ? "Allowed" : "Disallowed"])"
. += "
"
//custom
@@ -275,15 +278,15 @@ SUBSYSTEM_DEF(vote)
reset()
if("toggle_restart")
if(usr.client.holder)
- config.allow_vote_restart = !config.allow_vote_restart
+ CONFIG_SET(flag/allow_vote_restart, !CONFIG_GET(flag/allow_vote_restart))
if("toggle_gamemode")
if(usr.client.holder)
- config.allow_vote_mode = !config.allow_vote_mode
+ CONFIG_SET(flag/allow_vote_mode, !CONFIG_GET(flag/allow_vote_mode))
if("restart")
- if(config.allow_vote_restart || usr.client.holder)
+ if(CONFIG_GET(flag/allow_vote_restart) || usr.client.holder)
initiate_vote("restart",usr.key)
if("gamemode")
- if(config.allow_vote_mode || usr.client.holder)
+ if(CONFIG_GET(flag/allow_vote_mode) || usr.client.holder)
initiate_vote("gamemode",usr.key)
if("custom")
if(usr.client.holder)
diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm
index 2222a959bc..a96d2cbbc0 100644
--- a/code/datums/ai_laws.dm
+++ b/code/datums/ai_laws.dm
@@ -208,7 +208,8 @@
/* General ai_law functions */
/datum/ai_laws/proc/set_laws_config()
- switch(config.default_laws)
+ var/list/law_ids = CONFIG_GET(keyed_flag_list/random_laws)
+ switch(CONFIG_GET(number/default_laws))
if(0)
add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
@@ -220,7 +221,7 @@
var/list/randlaws = list()
for(var/lpath in subtypesof(/datum/ai_laws))
var/datum/ai_laws/L = lpath
- if(initial(L.id) in config.lawids)
+ if(initial(L.id) in law_ids)
randlaws += lpath
var/datum/ai_laws/lawtype
if(randlaws.len)
@@ -234,21 +235,14 @@
if(3)
pick_weighted_lawset()
- else:
- log_law("Invalid law config. Please check silicon_laws.txt")
- add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
- add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
- add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
- WARNING("Invalid custom AI laws, check silicon_laws.txt")
-
/datum/ai_laws/proc/pick_weighted_lawset()
var/datum/ai_laws/lawtype
-
- while(!lawtype && config.law_weights.len)
- var/possible_id = pickweight(config.law_weights)
+ var/list/law_weights = CONFIG_GET(keyed_number_list/law_weight)
+ while(!lawtype && law_weights)
+ var/possible_id = pickweight(law_weights)
lawtype = lawid_to_type(possible_id)
if(!lawtype)
- config.law_weights -= possible_id
+ law_weights -= possible_id
WARNING("Bad lawid in game_options.txt: [possible_id]")
if(!lawtype)
diff --git a/code/datums/antagonists/datum_traitor.dm b/code/datums/antagonists/datum_traitor.dm
index eeb803ca1e..874e6c00f1 100644
--- a/code/datums/antagonists/datum_traitor.dm
+++ b/code/datums/antagonists/datum_traitor.dm
@@ -138,10 +138,11 @@
assign_exchange_role(SSticker.mode.exchange_red)
assign_exchange_role(SSticker.mode.exchange_blue)
objective_count += 1 //Exchange counts towards number of objectives
- for(var/i = objective_count, i < config.traitor_objectives_amount, i++)
+ var/toa = CONFIG_GET(number/traitor_objectives_amount)
+ for(var/i = objective_count, i < toa, i++)
forge_single_objective()
- if(is_hijacker && objective_count <= config.traitor_objectives_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
+ if(is_hijacker && objective_count <= toa) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
if (!(locate(/datum/objective/hijack) in owner.objectives))
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = owner
@@ -173,18 +174,11 @@
if(prob(30))
objective_count += forge_single_objective()
-
- for(var/i = objective_count, i < config.traitor_objectives_amount, i++)
- if(prob(20)) //AI's are less likely to look for a late-joiner than normal traitors
- var/datum/objective/assassinate/late/late_objective = new
- late_objective.owner = owner
- late_objective.find_target()
- add_objective(late_objective)
- else
- var/datum/objective/assassinate/kill_objective = new
- kill_objective.owner = owner
- kill_objective.find_target()
- add_objective(kill_objective)
+ for(var/i = objective_count, i < CONFIG_GET(number/traitor_objectives_amount), i++)
+ var/datum/objective/assassinate/kill_objective = new
+ kill_objective.owner = owner
+ kill_objective.find_target()
+ add_objective(kill_objective)
var/datum/objective/survive/exist/exist_objective = new
exist_objective.owner = owner
diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm
index b20381ca85..299f6dbac9 100644
--- a/code/datums/datacore.dm
+++ b/code/datums/datacore.dm
@@ -222,7 +222,7 @@
G.fields["name"] = H.real_name
G.fields["rank"] = assignment
G.fields["age"] = H.age
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
G.fields["species"] = H.dna.species.name
G.fields["fingerprint"] = md5(H.dna.uni_identity)
G.fields["p_stat"] = "Active"
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 27a9338191..64a1d4ff07 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -1,401 +1,393 @@
-
-/////////////////////////// DNA DATUM
-/datum/dna
- var/unique_enzymes
- var/struc_enzymes
- var/uni_identity
- var/blood_type
- var/datum/species/species = new /datum/species/human() //The type of mutant race the player is if applicable (i.e. potato-man)
- var/list/features = list("FFF") //first value is mutant color
- var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings,
- var/list/mutations = list() //All mutations are from now on here
- var/list/temporary_mutations = list() //Timers for temporary mutations
- var/list/previous = list() //For temporary name/ui/ue/blood_type modifications
- var/mob/living/holder
-
-/datum/dna/New(mob/living/new_holder)
- if(new_holder)
- holder = new_holder
-
-/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = 0)
- if(!istype(destination))
- return
- destination.dna.unique_enzymes = unique_enzymes
- destination.dna.uni_identity = uni_identity
- destination.dna.blood_type = blood_type
- destination.set_species(species.type, icon_update=0)
- destination.dna.features = features.Copy()
- destination.dna.real_name = real_name
- destination.dna.temporary_mutations = temporary_mutations.Copy()
- if(transfer_SE)
- destination.dna.struc_enzymes = struc_enzymes
- if(ishuman(destination))
- var/mob/living/carbon/human/H = destination
- H.give_genitals(TRUE)//This gives the body the genitals of this DNA. Used for any transformations based on DNA
- destination.flavor_text = destination.dna.features["flavor_text"] //Update the flavor_text to use new dna text
-
-/datum/dna/proc/copy_dna(datum/dna/new_dna)
- new_dna.unique_enzymes = unique_enzymes
- new_dna.struc_enzymes = struc_enzymes
- new_dna.uni_identity = uni_identity
- new_dna.blood_type = blood_type
- new_dna.features = features.Copy()
- new_dna.species = new species.type
- new_dna.real_name = real_name
- new_dna.mutations = mutations.Copy()
-
-/datum/dna/proc/add_mutation(mutation_name)
- var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
- HM.on_acquiring(holder)
-
-/datum/dna/proc/remove_mutation(mutation_name)
- var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
- HM.on_losing(holder)
-
-/datum/dna/proc/check_mutation(mutation_name)
- var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
- return mutations.Find(HM)
-
-/datum/dna/proc/remove_all_mutations()
- remove_mutation_group(mutations)
-
-/datum/dna/proc/remove_mutation_group(list/group)
- if(!group)
- return
- for(var/datum/mutation/human/HM in group)
- HM.force_lose(holder)
-
-/datum/dna/proc/generate_uni_identity()
- . = ""
- var/list/L = new /list(DNA_UNI_IDENTITY_BLOCKS)
-
- L[DNA_GENDER_BLOCK] = construct_block((holder.gender!=MALE)+1, 2)
- if(ishuman(holder))
- var/mob/living/carbon/human/H = holder
- if(!GLOB.hair_styles_list.len)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/hair,GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list)
- L[DNA_HAIR_STYLE_BLOCK] = construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len)
- L[DNA_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.hair_color)
- if(!GLOB.facial_hair_styles_list.len)
- init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list)
- L[DNA_FACIAL_HAIR_STYLE_BLOCK] = construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len)
- L[DNA_FACIAL_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.facial_hair_color)
- L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len)
- L[DNA_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.eye_color)
-
- for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
- if(L[i])
- . += L[i]
- else
- . += random_string(DNA_BLOCK_SIZE,GLOB.hex_characters)
- return .
-
-/datum/dna/proc/generate_struc_enzymes()
- var/list/sorting = new /list(DNA_STRUC_ENZYMES_BLOCKS)
- var/result = ""
- for(var/datum/mutation/human/A in GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations)
- if(A.name == RACEMUT && ismonkey(holder))
- sorting[A.dna_block] = num2hex(A.lowest_value + rand(0, 256 * 6), DNA_BLOCK_SIZE)
- mutations |= A
- else
- sorting[A.dna_block] = random_string(DNA_BLOCK_SIZE, list("0","1","2","3","4","5","6"))
-
- for(var/B in sorting)
- result += B
- return result
-
-/datum/dna/proc/generate_unique_enzymes()
- . = ""
- if(istype(holder))
- real_name = holder.real_name
- . += md5(holder.real_name)
- else
- . += random_string(DNA_UNIQUE_ENZYMES_LEN, GLOB.hex_characters)
- return .
-
-/datum/dna/proc/update_ui_block(blocknumber)
- if(!blocknumber || !ishuman(holder))
- return
- var/mob/living/carbon/human/H = holder
- switch(blocknumber)
- if(DNA_HAIR_COLOR_BLOCK)
- setblock(uni_identity, blocknumber, sanitize_hexcolor(H.hair_color))
- if(DNA_FACIAL_HAIR_COLOR_BLOCK)
- setblock(uni_identity, blocknumber, sanitize_hexcolor(H.facial_hair_color))
- if(DNA_SKIN_TONE_BLOCK)
- setblock(uni_identity, blocknumber, construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len))
- if(DNA_EYE_COLOR_BLOCK)
- setblock(uni_identity, blocknumber, sanitize_hexcolor(H.eye_color))
- if(DNA_GENDER_BLOCK)
- setblock(uni_identity, blocknumber, construct_block((H.gender!=MALE)+1, 2))
- if(DNA_FACIAL_HAIR_STYLE_BLOCK)
- setblock(uni_identity, blocknumber, construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len))
- if(DNA_HAIR_STYLE_BLOCK)
- setblock(uni_identity, blocknumber, construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len))
-
-/datum/dna/proc/mutations_say_mods(message)
- if(message)
- for(var/datum/mutation/human/M in mutations)
- message = M.say_mod(message)
- return message
-
-/datum/dna/proc/mutations_get_spans()
- var/list/spans = list()
- for(var/datum/mutation/human/M in mutations)
- spans |= M.get_spans()
- return spans
-
-/datum/dna/proc/species_get_spans()
- var/list/spans = list()
- if(species)
- spans |= species.get_spans()
- return spans
-
-
-/datum/dna/proc/is_same_as(datum/dna/D)
- if(uni_identity == D.uni_identity && struc_enzymes == D.struc_enzymes && real_name == D.real_name)
- if(species.type == D.species.type && features == D.features && blood_type == D.blood_type)
- return 1
- return 0
-
-//used to update dna UI, UE, and dna.real_name.
-/datum/dna/proc/update_dna_identity()
- uni_identity = generate_uni_identity()
- unique_enzymes = generate_unique_enzymes()
-
-/datum/dna/proc/initialize_dna(newblood_type)
- if(newblood_type)
- blood_type = newblood_type
- unique_enzymes = generate_unique_enzymes()
- uni_identity = generate_uni_identity()
- struc_enzymes = generate_struc_enzymes()
- features = random_features()
-
-
-/datum/dna/stored //subtype used by brain mob's stored_dna
-
-/datum/dna/stored/add_mutation(mutation_name) //no mutation changes on stored dna.
- return
-
-/datum/dna/stored/remove_mutation(mutation_name)
- return
-
-/datum/dna/stored/check_mutation(mutation_name)
- return
-
-/datum/dna/stored/remove_all_mutations()
- return
-
-/datum/dna/stored/remove_mutation_group(list/group)
- return
-
-/////////////////////////// DNA MOB-PROCS //////////////////////
-
-/mob/proc/set_species(datum/species/mrace, icon_update = 1)
- return
-
-/mob/living/brain/set_species(datum/species/mrace, icon_update = 1)
- if(mrace)
- if(ispath(mrace))
- stored_dna.species = new mrace()
- else
- stored_dna.species = mrace //not calling any species update procs since we're a brain, not a monkey/human
-
-
-/mob/living/carbon/set_species(datum/species/mrace, icon_update = 1)
- if(mrace && has_dna())
- dna.species.on_species_loss(src)
- var/old_species = dna.species
- if(ispath(mrace))
- dna.species = new mrace()
- else
- dna.species = mrace
- dna.species.on_species_gain(src, old_species)
-
-/mob/living/carbon/human/set_species(datum/species/mrace, icon_update = 1)
- ..()
- if(icon_update)
- update_body()
- update_hair()
- update_body_parts()
- update_mutations_overlay()// no lizard with human hulk overlay please.
-
-
-/mob/proc/has_dna()
- return
-
-/mob/living/carbon/has_dna()
- return dna
-
-
-/mob/living/carbon/human/proc/hardset_dna(ui, se, newreal_name, newblood_type, datum/species/mrace, newfeatures)
-
- if(newfeatures)
- dna.features = newfeatures
- flavor_text = dna.features["flavor_text"] //Update the flavor_text to use new dna text
-
- if(mrace)
- var/datum/species/newrace = new mrace.type
- newrace.copy_properties_from(mrace)
- set_species(newrace, icon_update=0)
-
- if(newreal_name)
- real_name = newreal_name
- dna.generate_unique_enzymes()
-
- if(newblood_type)
- dna.blood_type = newblood_type
-
- if(ui)
- dna.uni_identity = ui
- updateappearance(icon_update=0)
-
- if(se)
- dna.struc_enzymes = se
- domutcheck()
-
- give_genitals(TRUE)//Give all genitalia that DNA says you should have, remove any pre-existing ones as this is a hardset!
-
- if(mrace || newfeatures || ui)
- update_body()
- update_hair()
- update_body_parts()
- update_mutations_overlay()
-
-
-/mob/living/carbon/proc/create_dna()
- dna = new /datum/dna(src)
- if(!dna.species)
- var/rando_race = pick(config.roundstart_races)
- dna.species = new rando_race()
-
-//proc used to update the mob's appearance after its dna UI has been changed
-/mob/living/carbon/proc/updateappearance(icon_update=1, mutcolor_update=0, mutations_overlay_update=0)
- if(!has_dna())
- return
- gender = (deconstruct_block(getblock(dna.uni_identity, DNA_GENDER_BLOCK), 2)-1) ? FEMALE : MALE
-
-/mob/living/carbon/human/updateappearance(icon_update=1, mutcolor_update=0, mutations_overlay_update=0)
- ..()
- var/structure = dna.uni_identity
- hair_color = sanitize_hexcolor(getblock(structure, DNA_HAIR_COLOR_BLOCK))
- facial_hair_color = sanitize_hexcolor(getblock(structure, DNA_FACIAL_HAIR_COLOR_BLOCK))
- skin_tone = GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)]
- eye_color = sanitize_hexcolor(getblock(structure, DNA_EYE_COLOR_BLOCK))
- facial_hair_style = GLOB.facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), GLOB.facial_hair_styles_list.len)]
- hair_style = GLOB.hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), GLOB.hair_styles_list.len)]
- if(icon_update)
- update_body()
- update_hair()
- if(mutcolor_update)
- update_body_parts()
- if(mutations_overlay_update)
- update_mutations_overlay()
-
-
-/mob/proc/domutcheck()
- return
-
-/mob/living/carbon/domutcheck(force_powers=0) //Set force_powers to 1 to bypass the power chance
- if(!has_dna())
- return
-
- for(var/datum/mutation/human/A in GLOB.good_mutations | GLOB.bad_mutations | GLOB.not_good_mutations)
- if(ismob(A.check_block(src, force_powers)))
- return //we got monkeyized/humanized, this mob will be deleted, no need to continue.
-
- update_mutations_overlay()
-
-
-
-/////////////////////////// DNA HELPER-PROCS //////////////////////////////
-/proc/getleftblocks(input,blocknumber,blocksize)
- if(blocknumber > 1)
- return copytext(input,1,((blocksize*blocknumber)-(blocksize-1)))
-
-/proc/getrightblocks(input,blocknumber,blocksize)
- if(blocknumber < (length(input)/blocksize))
- return copytext(input,blocksize*blocknumber+1,length(input)+1)
-
-/proc/getblock(input, blocknumber, blocksize=DNA_BLOCK_SIZE)
- return copytext(input, blocksize*(blocknumber-1)+1, (blocksize*blocknumber)+1)
-
-/proc/setblock(istring, blocknumber, replacement, blocksize=DNA_BLOCK_SIZE)
- if(!istring || !blocknumber || !replacement || !blocksize)
- return 0
- return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
-
-/mob/living/carbon/proc/randmut(list/candidates, difficulty = 2)
- if(!has_dna())
- return
- var/datum/mutation/human/num = pick(candidates)
- . = num.force_give(src)
-
-/mob/living/carbon/proc/randmutb()
- if(!has_dna())
- return
- var/datum/mutation/human/HM = pick((GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT])
- . = HM.force_give(src)
-
-/mob/living/carbon/proc/randmutg()
- if(!has_dna())
- return
- var/datum/mutation/human/HM = pick(GLOB.good_mutations)
- . = HM.force_give(src)
-
-/mob/living/carbon/proc/randmutvg()
- if(!has_dna())
- return
- var/datum/mutation/human/HM = pick((GLOB.good_mutations) - GLOB.mutations_list[HULK] - GLOB.mutations_list[DWARFISM])
- . = HM.force_give(src)
-
-/mob/living/carbon/proc/randmuti()
- if(!has_dna())
- return
- var/num = rand(1, DNA_UNI_IDENTITY_BLOCKS)
- var/newdna = setblock(dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
- dna.uni_identity = newdna
- updateappearance(mutations_overlay_update=1)
-
-/mob/living/carbon/proc/clean_dna()
- if(!has_dna())
- return
- dna.remove_all_mutations()
-
-/mob/living/carbon/proc/clean_randmut(list/candidates, difficulty = 2)
- clean_dna()
- randmut(candidates, difficulty)
-
-/proc/scramble_dna(mob/living/carbon/M, ui=FALSE, se=FALSE, probability)
- if(!M.has_dna())
- return 0
- if(se)
- for(var/i=1, i<=DNA_STRUC_ENZYMES_BLOCKS, i++)
- if(prob(probability))
- M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
- M.domutcheck()
- if(ui)
- for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
- if(prob(probability))
- M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
- M.updateappearance(mutations_overlay_update=1)
- return 1
-
-//value in range 1 to values. values must be greater than 0
-//all arguments assumed to be positive integers
-/proc/construct_block(value, values, blocksize=DNA_BLOCK_SIZE)
- var/width = round((16**blocksize)/values)
- if(value < 1)
- value = 1
- value = (value * width) - rand(1,width)
- return num2hex(value, blocksize)
-
-//value is hex
-/proc/deconstruct_block(value, values, blocksize=DNA_BLOCK_SIZE)
- var/width = round((16**blocksize)/values)
- value = round(hex2num(value) / width) + 1
- if(value > values)
- value = values
- return value
-
-/////////////////////////// DNA HELPER-PROCS
\ No newline at end of file
+/////////////////////////// DNA DATUM
+/datum/dna
+ var/unique_enzymes
+ var/struc_enzymes
+ var/uni_identity
+ var/blood_type
+ var/datum/species/species = new /datum/species/human() //The type of mutant race the player is if applicable (i.e. potato-man)
+ var/list/features = list("FFF") //first value is mutant color
+ var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings,
+ var/list/mutations = list() //All mutations are from now on here
+ var/list/temporary_mutations = list() //Timers for temporary mutations
+ var/list/previous = list() //For temporary name/ui/ue/blood_type modifications
+ var/mob/living/holder
+
+/datum/dna/New(mob/living/new_holder)
+ if(new_holder)
+ holder = new_holder
+
+/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = 0)
+ if(!istype(destination))
+ return
+ destination.dna.unique_enzymes = unique_enzymes
+ destination.dna.uni_identity = uni_identity
+ destination.dna.blood_type = blood_type
+ destination.set_species(species.type, icon_update=0)
+ destination.dna.features = features.Copy()
+ destination.dna.real_name = real_name
+ destination.dna.temporary_mutations = temporary_mutations.Copy()
+ if(transfer_SE)
+ destination.dna.struc_enzymes = struc_enzymes
+
+/datum/dna/proc/copy_dna(datum/dna/new_dna)
+ new_dna.unique_enzymes = unique_enzymes
+ new_dna.struc_enzymes = struc_enzymes
+ new_dna.uni_identity = uni_identity
+ new_dna.blood_type = blood_type
+ new_dna.features = features.Copy()
+ new_dna.species = new species.type
+ new_dna.real_name = real_name
+ new_dna.mutations = mutations.Copy()
+
+/datum/dna/proc/add_mutation(mutation_name)
+ var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
+ HM.on_acquiring(holder)
+
+/datum/dna/proc/remove_mutation(mutation_name)
+ var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
+ HM.on_losing(holder)
+
+/datum/dna/proc/check_mutation(mutation_name)
+ var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name]
+ return mutations.Find(HM)
+
+/datum/dna/proc/remove_all_mutations()
+ remove_mutation_group(mutations)
+
+/datum/dna/proc/remove_mutation_group(list/group)
+ if(!group)
+ return
+ for(var/datum/mutation/human/HM in group)
+ HM.force_lose(holder)
+
+/datum/dna/proc/generate_uni_identity()
+ . = ""
+ var/list/L = new /list(DNA_UNI_IDENTITY_BLOCKS)
+
+ L[DNA_GENDER_BLOCK] = construct_block((holder.gender!=MALE)+1, 2)
+ if(ishuman(holder))
+ var/mob/living/carbon/human/H = holder
+ if(!GLOB.hair_styles_list.len)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/hair,GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list)
+ L[DNA_HAIR_STYLE_BLOCK] = construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len)
+ L[DNA_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.hair_color)
+ if(!GLOB.facial_hair_styles_list.len)
+ init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list)
+ L[DNA_FACIAL_HAIR_STYLE_BLOCK] = construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len)
+ L[DNA_FACIAL_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.facial_hair_color)
+ L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len)
+ L[DNA_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.eye_color)
+
+ for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
+ if(L[i])
+ . += L[i]
+ else
+ . += random_string(DNA_BLOCK_SIZE,GLOB.hex_characters)
+ return .
+
+/datum/dna/proc/generate_struc_enzymes()
+ var/list/sorting = new /list(DNA_STRUC_ENZYMES_BLOCKS)
+ var/result = ""
+ for(var/datum/mutation/human/A in GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations)
+ if(A.name == RACEMUT && ismonkey(holder))
+ sorting[A.dna_block] = num2hex(A.lowest_value + rand(0, 256 * 6), DNA_BLOCK_SIZE)
+ mutations |= A
+ else
+ sorting[A.dna_block] = random_string(DNA_BLOCK_SIZE, list("0","1","2","3","4","5","6"))
+
+ for(var/B in sorting)
+ result += B
+ return result
+
+/datum/dna/proc/generate_unique_enzymes()
+ . = ""
+ if(istype(holder))
+ real_name = holder.real_name
+ . += md5(holder.real_name)
+ else
+ . += random_string(DNA_UNIQUE_ENZYMES_LEN, GLOB.hex_characters)
+ return .
+
+/datum/dna/proc/update_ui_block(blocknumber)
+ if(!blocknumber || !ishuman(holder))
+ return
+ var/mob/living/carbon/human/H = holder
+ switch(blocknumber)
+ if(DNA_HAIR_COLOR_BLOCK)
+ setblock(uni_identity, blocknumber, sanitize_hexcolor(H.hair_color))
+ if(DNA_FACIAL_HAIR_COLOR_BLOCK)
+ setblock(uni_identity, blocknumber, sanitize_hexcolor(H.facial_hair_color))
+ if(DNA_SKIN_TONE_BLOCK)
+ setblock(uni_identity, blocknumber, construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len))
+ if(DNA_EYE_COLOR_BLOCK)
+ setblock(uni_identity, blocknumber, sanitize_hexcolor(H.eye_color))
+ if(DNA_GENDER_BLOCK)
+ setblock(uni_identity, blocknumber, construct_block((H.gender!=MALE)+1, 2))
+ if(DNA_FACIAL_HAIR_STYLE_BLOCK)
+ setblock(uni_identity, blocknumber, construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len))
+ if(DNA_HAIR_STYLE_BLOCK)
+ setblock(uni_identity, blocknumber, construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len))
+
+/datum/dna/proc/mutations_say_mods(message)
+ if(message)
+ for(var/datum/mutation/human/M in mutations)
+ message = M.say_mod(message)
+ return message
+
+/datum/dna/proc/mutations_get_spans()
+ var/list/spans = list()
+ for(var/datum/mutation/human/M in mutations)
+ spans |= M.get_spans()
+ return spans
+
+/datum/dna/proc/species_get_spans()
+ var/list/spans = list()
+ if(species)
+ spans |= species.get_spans()
+ return spans
+
+
+/datum/dna/proc/is_same_as(datum/dna/D)
+ if(uni_identity == D.uni_identity && struc_enzymes == D.struc_enzymes && real_name == D.real_name)
+ if(species.type == D.species.type && features == D.features && blood_type == D.blood_type)
+ return 1
+ return 0
+
+//used to update dna UI, UE, and dna.real_name.
+/datum/dna/proc/update_dna_identity()
+ uni_identity = generate_uni_identity()
+ unique_enzymes = generate_unique_enzymes()
+
+/datum/dna/proc/initialize_dna(newblood_type)
+ if(newblood_type)
+ blood_type = newblood_type
+ unique_enzymes = generate_unique_enzymes()
+ uni_identity = generate_uni_identity()
+ struc_enzymes = generate_struc_enzymes()
+ features = random_features()
+
+
+/datum/dna/stored //subtype used by brain mob's stored_dna
+
+/datum/dna/stored/add_mutation(mutation_name) //no mutation changes on stored dna.
+ return
+
+/datum/dna/stored/remove_mutation(mutation_name)
+ return
+
+/datum/dna/stored/check_mutation(mutation_name)
+ return
+
+/datum/dna/stored/remove_all_mutations()
+ return
+
+/datum/dna/stored/remove_mutation_group(list/group)
+ return
+
+/////////////////////////// DNA MOB-PROCS //////////////////////
+
+/mob/proc/set_species(datum/species/mrace, icon_update = 1)
+ return
+
+/mob/living/brain/set_species(datum/species/mrace, icon_update = 1)
+ if(mrace)
+ if(ispath(mrace))
+ stored_dna.species = new mrace()
+ else
+ stored_dna.species = mrace //not calling any species update procs since we're a brain, not a monkey/human
+
+
+/mob/living/carbon/set_species(datum/species/mrace, icon_update = 1)
+ if(mrace && has_dna())
+ dna.species.on_species_loss(src)
+ var/old_species = dna.species
+ if(ispath(mrace))
+ dna.species = new mrace()
+ else
+ dna.species = mrace
+ dna.species.on_species_gain(src, old_species)
+
+/mob/living/carbon/human/set_species(datum/species/mrace, icon_update = 1)
+ ..()
+ if(icon_update)
+ update_body()
+ update_hair()
+ update_body_parts()
+ update_mutations_overlay()// no lizard with human hulk overlay please.
+
+
+/mob/proc/has_dna()
+ return
+
+/mob/living/carbon/has_dna()
+ return dna
+
+
+/mob/living/carbon/human/proc/hardset_dna(ui, se, newreal_name, newblood_type, datum/species/mrace, newfeatures)
+
+ if(newfeatures)
+ dna.features = newfeatures
+
+ if(mrace)
+ var/datum/species/newrace = new mrace.type
+ newrace.copy_properties_from(mrace)
+ set_species(newrace, icon_update=0)
+
+ if(newreal_name)
+ real_name = newreal_name
+ dna.generate_unique_enzymes()
+
+ if(newblood_type)
+ dna.blood_type = newblood_type
+
+ if(ui)
+ dna.uni_identity = ui
+ updateappearance(icon_update=0)
+
+ if(se)
+ dna.struc_enzymes = se
+ domutcheck()
+
+ if(mrace || newfeatures || ui)
+ update_body()
+ update_hair()
+ update_body_parts()
+ update_mutations_overlay()
+
+
+/mob/living/carbon/proc/create_dna()
+ dna = new /datum/dna(src)
+ if(!dna.species)
+ var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races))
+ dna.species = new rando_race()
+
+//proc used to update the mob's appearance after its dna UI has been changed
+/mob/living/carbon/proc/updateappearance(icon_update=1, mutcolor_update=0, mutations_overlay_update=0)
+ if(!has_dna())
+ return
+ gender = (deconstruct_block(getblock(dna.uni_identity, DNA_GENDER_BLOCK), 2)-1) ? FEMALE : MALE
+
+/mob/living/carbon/human/updateappearance(icon_update=1, mutcolor_update=0, mutations_overlay_update=0)
+ ..()
+ var/structure = dna.uni_identity
+ hair_color = sanitize_hexcolor(getblock(structure, DNA_HAIR_COLOR_BLOCK))
+ facial_hair_color = sanitize_hexcolor(getblock(structure, DNA_FACIAL_HAIR_COLOR_BLOCK))
+ skin_tone = GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)]
+ eye_color = sanitize_hexcolor(getblock(structure, DNA_EYE_COLOR_BLOCK))
+ facial_hair_style = GLOB.facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), GLOB.facial_hair_styles_list.len)]
+ hair_style = GLOB.hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), GLOB.hair_styles_list.len)]
+ if(icon_update)
+ update_body()
+ update_hair()
+ if(mutcolor_update)
+ update_body_parts()
+ if(mutations_overlay_update)
+ update_mutations_overlay()
+
+
+/mob/proc/domutcheck()
+ return
+
+/mob/living/carbon/domutcheck(force_powers=0) //Set force_powers to 1 to bypass the power chance
+ if(!has_dna())
+ return
+
+ for(var/datum/mutation/human/A in GLOB.good_mutations | GLOB.bad_mutations | GLOB.not_good_mutations)
+ if(ismob(A.check_block(src, force_powers)))
+ return //we got monkeyized/humanized, this mob will be deleted, no need to continue.
+
+ update_mutations_overlay()
+
+
+
+/////////////////////////// DNA HELPER-PROCS //////////////////////////////
+/proc/getleftblocks(input,blocknumber,blocksize)
+ if(blocknumber > 1)
+ return copytext(input,1,((blocksize*blocknumber)-(blocksize-1)))
+
+/proc/getrightblocks(input,blocknumber,blocksize)
+ if(blocknumber < (length(input)/blocksize))
+ return copytext(input,blocksize*blocknumber+1,length(input)+1)
+
+/proc/getblock(input, blocknumber, blocksize=DNA_BLOCK_SIZE)
+ return copytext(input, blocksize*(blocknumber-1)+1, (blocksize*blocknumber)+1)
+
+/proc/setblock(istring, blocknumber, replacement, blocksize=DNA_BLOCK_SIZE)
+ if(!istring || !blocknumber || !replacement || !blocksize)
+ return 0
+ return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
+
+/mob/living/carbon/proc/randmut(list/candidates, difficulty = 2)
+ if(!has_dna())
+ return
+ var/datum/mutation/human/num = pick(candidates)
+ . = num.force_give(src)
+
+/mob/living/carbon/proc/randmutb()
+ if(!has_dna())
+ return
+ var/datum/mutation/human/HM = pick((GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT])
+ . = HM.force_give(src)
+
+/mob/living/carbon/proc/randmutg()
+ if(!has_dna())
+ return
+ var/datum/mutation/human/HM = pick(GLOB.good_mutations)
+ . = HM.force_give(src)
+
+/mob/living/carbon/proc/randmutvg()
+ if(!has_dna())
+ return
+ var/datum/mutation/human/HM = pick((GLOB.good_mutations) - GLOB.mutations_list[HULK] - GLOB.mutations_list[DWARFISM])
+ . = HM.force_give(src)
+
+/mob/living/carbon/proc/randmuti()
+ if(!has_dna())
+ return
+ var/num = rand(1, DNA_UNI_IDENTITY_BLOCKS)
+ var/newdna = setblock(dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
+ dna.uni_identity = newdna
+ updateappearance(mutations_overlay_update=1)
+
+/mob/living/carbon/proc/clean_dna()
+ if(!has_dna())
+ return
+ dna.remove_all_mutations()
+
+/mob/living/carbon/proc/clean_randmut(list/candidates, difficulty = 2)
+ clean_dna()
+ randmut(candidates, difficulty)
+
+/proc/scramble_dna(mob/living/carbon/M, ui=FALSE, se=FALSE, probability)
+ if(!M.has_dna())
+ return 0
+ if(se)
+ for(var/i=1, i<=DNA_STRUC_ENZYMES_BLOCKS, i++)
+ if(prob(probability))
+ M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
+ M.domutcheck()
+ if(ui)
+ for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++)
+ if(prob(probability))
+ M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters))
+ M.updateappearance(mutations_overlay_update=1)
+ return 1
+
+//value in range 1 to values. values must be greater than 0
+//all arguments assumed to be positive integers
+/proc/construct_block(value, values, blocksize=DNA_BLOCK_SIZE)
+ var/width = round((16**blocksize)/values)
+ if(value < 1)
+ value = 1
+ value = (value * width) - rand(1,width)
+ return num2hex(value, blocksize)
+
+//value is hex
+/proc/deconstruct_block(value, values, blocksize=DNA_BLOCK_SIZE)
+ var/width = round((16**blocksize)/values)
+ value = round(hex2num(value) / width) + 1
+ if(value > values)
+ value = values
+ return value
+
+/////////////////////////// DNA HELPER-PROCS
diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm
index 5e381c0322..9869b43d8f 100644
--- a/code/datums/explosion.dm
+++ b/code/datums/explosion.dm
@@ -140,7 +140,7 @@ GLOBAL_LIST_EMPTY(explosions)
var/list/exploded_this_tick = list() //open turfs that need to be blocked off while we sleep
var/list/affected_turfs = GatherSpiralTurfs(max_range, epicenter)
- var/reactionary = config.reactionary_explosions
+ var/reactionary = CONFIG_GET(flag/reactionary_explosions)
var/list/cached_exp_block
if(reactionary)
diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm
index c6958fa997..b3dc454ecc 100644
--- a/code/datums/helper_datums/getrev.dm
+++ b/code/datums/helper_datums/getrev.dm
@@ -47,19 +47,17 @@
else
log_world(originmastercommit)
/datum/getrev/proc/DownloadPRDetails()
- if(!config.githubrepoid)
+ var/repo_id = CONFIG_GET(number/githubrepoid)
+ if(!repo_id)
if(testmerge.len)
log_world("PR details download failed: No github repo config set")
return
- if(!isnum(text2num(config.githubrepoid)))
- log_world("PR details download failed: Invalid github repo id: [config.githubrepoid]")
- return
for(var/line in testmerge)
if(!isnum(text2num(line)))
log_world("PR details download failed: Invalid PR number: [line]")
return
- var/url = "https://api.github.com/repositories/[config.githubrepoid]/pulls/[line].json"
+ var/url = "https://api.github.com/repositories/[repo_id]/pulls/[line].json"
GLOB.valid_HTTPSGet = TRUE
var/json = HTTPSGet(url)
if(!json)
@@ -87,7 +85,7 @@
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
continue
- . += "#[line][details]
"
+ . += "#[line][details]
"
/client/verb/showrevinfo()
set category = "OOC"
@@ -101,44 +99,47 @@
to_chat(src, GLOB.revdata.GetTestMergeInfo())
prefix = "Based off origin/master commit: "
var/pc = GLOB.revdata.originmastercommit
- to_chat(src, "[prefix][copytext(pc, 1, min(length(pc), 7))]")
+ to_chat(src, "[prefix][copytext(pc, 1, min(length(pc), 7))]")
else
to_chat(src, "Revision unknown")
to_chat(src, "Current Informational Settings:")
- to_chat(src, "Protect Authority Roles From Traitor: [config.protect_roles_from_antagonist]")
- to_chat(src, "Protect Assistant Role From Traitor: [config.protect_assistant_from_antagonist]")
- to_chat(src, "Enforce Human Authority: [config.enforce_human_authority]")
- to_chat(src, "Allow Latejoin Antagonists: [config.allow_latejoin_antagonists]")
- to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
- to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
- if(config.show_game_type_odds)
+ to_chat(src, "Protect Authority Roles From Traitor: [CONFIG_GET(flag/protect_roles_from_antagonist)]")
+ to_chat(src, "Protect Assistant Role From Traitor: [CONFIG_GET(flag/protect_assistant_from_antagonist)]")
+ to_chat(src, "Enforce Human Authority: [CONFIG_GET(flag/enforce_human_authority)]")
+ to_chat(src, "Allow Latejoin Antagonists: [CONFIG_GET(flag/allow_latejoin_antagonists)]")
+ to_chat(src, "Enforce Continuous Rounds: [length(CONFIG_GET(keyed_flag_list/continuous))] of [config.modes.len] roundtypes")
+ to_chat(src, "Allow Midround Antagonists: [length(CONFIG_GET(keyed_flag_list/midround_antag))] of [config.modes.len] roundtypes")
+ if(CONFIG_GET(flag/show_game_type_odds))
+ var/list/probabilities = CONFIG_GET(keyed_number_list/probability)
if(SSticker.IsRoundInProgress())
var/prob_sum = 0
var/current_odds_differ = FALSE
var/list/probs = list()
var/list/modes = config.gamemode_cache
+ var/list/min_pop = CONFIG_GET(keyed_number_list/min_pop)
+ var/list/max_pop = CONFIG_GET(keyed_number_list/max_pop)
for(var/mode in modes)
var/datum/game_mode/M = mode
var/ctag = initial(M.config_tag)
- if(!(ctag in config.probabilities))
+ if(!(ctag in probabilities))
continue
- if((config.min_pop[ctag] && (config.min_pop[ctag] > SSticker.totalPlayersReady)) || (config.max_pop[ctag] && (config.max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
+ if((min_pop[ctag] && (min_pop[ctag] > SSticker.totalPlayersReady)) || (max_pop[ctag] && (max_pop[ctag] < SSticker.totalPlayersReady)) || (initial(M.required_players) > SSticker.totalPlayersReady))
current_odds_differ = TRUE
continue
probs[ctag] = 1
- prob_sum += config.probabilities[ctag]
+ prob_sum += probabilities[ctag]
if(current_odds_differ)
to_chat(src, "Game Mode Odds for current round:")
for(var/ctag in probs)
- if(config.probabilities[ctag] > 0)
- var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
+ if(probabilities[ctag] > 0)
+ var/percentage = round(probabilities[ctag] / prob_sum * 100, 0.1)
to_chat(src, "[ctag] [percentage]%")
to_chat(src, "All Game Mode Odds:")
var/sum = 0
- for(var/ctag in config.probabilities)
- sum += config.probabilities[ctag]
- for(var/ctag in config.probabilities)
- if(config.probabilities[ctag] > 0)
- var/percentage = round(config.probabilities[ctag] / sum * 100, 0.1)
+ for(var/ctag in probabilities)
+ sum += probabilities[ctag]
+ for(var/ctag in probabilities)
+ if(probabilities[ctag] > 0)
+ var/percentage = round(probabilities[ctag] / sum * 100, 0.1)
to_chat(src, "[ctag] [percentage]%")
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index fafd057fea..b062b8f054 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -118,7 +118,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
else if(dynamic_lighting != DYNAMIC_LIGHTING_IFSTARLIGHT)
dynamic_lighting = DYNAMIC_LIGHTING_DISABLED
if(dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
- dynamic_lighting = config.starlight ? DYNAMIC_LIGHTING_ENABLED : DYNAMIC_LIGHTING_DISABLED
+ dynamic_lighting = CONFIG_GET(flag/starlight) ? DYNAMIC_LIGHTING_ENABLED : DYNAMIC_LIGHTING_DISABLED
. = ..()
diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm
index b1cea567a1..6d97fb52f9 100644
--- a/code/game/gamemodes/blob/blob_finish.dm
+++ b/code/game/gamemodes/blob/blob_finish.dm
@@ -7,7 +7,7 @@
if(B.blob_core || !B.placed)
return 0
if(!GLOB.blob_cores.len) //blob is dead
- if(config.continuous["blob"])
+ if(CONFIG_GET(keyed_flag_list/continuous)["blob"])
message_sent = FALSE //disable the win count at this point
continuous_sanity_checked = 1 //Nonstandard definition of "alive" gets past the check otherwise
SSshuttle.clearHostileEnvironment(src)
diff --git a/code/game/gamemodes/brother/traitor_bro.dm b/code/game/gamemodes/brother/traitor_bro.dm
index 4e8a0dc6b6..0dd3d6be0f 100644
--- a/code/game/gamemodes/brother/traitor_bro.dm
+++ b/code/game/gamemodes/brother/traitor_bro.dm
@@ -17,7 +17,7 @@
/datum/objective_team/brother_team/proc/forge_brother_objectives()
objectives = list()
var/is_hijacker = prob(10)
- for(var/i = 1 to max(1, config.brother_objectives_amount + (members.len > 2) - is_hijacker))
+ for(var/i = 1 to max(1, CONFIG_GET(number/brother_objectives_amount) + (members.len > 2) - is_hijacker))
forge_single_objective()
if(is_hijacker)
if(!locate(/datum/objective/hijack) in objectives)
@@ -58,16 +58,17 @@
var/meeting_areas = list("The Bar", "Dorms", "Escape Dock", "Arrivals", "Holodeck", "Primary Tool Storage", "Recreation Area", "Chapel", "Library")
/datum/game_mode/traitor/bros/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/list/datum/mind/possible_brothers = get_players_for_role(ROLE_BROTHER)
var/num_teams = team_amount
- if(config.brother_scaling_coeff)
- num_teams = max(1, round(num_players()/config.brother_scaling_coeff))
+ var/bsc = CONFIG_GET(number/brother_scaling_coeff)
+ if(bsc)
+ num_teams = max(1, round(num_players() / bsc))
for(var/j = 1 to num_teams)
if(possible_brothers.len < min_team_size || antag_candidates.len <= required_enemies)
diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm
index e67ac26d3a..8d2d7501f4 100644
--- a/code/game/gamemodes/changeling/changeling.dm
+++ b/code/game/gamemodes/changeling/changeling.dm
@@ -52,16 +52,17 @@ GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "w
/datum/game_mode/changeling/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/num_changelings = 1
- if(config.changeling_scaling_coeff)
- num_changelings = max(1, min( round(num_players()/(config.changeling_scaling_coeff*2))+2, round(num_players()/config.changeling_scaling_coeff) ))
+ var/csc = CONFIG_GET(number/changeling_scaling_coeff)
+ if(csc)
+ num_changelings = max(1, min(round(num_players() / (csc * 2)) + 2, round(num_players() / csc)))
else
num_changelings = max(1, min(num_players(), changeling_amount))
@@ -102,10 +103,11 @@ GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "w
..()
/datum/game_mode/changeling/make_antag_chance(mob/living/carbon/human/character) //Assigns changeling to latejoiners
- var/changelingcap = min( round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*2))+2, round(GLOB.joined_player_list.len/config.changeling_scaling_coeff) )
+ var/csc = CONFIG_GET(number/changeling_scaling_coeff)
+ var/changelingcap = min(round(GLOB.joined_player_list.len / (csc * 2)) + 2, round(GLOB.joined_player_list.len / csc))
if(SSticker.mode.changelings.len >= changelingcap) //Caps number of latejoin antagonists
return
- if(SSticker.mode.changelings.len <= (changelingcap - 2) || prob(100 - (config.changeling_scaling_coeff*2)))
+ if(SSticker.mode.changelings.len <= (changelingcap - 2) || prob(100 - (csc * 2)))
if(ROLE_CHANGELING in character.client.prefs.be_special)
if(!jobban_isbanned(character, ROLE_CHANGELING) && !jobban_isbanned(character, "Syndicate"))
if(age_check(character.client))
diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm
index af33b649ed..f951e31c08 100644
--- a/code/game/gamemodes/changeling/traitor_chan.dm
+++ b/code/game/gamemodes/changeling/traitor_chan.dm
@@ -25,18 +25,19 @@
return 1
/datum/game_mode/traitor/changeling/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING)
var/num_changelings = 1
- if(config.changeling_scaling_coeff)
- num_changelings = max(1, min( round(num_players()/(config.changeling_scaling_coeff*4))+2, round(num_players()/(config.changeling_scaling_coeff*2)) ))
+ var/csc = CONFIG_GET(number/changeling_scaling_coeff)
+ if(csc)
+ num_changelings = max(1, min(round(num_players() / (csc * 4)) + 2, round(num_players() / (csc * 2))))
else
num_changelings = max(1, min(num_players(), changeling_amount/2))
@@ -64,11 +65,12 @@
return
/datum/game_mode/traitor/changeling/make_antag_chance(mob/living/carbon/human/character) //Assigns changeling to latejoiners
- var/changelingcap = min( round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*4))+2, round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*2)) )
+ var/csc = CONFIG_GET(number/changeling_scaling_coeff)
+ var/changelingcap = min( round(GLOB.joined_player_list.len / (csc * 4)) + 2, round(GLOB.joined_player_list.len / (csc * 2)))
if(SSticker.mode.changelings.len >= changelingcap) //Caps number of latejoin antagonists
..()
return
- if(SSticker.mode.changelings.len <= (changelingcap - 2) || prob(100 / (config.changeling_scaling_coeff * 4)))
+ if(SSticker.mode.changelings.len <= (changelingcap - 2) || prob(100 / (csc * 4)))
if(ROLE_CHANGELING in character.client.prefs.be_special)
if(!jobban_isbanned(character, ROLE_CHANGELING) && !jobban_isbanned(character, "Syndicate"))
if(age_check(character.client))
diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm
index 8272a652de..0e72fe93aa 100644
--- a/code/game/gamemodes/clock_cult/clock_cult.dm
+++ b/code/game/gamemodes/clock_cult/clock_cult.dm
@@ -107,9 +107,9 @@ Credit where due:
var/ark_time //In minutes, how long the Ark waits before activation; this is equal to 30 + (number of players / 5) (max 40 mins.)
/datum/game_mode/clockwork_cult/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/starter_servants = 4 //Guaranteed four servants
var/number_players = num_players()
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index 6406232596..868e02589b 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -55,10 +55,10 @@
/datum/game_mode/cult/pre_setup()
cult_objectives += "sacrifice"
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
//cult scaling goes here
diff --git a/code/game/gamemodes/devil/devil_game_mode.dm b/code/game/gamemodes/devil/devil_game_mode.dm
index 755fdef87f..844b027e93 100644
--- a/code/game/gamemodes/devil/devil_game_mode.dm
+++ b/code/game/gamemodes/devil/devil_game_mode.dm
@@ -20,15 +20,16 @@
+ Crew: Resist the lure of sin and remain pure!"
/datum/game_mode/devil/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/num_devils = 1
- if(config.traitor_scaling_coeff)
- num_devils = max(minimum_devils, min( round(num_players()/(config.traitor_scaling_coeff*3))+ 2 + num_modifier, round(num_players()/(config.traitor_scaling_coeff*1.5)) + num_modifier ))
+ var/tsc = CONFIG_GET(number/traitor_scaling_coeff)
+ if(tsc)
+ num_devils = max(minimum_devils, min( round(num_players() / (tsc * 3))+ 2 + num_modifier, round(num_players() / (tsc * 1.5)) + num_modifier))
else
num_devils = max(minimum_devils, min(num_players(), traitors_possible))
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index 18a19fb153..9f67693613 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -78,7 +78,7 @@
///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things
/datum/game_mode/proc/post_setup(report) //Gamemodes can override the intercept report. Passing TRUE as the argument will force a report.
if(!report)
- report = config.intercept
+ report = !CONFIG_GET(flag/no_intercept_report)
addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME)
if(SSdbcore.Connect())
@@ -113,8 +113,9 @@
for(var/mob/Player in GLOB.mob_list)
if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) && !isbrain(Player) && Player.client)
living_crew += Player
- if(living_crew.len / GLOB.joined_player_list.len <= config.midround_antag_life_check) //If a lot of the player base died, we start fresh
- message_admins("Convert_roundtype failed due to too many dead people. Limit is [config.midround_antag_life_check * 100]% living crew")
+ var/malc = CONFIG_GET(number/midround_antag_life_check)
+ if(living_crew.len / GLOB.joined_player_list.len <= malc) //If a lot of the player base died, we start fresh
+ message_admins("Convert_roundtype failed due to too many dead people. Limit is [malc * 100]% living crew")
return null
var/list/datum/game_mode/runnable_modes = config.get_runnable_midround_modes(living_crew.len)
@@ -138,8 +139,9 @@
if(SSshuttle.emergency.timeLeft(1) < initial(SSshuttle.emergencyCallTime)*0.5)
return 1
- if(world.time >= (config.midround_antag_time_check * 600))
- message_admins("Convert_roundtype failed due to round length. Limit is [config.midround_antag_time_check] minutes.")
+ var/matc = CONFIG_GET(number/midround_antag_time_check)
+ if(world.time >= (matc * 600))
+ message_admins("Convert_roundtype failed due to round length. Limit is [matc] minutes.")
return null
var/list/antag_candidates = list()
@@ -154,9 +156,9 @@
antag_candidates = shuffle(antag_candidates)
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
replacementmode.restricted_jobs += replacementmode.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
replacementmode.restricted_jobs += "Assistant"
message_admins("The roundtype will be converted. If you have other plans for the station or feel the station is too messed up to inhabit stop the creation of antags or end the round now.")
@@ -168,7 +170,7 @@
round_converted = 0
return
//somewhere between 1 and 3 minutes from now
- if(!config.midround_antag[SSticker.mode.config_tag])
+ if(!CONFIG_GET(keyed_flag_list/midround_antag)[SSticker.mode.config_tag])
round_converted = 0
return 1
for(var/mob/living/carbon/human/H in antag_candidates)
@@ -189,7 +191,9 @@
return TRUE
if(station_was_nuked)
return TRUE
- if(!round_converted && (!config.continuous[config_tag] || (config.continuous[config_tag] && config.midround_antag[config_tag]))) //Non-continuous or continous with replacement antags
+ var/list/continuous = CONFIG_GET(keyed_flag_list/continuous)
+ var/list/midround_antag = CONFIG_GET(keyed_flag_list/midround_antag)
+ if(!round_converted && (!continuous[config_tag] || (continuous[config_tag] && midround_antag[config_tag]))) //Non-continuous or continous with replacement antags
if(!continuous_sanity_checked) //make sure we have antags to be checking in the first place
for(var/mob/Player in GLOB.mob_list)
if(Player.mind)
@@ -198,8 +202,8 @@
return 0
if(!continuous_sanity_checked)
message_admins("The roundtype ([config_tag]) has no antagonists, continuous round has been defaulted to on and midround_antag has been defaulted to off.")
- config.continuous[config_tag] = 1
- config.midround_antag[config_tag] = 0
+ continuous[config_tag] = TRUE
+ midround_antag[config_tag] = FALSE
SSshuttle.clearHostileEnvironment(src)
return 0
@@ -213,7 +217,7 @@
living_antag_player = Player
return 0
- if(!config.continuous[config_tag] || force_ending)
+ if(!continuous[config_tag] || force_ending)
return 1
else
@@ -222,7 +226,7 @@
if(round_ends_with_antag_death)
return 1
else
- config.midround_antag[config_tag] = 0
+ midround_antag[config_tag] = 0
return 0
return 0
@@ -517,7 +521,7 @@
/datum/game_mode/proc/get_remaining_days(client/C)
if(!C)
return 0
- if(!config.use_age_restriction_for_jobs)
+ if(!CONFIG_GET(flag/use_age_restriction_for_jobs))
return 0
if(!isnum(C.player_age))
return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced
diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm
index ed5c2e9d76..d6f1b775e9 100644
--- a/code/game/gamemodes/miniantags/abduction/abduction.dm
+++ b/code/game/gamemodes/miniantags/abduction/abduction.dm
@@ -34,7 +34,7 @@
to_chat(world, "Crew - don't get abducted and stop the abductors.")
/datum/game_mode/abduction/pre_setup()
- var/num_teams = max(1, min(max_teams, round(num_players() / config.abductor_scaling_coeff)))
+ var/num_teams = max(1, min(max_teams, round(num_players() / CONFIG_GET(number/abductor_scaling_coeff))))
var/possible_teams = max(1, round(antag_candidates.len / 2))
num_teams = min(num_teams, possible_teams)
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
index 0a7427b610..99059e7a25 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
@@ -62,7 +62,7 @@
/obj/machinery/abductor/experiment/proc/dissection_icon(mob/living/carbon/human/H)
var/icon/photo = null
var/g = (H.gender == FEMALE) ? "f" : "m"
- if(!config.mutant_races || H.dna.species.use_skintones)
+ if(!CONFIG_GET(flag/join_with_mutant_race) || H.dna.species.use_skintones)
photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.skin_tone]_[g]")
else
photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.dna.species.id]_[g]")
diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm
index f51b9ac914..6e7a567324 100644
--- a/code/game/gamemodes/nuclear/nuclear_challenge.dm
+++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm
@@ -58,7 +58,7 @@
U.hidden_uplink.owner = "[user.key]"
U.hidden_uplink.telecrystals = CHALLENGE_TELECRYSTALS
U.hidden_uplink.set_gamemode(/datum/game_mode/nuclear)
- config.shuttle_refuel_delay = max(config.shuttle_refuel_delay, CHALLENGE_SHUTTLE_DELAY)
+ CONFIG_SET(number/shuttle_refuel_delay, max(CONFIG_GET(number/shuttle_refuel_delay), CHALLENGE_SHUTTLE_DELAY))
SSblackbox.set_val("nuclear_challenge_mode",1)
qdel(src)
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index d538c7f75e..ecfe8cfc44 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -44,10 +44,10 @@
///////////////////////////////////////////////////////////////////////////////
/datum/game_mode/revolution/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
for (var/i=1 to max_headrevs)
@@ -230,7 +230,7 @@
//Checks if the round is over//
///////////////////////////////
/datum/game_mode/revolution/check_finished()
- if(config.continuous["revolution"])
+ if(CONFIG_GET(keyed_flag_list/continuous)["revolution"])
if(finished)
SSshuttle.clearHostileEnvironment(src)
return ..()
diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm
index 7a17d54b4c..f6c53a07f4 100644
--- a/code/game/gamemodes/sandbox/h_sandbox.dm
+++ b/code/game/gamemodes/sandbox/h_sandbox.dm
@@ -1,303 +1,303 @@
-
-
-GLOBAL_VAR_INIT(hsboxspawn, TRUE)
-
-/mob
- var/datum/hSB/sandbox = null
-/mob/proc/CanBuild()
- sandbox = new/datum/hSB
- sandbox.owner = src.ckey
- if(src.client.holder)
- sandbox.admin = 1
- verbs += new/mob/proc/sandbox_panel
-/mob/proc/sandbox_panel()
- set name = "Sandbox Panel"
- if(sandbox)
- sandbox.update()
-
-/datum/hSB
- var/owner = null
- var/admin = 0
-
+
+
+GLOBAL_VAR_INIT(hsboxspawn, TRUE)
+
+/mob
+ var/datum/hSB/sandbox = null
+/mob/proc/CanBuild()
+ sandbox = new/datum/hSB
+ sandbox.owner = src.ckey
+ if(src.client.holder)
+ sandbox.admin = 1
+ verbs += new/mob/proc/sandbox_panel
+/mob/proc/sandbox_panel()
+ set name = "Sandbox Panel"
+ if(sandbox)
+ sandbox.update()
+
+/datum/hSB
+ var/owner = null
+ var/admin = 0
+
var/static/clothinfo = null
var/static/reaginfo = null
var/static/objinfo = null
- var/canisterinfo = null
- var/hsbinfo = null
- //items that shouldn't spawn on the floor because they would bug or act weird
- var/global/list/spawn_forbidden = list(
- /obj/item/tk_grab, /obj/item/implant, // not implanter, the actual thing that is inside you
+ var/canisterinfo = null
+ var/hsbinfo = null
+ //items that shouldn't spawn on the floor because they would bug or act weird
+ var/global/list/spawn_forbidden = list(
+ /obj/item/tk_grab, /obj/item/implant, // not implanter, the actual thing that is inside you
/obj/item/assembly, /obj/item/device/onetankbomb, /obj/item/radio, /obj/item/device/pda/ai,
- /obj/item/device/uplink, /obj/item/smallDelivery, /obj/item/projectile,
+ /obj/item/device/uplink, /obj/item/smallDelivery, /obj/item/projectile,
/obj/item/borg/sight, /obj/item/borg/stun, /obj/item/robot_module)
-
-/datum/hSB/proc/update()
- var/global/list/hrefs = list(
- "Space Gear",
- "Suit Up (Space Travel Gear)" = "hsbsuit",
- "Spawn Gas Mask" = "hsbspawn&path=[/obj/item/clothing/mask/gas]",
- "Spawn Emergency Air Tank" = "hsbspawn&path=[/obj/item/tank/internals/emergency_oxygen/double]",
-
- "Standard Tools",
- "Spawn Flashlight" = "hsbspawn&path=[/obj/item/device/flashlight]",
- "Spawn Toolbox" = "hsbspawn&path=[/obj/item/storage/toolbox/mechanical]",
- "Spawn Light Replacer" = "hsbspawn&path=[/obj/item/device/lightreplacer]",
- "Spawn Medical Kit" = "hsbspawn&path=[/obj/item/storage/firstaid/regular]",
- "Spawn All-Access ID" = "hsbaaid",
-
- "Building Supplies",
- "Spawn 50 Wood" = "hsbwood",
- "Spawn 50 Metal" = "hsbmetal",
- "Spawn 50 Plasteel" = "hsbplasteel",
- "Spawn 50 Reinforced Glass" = "hsbrglass",
- "Spawn 50 Glass" = "hsbglass",
- "Spawn Full Cable Coil" = "hsbspawn&path=[/obj/item/stack/cable_coil]",
- "Spawn Hyper Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/hyper]",
- "Spawn Inf. Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/infinite]",
- "Spawn Rapid Construction Device" = "hsbrcd",
- "Spawn RCD Ammo" = "hsb_safespawn&path=[/obj/item/rcd_ammo]",
- "Spawn Airlock" = "hsbairlock",
-
- "Miscellaneous",
- "Spawn Air Scrubber" = "hsbscrubber",
- "Spawn Welding Fuel Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/fueltank]",
- "Spawn Water Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/watertank]",
-
- "Bots",
- "Spawn Cleanbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/cleanbot]",
- "Spawn Floorbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/floorbot]",
- "Spawn Medbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/medbot]",
-
- "Canisters",
- "Spawn O2 Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/oxygen]",
- "Spawn Air Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/air]")
-
-
- if(!hsbinfo)
- hsbinfo = "Sandbox Panel
"
- if(admin)
- hsbinfo += "Administration
"
- hsbinfo += "- Toggle Object Spawning
"
- hsbinfo += "- Toggle Item Spawn Panel Auto-close
"
- hsbinfo += "Canister Spawning
"
- hsbinfo += "- Spawn Plasma Canister
"
- hsbinfo += "- Spawn CO2 Canister
"
- hsbinfo += "- Spawn Nitrogen Canister
"
- hsbinfo += "- Spawn N2O Canister
"
- else
- hsbinfo += "Some item spawning may be disabled by the administrators.
"
- hsbinfo += "Only administrators may spawn dangerous canisters.
"
- for(var/T in hrefs)
- var/href = hrefs[T]
- if(href)
- hsbinfo += "- [T]
"
- else
- hsbinfo += "
[T]
"
- hsbinfo += "
"
- hsbinfo += "- Spawn Clothing...
"
- hsbinfo += "- Spawn Reagent Container...
"
- hsbinfo += "- Spawn Other Item...
"
-
- usr << browse(hsbinfo, "window=hsbpanel")
-
-/datum/hSB/Topic(href, href_list)
- if(!usr || !src || !(src.owner == usr.ckey))
- if(usr)
- usr << browse(null,"window=sandbox")
- return
-
- if(href_list["hsb"])
- switch(href_list["hsb"])
- //
- // Admin: toggle spawning
- //
- if("hsbtobj")
- if(!admin) return
- if(GLOB.hsboxspawn)
- to_chat(world, "Sandbox: \black[usr.key] has disabled object spawning!")
- GLOB.hsboxspawn = FALSE
- return
- else
- to_chat(world, "Sandbox: \black[usr.key] has enabled object spawning!")
- GLOB.hsboxspawn = TRUE
- return
- //
- // Admin: Toggle auto-close
- //
- if("hsbtac")
- if(!admin) return
- if(config.sandbox_autoclose)
- to_chat(world, "Sandbox: \black [usr.key] has removed the object spawn limiter.")
- config.sandbox_autoclose = FALSE
- else
- to_chat(world, "Sandbox: \black [usr.key] has added a limiter to object spawning. The window will now auto-close after use.")
- config.sandbox_autoclose = TRUE
- return
- //
- // Spacesuit with full air jetpack set as internals
- //
- if("hsbsuit")
- var/mob/living/carbon/human/P = usr
- if(!istype(P)) return
- if(P.wear_suit)
- P.wear_suit.loc = P.loc
- P.wear_suit.layer = initial(P.wear_suit.layer)
- P.wear_suit.plane = initial(P.wear_suit.plane)
- P.wear_suit = null
- P.wear_suit = new/obj/item/clothing/suit/space(P)
- P.wear_suit.layer = ABOVE_HUD_LAYER
- P.wear_suit.plane = ABOVE_HUD_PLANE
- P.update_inv_wear_suit()
- if(P.head)
- P.head.loc = P.loc
- P.head.layer = initial(P.head.layer)
- P.head.plane = initial(P.head.plane)
- P.head = null
- P.head = new/obj/item/clothing/head/helmet/space(P)
- P.head.layer = ABOVE_HUD_LAYER
- P.head.plane = ABOVE_HUD_PLANE
- P.update_inv_head()
- if(P.wear_mask)
- P.wear_mask.loc = P.loc
- P.wear_mask.layer = initial(P.wear_mask.layer)
- P.wear_mask.plane = initial(P.wear_mask.plane)
- P.wear_mask = null
- P.wear_mask = new/obj/item/clothing/mask/gas(P)
- P.wear_mask.layer = ABOVE_HUD_LAYER
- P.wear_mask.plane = ABOVE_HUD_PLANE
- P.update_inv_wear_mask()
- if(P.back)
- P.back.loc = P.loc
- P.back.layer = initial(P.back.layer)
- P.back.plane = initial(P.back.plane)
- P.back = null
- P.back = new/obj/item/tank/jetpack/oxygen(P)
- P.back.layer = ABOVE_HUD_LAYER
- P.back.plane = ABOVE_HUD_PLANE
- P.update_inv_back()
- P.internal = P.back
- P.update_internals_hud_icon(1)
-
- if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it
- var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc)
- hsb.update_icon() // hackish but it wasn't meant to be spawned I guess?
-
- //
- // Stacked Materials
- //
-
- if("hsbrglass")
- new/obj/item/stack/sheet/rglass{amount=50}(usr.loc)
-
- if("hsbmetal")
- new/obj/item/stack/sheet/metal{amount=50}(usr.loc)
-
- if("hsbplasteel")
- new/obj/item/stack/sheet/plasteel{amount=50}(usr.loc)
-
- if("hsbglass")
- new/obj/item/stack/sheet/glass{amount=50}(usr.loc)
-
- if("hsbwood")
- new/obj/item/stack/sheet/mineral/wood{amount=50}(usr.loc)
-
- //
- // All access ID
- //
- if("hsbaaid")
- var/obj/item/card/id/gold/ID = new(usr.loc)
- ID.registered_name = usr.real_name
- ID.assignment = "Sandbox"
- ID.access = get_all_accesses()
- ID.update_label()
-
- //
- // RCD - starts with full clip
- // Spawn check due to grief potential (destroying floors, walls, etc)
- //
- if("hsbrcd")
- if(!GLOB.hsboxspawn) return
-
- new/obj/item/construction/rcd/combat(usr.loc)
-
- //
- // New sandbox airlock maker
- //
- if("hsbairlock")
- new /datum/airlock_maker(usr.loc)
-
- //
- // Object spawn window
- //
-
- // Clothing
- if("hsbcloth")
- if(!GLOB.hsboxspawn) return
-
- if(!clothinfo)
- clothinfo = "Clothing (Reagent Containers) (Other Items)
"
- var/list/all_items = subtypesof(/obj/item/clothing)
- for(var/typekey in spawn_forbidden)
- all_items -= typesof(typekey)
- for(var/O in reverseRange(all_items))
- clothinfo += "[O]
"
-
- usr << browse(clothinfo,"window=sandbox")
-
- // Reagent containers
- if("hsbreag")
- if(!GLOB.hsboxspawn) return
-
- if(!reaginfo)
- reaginfo = "Reagent Containers (Clothing) (Other Items)
"
- var/list/all_items = subtypesof(/obj/item/reagent_containers)
- for(var/typekey in spawn_forbidden)
- all_items -= typesof(typekey)
- for(var/O in reverseRange(all_items))
- reaginfo += "[O]
"
-
- usr << browse(reaginfo,"window=sandbox")
-
- // Other items
- if("hsbobj")
- if(!GLOB.hsboxspawn) return
-
- if(!objinfo)
- objinfo = "Other Items (Clothing) (Reagent Containers)
"
- var/list/all_items = subtypesof(/obj/item/) - typesof(/obj/item/clothing) - typesof(/obj/item/reagent_containers)
- for(var/typekey in spawn_forbidden)
- all_items -= typesof(typekey)
-
- for(var/O in reverseRange(all_items))
- objinfo += "[O]
"
-
- usr << browse(objinfo,"window=sandbox")
-
- //
- // Safespawn checks to see if spawning is disabled.
- //
- if("hsb_safespawn")
- if(!GLOB.hsboxspawn)
- usr << browse(null,"window=sandbox")
- return
-
- var/typepath = text2path(href_list["path"])
- if(!typepath)
- to_chat(usr, "Bad path: \"[href_list["path"]]\"")
- return
- new typepath(usr.loc)
-
- if(config.sandbox_autoclose)
- usr << browse(null,"window=sandbox")
- //
- // For everything else in the href list
- //
- if("hsbspawn")
- var/typepath = text2path(href_list["path"])
- if(!typepath)
- to_chat(usr, "Bad path: \"[href_list["path"]]\"")
- return
- new typepath(usr.loc)
-
- if(config.sandbox_autoclose)
- usr << browse(null,"window=sandbox")
+
+/datum/hSB/proc/update()
+ var/global/list/hrefs = list(
+ "Space Gear",
+ "Suit Up (Space Travel Gear)" = "hsbsuit",
+ "Spawn Gas Mask" = "hsbspawn&path=[/obj/item/clothing/mask/gas]",
+ "Spawn Emergency Air Tank" = "hsbspawn&path=[/obj/item/tank/internals/emergency_oxygen/double]",
+
+ "Standard Tools",
+ "Spawn Flashlight" = "hsbspawn&path=[/obj/item/device/flashlight]",
+ "Spawn Toolbox" = "hsbspawn&path=[/obj/item/storage/toolbox/mechanical]",
+ "Spawn Light Replacer" = "hsbspawn&path=[/obj/item/device/lightreplacer]",
+ "Spawn Medical Kit" = "hsbspawn&path=[/obj/item/storage/firstaid/regular]",
+ "Spawn All-Access ID" = "hsbaaid",
+
+ "Building Supplies",
+ "Spawn 50 Wood" = "hsbwood",
+ "Spawn 50 Metal" = "hsbmetal",
+ "Spawn 50 Plasteel" = "hsbplasteel",
+ "Spawn 50 Reinforced Glass" = "hsbrglass",
+ "Spawn 50 Glass" = "hsbglass",
+ "Spawn Full Cable Coil" = "hsbspawn&path=[/obj/item/stack/cable_coil]",
+ "Spawn Hyper Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/hyper]",
+ "Spawn Inf. Capacity Power Cell" = "hsbspawn&path=[/obj/item/stock_parts/cell/infinite]",
+ "Spawn Rapid Construction Device" = "hsbrcd",
+ "Spawn RCD Ammo" = "hsb_safespawn&path=[/obj/item/rcd_ammo]",
+ "Spawn Airlock" = "hsbairlock",
+
+ "Miscellaneous",
+ "Spawn Air Scrubber" = "hsbscrubber",
+ "Spawn Welding Fuel Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/fueltank]",
+ "Spawn Water Tank" = "hsbspawn&path=[/obj/structure/reagent_dispensers/watertank]",
+
+ "Bots",
+ "Spawn Cleanbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/cleanbot]",
+ "Spawn Floorbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/floorbot]",
+ "Spawn Medbot" = "hsbspawn&path=[/mob/living/simple_animal/bot/medbot]",
+
+ "Canisters",
+ "Spawn O2 Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/oxygen]",
+ "Spawn Air Canister" = "hsbspawn&path=[/obj/machinery/portable_atmospherics/canister/air]")
+
+
+ if(!hsbinfo)
+ hsbinfo = "Sandbox Panel
"
+ if(admin)
+ hsbinfo += "Administration
"
+ hsbinfo += "- Toggle Object Spawning
"
+ hsbinfo += "- Toggle Item Spawn Panel Auto-close
"
+ hsbinfo += "Canister Spawning
"
+ hsbinfo += "- Spawn Plasma Canister
"
+ hsbinfo += "- Spawn CO2 Canister
"
+ hsbinfo += "- Spawn Nitrogen Canister
"
+ hsbinfo += "- Spawn N2O Canister
"
+ else
+ hsbinfo += "Some item spawning may be disabled by the administrators.
"
+ hsbinfo += "Only administrators may spawn dangerous canisters.
"
+ for(var/T in hrefs)
+ var/href = hrefs[T]
+ if(href)
+ hsbinfo += "- [T]
"
+ else
+ hsbinfo += "
[T]
"
+ hsbinfo += "
"
+ hsbinfo += "- Spawn Clothing...
"
+ hsbinfo += "- Spawn Reagent Container...
"
+ hsbinfo += "- Spawn Other Item...
"
+
+ usr << browse(hsbinfo, "window=hsbpanel")
+
+/datum/hSB/Topic(href, href_list)
+ if(!usr || !src || !(src.owner == usr.ckey))
+ if(usr)
+ usr << browse(null,"window=sandbox")
+ return
+
+ if(href_list["hsb"])
+ switch(href_list["hsb"])
+ //
+ // Admin: toggle spawning
+ //
+ if("hsbtobj")
+ if(!admin) return
+ if(GLOB.hsboxspawn)
+ to_chat(world, "Sandbox: \black[usr.key] has disabled object spawning!")
+ GLOB.hsboxspawn = FALSE
+ return
+ else
+ to_chat(world, "Sandbox: \black[usr.key] has enabled object spawning!")
+ GLOB.hsboxspawn = TRUE
+ return
+ //
+ // Admin: Toggle auto-close
+ //
+ if("hsbtac")
+ if(!admin) return
+ var/sbac = CONFIG_GET(flag/sandbox_autoclose)
+ if(sbac)
+ to_chat(world, "Sandbox: \black [usr.key] has removed the object spawn limiter.")
+ else
+ to_chat(world, "Sandbox: \black [usr.key] has added a limiter to object spawning. The window will now auto-close after use.")
+ CONFIG_SET(flag/sandbox_autoclose, !sbac)
+ return
+ //
+ // Spacesuit with full air jetpack set as internals
+ //
+ if("hsbsuit")
+ var/mob/living/carbon/human/P = usr
+ if(!istype(P)) return
+ if(P.wear_suit)
+ P.wear_suit.loc = P.loc
+ P.wear_suit.layer = initial(P.wear_suit.layer)
+ P.wear_suit.plane = initial(P.wear_suit.plane)
+ P.wear_suit = null
+ P.wear_suit = new/obj/item/clothing/suit/space(P)
+ P.wear_suit.layer = ABOVE_HUD_LAYER
+ P.wear_suit.plane = ABOVE_HUD_PLANE
+ P.update_inv_wear_suit()
+ if(P.head)
+ P.head.loc = P.loc
+ P.head.layer = initial(P.head.layer)
+ P.head.plane = initial(P.head.plane)
+ P.head = null
+ P.head = new/obj/item/clothing/head/helmet/space(P)
+ P.head.layer = ABOVE_HUD_LAYER
+ P.head.plane = ABOVE_HUD_PLANE
+ P.update_inv_head()
+ if(P.wear_mask)
+ P.wear_mask.loc = P.loc
+ P.wear_mask.layer = initial(P.wear_mask.layer)
+ P.wear_mask.plane = initial(P.wear_mask.plane)
+ P.wear_mask = null
+ P.wear_mask = new/obj/item/clothing/mask/gas(P)
+ P.wear_mask.layer = ABOVE_HUD_LAYER
+ P.wear_mask.plane = ABOVE_HUD_PLANE
+ P.update_inv_wear_mask()
+ if(P.back)
+ P.back.loc = P.loc
+ P.back.layer = initial(P.back.layer)
+ P.back.plane = initial(P.back.plane)
+ P.back = null
+ P.back = new/obj/item/tank/jetpack/oxygen(P)
+ P.back.layer = ABOVE_HUD_LAYER
+ P.back.plane = ABOVE_HUD_PLANE
+ P.update_inv_back()
+ P.internal = P.back
+ P.update_internals_hud_icon(1)
+
+ if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it
+ var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc)
+ hsb.update_icon() // hackish but it wasn't meant to be spawned I guess?
+
+ //
+ // Stacked Materials
+ //
+
+ if("hsbrglass")
+ new/obj/item/stack/sheet/rglass{amount=50}(usr.loc)
+
+ if("hsbmetal")
+ new/obj/item/stack/sheet/metal{amount=50}(usr.loc)
+
+ if("hsbplasteel")
+ new/obj/item/stack/sheet/plasteel{amount=50}(usr.loc)
+
+ if("hsbglass")
+ new/obj/item/stack/sheet/glass{amount=50}(usr.loc)
+
+ if("hsbwood")
+ new/obj/item/stack/sheet/mineral/wood{amount=50}(usr.loc)
+
+ //
+ // All access ID
+ //
+ if("hsbaaid")
+ var/obj/item/card/id/gold/ID = new(usr.loc)
+ ID.registered_name = usr.real_name
+ ID.assignment = "Sandbox"
+ ID.access = get_all_accesses()
+ ID.update_label()
+
+ //
+ // RCD - starts with full clip
+ // Spawn check due to grief potential (destroying floors, walls, etc)
+ //
+ if("hsbrcd")
+ if(!GLOB.hsboxspawn) return
+
+ new/obj/item/construction/rcd/combat(usr.loc)
+
+ //
+ // New sandbox airlock maker
+ //
+ if("hsbairlock")
+ new /datum/airlock_maker(usr.loc)
+
+ //
+ // Object spawn window
+ //
+
+ // Clothing
+ if("hsbcloth")
+ if(!GLOB.hsboxspawn) return
+
+ if(!clothinfo)
+ clothinfo = "Clothing (Reagent Containers) (Other Items)
"
+ var/list/all_items = subtypesof(/obj/item/clothing)
+ for(var/typekey in spawn_forbidden)
+ all_items -= typesof(typekey)
+ for(var/O in reverseRange(all_items))
+ clothinfo += "[O]
"
+
+ usr << browse(clothinfo,"window=sandbox")
+
+ // Reagent containers
+ if("hsbreag")
+ if(!GLOB.hsboxspawn) return
+
+ if(!reaginfo)
+ reaginfo = "Reagent Containers (Clothing) (Other Items)
"
+ var/list/all_items = subtypesof(/obj/item/reagent_containers)
+ for(var/typekey in spawn_forbidden)
+ all_items -= typesof(typekey)
+ for(var/O in reverseRange(all_items))
+ reaginfo += "[O]
"
+
+ usr << browse(reaginfo,"window=sandbox")
+
+ // Other items
+ if("hsbobj")
+ if(!GLOB.hsboxspawn) return
+
+ if(!objinfo)
+ objinfo = "Other Items (Clothing) (Reagent Containers)
"
+ var/list/all_items = subtypesof(/obj/item/) - typesof(/obj/item/clothing) - typesof(/obj/item/reagent_containers)
+ for(var/typekey in spawn_forbidden)
+ all_items -= typesof(typekey)
+
+ for(var/O in reverseRange(all_items))
+ objinfo += "[O]
"
+
+ usr << browse(objinfo,"window=sandbox")
+
+ //
+ // Safespawn checks to see if spawning is disabled.
+ //
+ if("hsb_safespawn")
+ if(!GLOB.hsboxspawn)
+ usr << browse(null,"window=sandbox")
+ return
+
+ var/typepath = text2path(href_list["path"])
+ if(!typepath)
+ to_chat(usr, "Bad path: \"[href_list["path"]]\"")
+ return
+ new typepath(usr.loc)
+
+ if(CONFIG_GET(flag/sandbox_autoclose))
+ usr << browse(null,"window=sandbox")
+ //
+ // For everything else in the href list
+ //
+ if("hsbspawn")
+ var/typepath = text2path(href_list["path"])
+ if(!typepath)
+ to_chat(usr, "Bad path: \"[href_list["path"]]\"")
+ return
+ new typepath(usr.loc)
+
+ if(CONFIG_GET(flag/sandbox_autoclose))
+ usr << browse(null,"window=sandbox")
diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm
index 77b91a8571..64d4f84eec 100644
--- a/code/game/gamemodes/traitor/traitor.dm
+++ b/code/game/gamemodes/traitor/traitor.dm
@@ -31,16 +31,17 @@
/datum/game_mode/traitor/pre_setup()
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"
var/num_traitors = 1
- if(config.traitor_scaling_coeff)
- num_traitors = max(1, min( round(num_players()/(config.traitor_scaling_coeff*2))+ 2 + num_modifier, round(num_players()/(config.traitor_scaling_coeff)) + num_modifier ))
+ var/tsc = CONFIG_GET(number/traitor_scaling_coeff)
+ if(tsc)
+ num_traitors = max(1, min(round(num_players() / (tsc * 2)) + 2 + num_modifier, round(num_players() / tsc) + num_modifier))
else
num_traitors = max(1, min(num_players(), traitors_possible))
@@ -68,10 +69,11 @@
return 1
/datum/game_mode/traitor/make_antag_chance(mob/living/carbon/human/character) //Assigns traitor to latejoiners
- var/traitorcap = min(round(GLOB.joined_player_list.len / (config.traitor_scaling_coeff * 2)) + 2 + num_modifier, round(GLOB.joined_player_list.len/config.traitor_scaling_coeff) + num_modifier )
+ var/tsc = CONFIG_GET(number/traitor_scaling_coeff)
+ var/traitorcap = min(round(GLOB.joined_player_list.len / (tsc * 2)) + 2 + num_modifier, round(GLOB.joined_player_list.len / tsc) + num_modifier)
if((SSticker.mode.traitors.len + pre_traitors.len) >= traitorcap) //Upper cap for number of latejoin antagonists
return
- if((SSticker.mode.traitors.len + pre_traitors.len) <= (traitorcap - 2) || prob(100 / (config.traitor_scaling_coeff * 2)))
+ if((SSticker.mode.traitors.len + pre_traitors.len) <= (traitorcap - 2) || prob(100 / (tsc * 2)))
if(ROLE_TRAITOR in character.client.prefs.be_special)
if(!jobban_isbanned(character, ROLE_TRAITOR) && !jobban_isbanned(character, "Syndicate"))
if(age_check(character.client))
diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm
index 31060fffc3..5e22aaac42 100644
--- a/code/game/gamemodes/wizard/spellbook.dm
+++ b/code/game/gamemodes/wizard/spellbook.dm
@@ -478,7 +478,7 @@
/datum/spellbook_entry/summon/guns/IsAvailible()
if(!SSticker.mode) // In case spellbook is placed on map
return 0
- return (!config.no_summon_guns)
+ return !CONFIG_GET(flag/no_summon_guns)
/datum/spellbook_entry/summon/guns/Buy(mob/living/carbon/human/user,obj/item/spellbook/book)
SSblackbox.add_details("wizard_spell_learned", name)
@@ -495,7 +495,7 @@
/datum/spellbook_entry/summon/magic/IsAvailible()
if(!SSticker.mode) // In case spellbook is placed on map
return 0
- return (!config.no_summon_magic)
+ return !CONFIG_GET(flag/no_summon_magic)
/datum/spellbook_entry/summon/magic/Buy(mob/living/carbon/human/user,obj/item/spellbook/book)
SSblackbox.add_details("wizard_spell_learned", name)
@@ -513,7 +513,7 @@
/datum/spellbook_entry/summon/events/IsAvailible()
if(!SSticker.mode) // In case spellbook is placed on map
return 0
- return (!config.no_summon_events)
+ return !CONFIG_GET(flag/no_summon_events)
/datum/spellbook_entry/summon/events/Buy(mob/living/carbon/human/user,obj/item/spellbook/book)
SSblackbox.add_details("wizard_spell_learned", name)
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 88941c2344..86e69b8973 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -231,9 +231,9 @@
else if(mob_occupant.cloneloss > (100 - heal_level))
mob_occupant.Unconscious(80)
-
+ var/dmg_mult = CONFIG_GET(number/damage_multiplier)
//Slowly get that clone healed and finished.
- mob_occupant.adjustCloneLoss(-((speed_coeff/2) * config.damage_multiplier))
+ mob_occupant.adjustCloneLoss(-((speed_coeff / 2) * dmg_mult))
var/progress = CLONE_INITIAL_DAMAGE - mob_occupant.getCloneLoss()
// To avoid the default cloner making incomplete clones
progress += (100 - MINIMUM_HEAL_LEVEL)
@@ -251,7 +251,7 @@
BP.attach_limb(mob_occupant)
//Premature clones may have brain damage.
- mob_occupant.adjustBrainLoss(-((speed_coeff/2) * config.damage_multiplier))
+ mob_occupant.adjustBrainLoss(-((speed_coeff / 2) * dmg_mult))
check_brine()
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index 0548d94f3d..f64199a248 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -47,7 +47,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
/obj/machinery/computer/card/Initialize()
. = ..()
- change_position_cooldown = config.id_console_jobslot_delay
+ change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
/obj/machinery/computer/card/attackby(obj/O, mob/user, params)//TODO:SANITY
if(istype(O, /obj/item/card/id))
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index ab7a639818..ffd3091605 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -1,502 +1,502 @@
-/obj/machinery/computer/cloning
- name = "cloning console"
- desc = "Used to clone people and manage DNA."
- icon_screen = "dna"
- icon_keyboard = "med_key"
- circuit = /obj/item/circuitboard/computer/cloning
+/obj/machinery/computer/cloning
+ name = "cloning console"
+ desc = "Used to clone people and manage DNA."
+ icon_screen = "dna"
+ icon_keyboard = "med_key"
+ circuit = /obj/item/circuitboard/computer/cloning
req_access = list(ACCESS_HEADS) //ONLY USED FOR RECORD DELETION RIGHT NOW.
- var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
- var/list/pods //Linked cloning pods
- var/temp = "Inactive"
- var/scantemp_ckey
- var/scantemp = "Ready to Scan"
- var/menu = 1 //Which menu screen to display
- var/list/records = list()
- var/datum/data/record/active_record = null
- var/obj/item/disk/data/diskette = null //Mostly so the geneticist can steal everything.
- var/loading = 0 // Nice loading text
- var/autoprocess = 0
-
- light_color = LIGHT_COLOR_BLUE
-
-/obj/machinery/computer/cloning/Initialize()
+ var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
+ var/list/pods //Linked cloning pods
+ var/temp = "Inactive"
+ var/scantemp_ckey
+ var/scantemp = "Ready to Scan"
+ var/menu = 1 //Which menu screen to display
+ var/list/records = list()
+ var/datum/data/record/active_record = null
+ var/obj/item/disk/data/diskette = null //Mostly so the geneticist can steal everything.
+ var/loading = 0 // Nice loading text
+ var/autoprocess = 0
+
+ light_color = LIGHT_COLOR_BLUE
+
+/obj/machinery/computer/cloning/Initialize()
. = ..()
- updatemodules(TRUE)
-
-/obj/machinery/computer/cloning/Destroy()
- if(pods)
- for(var/P in pods)
- DetachCloner(P)
- pods = null
- return ..()
-
-/obj/machinery/computer/cloning/proc/GetAvailablePod(mind = null)
- if(pods)
- for(var/P in pods)
- var/obj/machinery/clonepod/pod = P
- if(pod.occupant && pod.clonemind == mind)
- return null
- if(pod.is_operational() && !(pod.occupant || pod.mess))
- return pod
-
-/obj/machinery/computer/cloning/proc/HasEfficientPod()
- if(pods)
- for(var/P in pods)
- var/obj/machinery/clonepod/pod = P
- if(pod.is_operational() && pod.efficiency > 5)
- return TRUE
-
-/obj/machinery/computer/cloning/proc/GetAvailableEfficientPod(mind = null)
- if(pods)
- for(var/P in pods)
- var/obj/machinery/clonepod/pod = P
- if(pod.occupant && pod.clonemind == mind)
- return pod
- else if(!. && pod.is_operational() && !(pod.occupant || pod.mess) && pod.efficiency > 5)
- . = pod
-
-/obj/machinery/computer/cloning/process()
- if(!(scanner && LAZYLEN(pods) && autoprocess))
- return
-
- if(scanner.occupant && scanner.scan_level > 2)
- scan_occupant(scanner.occupant)
-
- for(var/datum/data/record/R in records)
- var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"])
-
- if(!pod)
- return
-
- if(pod.occupant)
- continue //how though?
-
- if(pod.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"]))
- records -= R
-
-/obj/machinery/computer/cloning/proc/updatemodules(findfirstcloner)
- src.scanner = findscanner()
- if(findfirstcloner && !LAZYLEN(pods))
- findcloner()
-
-/obj/machinery/computer/cloning/proc/findscanner()
- var/obj/machinery/dna_scannernew/scannerf = null
-
- // Loop through every direction
- for(dir in list(NORTH,EAST,SOUTH,WEST))
-
- // Try to find a scanner in that direction
- scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir))
-
- // If found and operational, return the scanner
- if (!isnull(scannerf) && scannerf.is_operational())
- return scannerf
-
- // If no scanner was found, it will return null
- return null
-
-/obj/machinery/computer/cloning/proc/findcloner()
- var/obj/machinery/clonepod/podf = null
-
- for(dir in list(NORTH,EAST,SOUTH,WEST))
-
- podf = locate(/obj/machinery/clonepod, get_step(src, dir))
-
- if (!isnull(podf) && podf.is_operational())
- AttachCloner(podf)
-
-/obj/machinery/computer/cloning/proc/AttachCloner(obj/machinery/clonepod/pod)
- if(!pod.connected)
- pod.connected = src
- LAZYADD(pods, pod)
-
-/obj/machinery/computer/cloning/proc/DetachCloner(obj/machinery/clonepod/pod)
- pod.connected = null
- LAZYREMOVE(pods, pod)
-
-/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/disk/data)) //INSERT SOME DISKETTES
- if (!src.diskette)
- if(!user.drop_item())
- return
- W.loc = src
- src.diskette = W
- to_chat(user, "You insert [W].")
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
- src.updateUsrDialog()
+ updatemodules(TRUE)
+
+/obj/machinery/computer/cloning/Destroy()
+ if(pods)
+ for(var/P in pods)
+ DetachCloner(P)
+ pods = null
+ return ..()
+
+/obj/machinery/computer/cloning/proc/GetAvailablePod(mind = null)
+ if(pods)
+ for(var/P in pods)
+ var/obj/machinery/clonepod/pod = P
+ if(pod.occupant && pod.clonemind == mind)
+ return null
+ if(pod.is_operational() && !(pod.occupant || pod.mess))
+ return pod
+
+/obj/machinery/computer/cloning/proc/HasEfficientPod()
+ if(pods)
+ for(var/P in pods)
+ var/obj/machinery/clonepod/pod = P
+ if(pod.is_operational() && pod.efficiency > 5)
+ return TRUE
+
+/obj/machinery/computer/cloning/proc/GetAvailableEfficientPod(mind = null)
+ if(pods)
+ for(var/P in pods)
+ var/obj/machinery/clonepod/pod = P
+ if(pod.occupant && pod.clonemind == mind)
+ return pod
+ else if(!. && pod.is_operational() && !(pod.occupant || pod.mess) && pod.efficiency > 5)
+ . = pod
+
+/obj/machinery/computer/cloning/process()
+ if(!(scanner && LAZYLEN(pods) && autoprocess))
+ return
+
+ if(scanner.occupant && scanner.scan_level > 2)
+ scan_occupant(scanner.occupant)
+
+ for(var/datum/data/record/R in records)
+ var/obj/machinery/clonepod/pod = GetAvailableEfficientPod(R.fields["mind"])
+
+ if(!pod)
+ return
+
+ if(pod.occupant)
+ continue //how though?
+
+ if(pod.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"]))
+ records -= R
+
+/obj/machinery/computer/cloning/proc/updatemodules(findfirstcloner)
+ src.scanner = findscanner()
+ if(findfirstcloner && !LAZYLEN(pods))
+ findcloner()
+
+/obj/machinery/computer/cloning/proc/findscanner()
+ var/obj/machinery/dna_scannernew/scannerf = null
+
+ // Loop through every direction
+ for(dir in list(NORTH,EAST,SOUTH,WEST))
+
+ // Try to find a scanner in that direction
+ scannerf = locate(/obj/machinery/dna_scannernew, get_step(src, dir))
+
+ // If found and operational, return the scanner
+ if (!isnull(scannerf) && scannerf.is_operational())
+ return scannerf
+
+ // If no scanner was found, it will return null
+ return null
+
+/obj/machinery/computer/cloning/proc/findcloner()
+ var/obj/machinery/clonepod/podf = null
+
+ for(dir in list(NORTH,EAST,SOUTH,WEST))
+
+ podf = locate(/obj/machinery/clonepod, get_step(src, dir))
+
+ if (!isnull(podf) && podf.is_operational())
+ AttachCloner(podf)
+
+/obj/machinery/computer/cloning/proc/AttachCloner(obj/machinery/clonepod/pod)
+ if(!pod.connected)
+ pod.connected = src
+ LAZYADD(pods, pod)
+
+/obj/machinery/computer/cloning/proc/DetachCloner(obj/machinery/clonepod/pod)
+ pod.connected = null
+ LAZYREMOVE(pods, pod)
+
+/obj/machinery/computer/cloning/attackby(obj/item/W, mob/user, params)
+ if(istype(W, /obj/item/disk/data)) //INSERT SOME DISKETTES
+ if (!src.diskette)
+ if(!user.drop_item())
+ return
+ W.loc = src
+ src.diskette = W
+ to_chat(user, "You insert [W].")
+ playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
+ src.updateUsrDialog()
else if(istype(W, /obj/item/device/multitool))
- var/obj/item/device/multitool/P = W
-
- if(istype(P.buffer, /obj/machinery/clonepod))
- if(get_area(P.buffer) != get_area(src))
- to_chat(user, "-% Cannot link machines across power zones. Buffer cleared %-")
- P.buffer = null
- return
- to_chat(user, "-% Successfully linked [P.buffer] with [src] %-")
- var/obj/machinery/clonepod/pod = P.buffer
- if(pod.connected)
- pod.connected.DetachCloner(pod)
- AttachCloner(pod)
- else
- P.buffer = src
- to_chat(user, "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-")
- return
- else
- return ..()
-
-/obj/machinery/computer/cloning/attack_hand(mob/user)
- if(..())
- return
- interact(user)
-
-/obj/machinery/computer/cloning/interact(mob/user)
- user.set_machine(src)
- add_fingerprint(user)
-
- if(..())
- return
-
- updatemodules(TRUE)
-
- var/dat = ""
- dat += "Refresh"
-
- if(scanner && HasEfficientPod() && scanner.scan_level > 2)
- if(!autoprocess)
- dat += "Autoprocess"
- else
- dat += "Stop autoprocess"
- else
- dat += "Autoprocess"
- dat += "Cloning Pod Status
"
- dat += "[temp]
"
-
- switch(src.menu)
- if(1)
- // Modules
- if (isnull(src.scanner) || !LAZYLEN(pods))
- dat += "Modules
"
- //dat += "Reload Modules"
- if (isnull(src.scanner))
- dat += "ERROR: No Scanner detected!
"
- if (!LAZYLEN(pods))
- dat += "ERROR: No Pod detected
"
-
- // Scanner
- if (!isnull(src.scanner))
- var/mob/living/scanner_occupant = get_mob_or_brainmob(scanner.occupant)
-
- dat += "Scanner Functions
"
-
- dat += ""
- if(!scanner_occupant)
- dat += "Scanner Unoccupied"
- else if(loading)
- dat += "[scanner_occupant] => Scanning..."
- else
- if(scanner_occupant.ckey != scantemp_ckey)
- scantemp = "Ready to Scan"
- scantemp_ckey = scanner_occupant.ckey
- dat += "[scanner_occupant] => [scantemp]"
- dat += "
"
-
- if(scanner_occupant)
- dat += "Start Scan"
- dat += "
[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]"
- else
- dat += "Start Scan"
-
- // Database
- dat += "Database Functions
"
- if (src.records.len && src.records.len > 0)
- dat += "View Records ([src.records.len])
"
- else
- dat += "View Records (0)
"
- if (src.diskette)
- dat += "Eject Disk
"
-
-
-
- if(2)
- dat += "Current records
"
- dat += "<< Back
"
- for(var/datum/data/record/R in records)
- dat += "[R.fields["name"]]
Scan ID [R.fields["id"]] View Record"
- if(3)
- dat += "Selected Record
"
- dat += "<< Back
"
-
- if (!src.active_record)
- dat += "Record not found."
- else
- dat += "[src.active_record.fields["name"]]
"
- dat += "Scan ID [src.active_record.fields["id"]] Clone
"
-
- var/obj/item/implant/health/H = locate(src.active_record.fields["imp"])
-
- if ((H) && (istype(H)))
- dat += "Health Implant Data:
[H.sensehealth()]
"
- else
- dat += "Unable to locate Health Implant.
"
-
- dat += "Unique Identifier:
[src.active_record.fields["UI"]]
"
- dat += "Structural Enzymes:
[src.active_record.fields["SE"]]
"
-
- if(diskette && diskette.fields)
- dat += ""
- dat += "
Inserted Disk
"
- dat += "
Contents: "
- var/list/L = list()
- if(diskette.fields["UI"])
- L += "Unique Identifier"
- if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"])
- L += "Unique Enzymes"
- if(diskette.fields["SE"])
- L += "Structural Enzymes"
- dat += english_list(L, "Empty", " + ", " + ")
- dat += "
Load from Disk"
-
- dat += "
Save to Disk"
- dat += "
"
-
- dat += "Delete Record"
-
- if(4)
- if (!src.active_record)
- src.menu = 2
- dat = "[src.temp]
"
- dat += "Confirm Record Deletion
"
-
- dat += "Scan card to confirm.
"
- dat += "Cancel"
-
-
- var/datum/browser/popup = new(user, "cloning", "Cloning System Control")
- popup.set_content(dat)
- popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
-
-/obj/machinery/computer/cloning/Topic(href, href_list)
- if(..())
- return
-
- if(loading)
- return
-
- if(href_list["task"])
- switch(href_list["task"])
- if("autoprocess")
- autoprocess = 1
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
- if("stopautoprocess")
- autoprocess = 0
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
-
- else if ((href_list["scan"]) && !isnull(scanner) && scanner.is_operational())
- scantemp = ""
-
- loading = 1
- src.updateUsrDialog()
- playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0)
- say("Initiating scan...")
-
- spawn(20)
- src.scan_occupant(scanner.occupant)
-
- loading = 0
- src.updateUsrDialog()
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
-
-
- //No locking an open scanner.
- else if ((href_list["lock"]) && !isnull(scanner) && scanner.is_operational())
- if ((!scanner.locked) && (scanner.occupant))
+ var/obj/item/device/multitool/P = W
+
+ if(istype(P.buffer, /obj/machinery/clonepod))
+ if(get_area(P.buffer) != get_area(src))
+ to_chat(user, "-% Cannot link machines across power zones. Buffer cleared %-")
+ P.buffer = null
+ return
+ to_chat(user, "-% Successfully linked [P.buffer] with [src] %-")
+ var/obj/machinery/clonepod/pod = P.buffer
+ if(pod.connected)
+ pod.connected.DetachCloner(pod)
+ AttachCloner(pod)
+ else
+ P.buffer = src
+ to_chat(user, "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-")
+ return
+ else
+ return ..()
+
+/obj/machinery/computer/cloning/attack_hand(mob/user)
+ if(..())
+ return
+ interact(user)
+
+/obj/machinery/computer/cloning/interact(mob/user)
+ user.set_machine(src)
+ add_fingerprint(user)
+
+ if(..())
+ return
+
+ updatemodules(TRUE)
+
+ var/dat = ""
+ dat += "Refresh"
+
+ if(scanner && HasEfficientPod() && scanner.scan_level > 2)
+ if(!autoprocess)
+ dat += "Autoprocess"
+ else
+ dat += "Stop autoprocess"
+ else
+ dat += "Autoprocess"
+ dat += "Cloning Pod Status
"
+ dat += "[temp]
"
+
+ switch(src.menu)
+ if(1)
+ // Modules
+ if (isnull(src.scanner) || !LAZYLEN(pods))
+ dat += "Modules
"
+ //dat += "Reload Modules"
+ if (isnull(src.scanner))
+ dat += "ERROR: No Scanner detected!
"
+ if (!LAZYLEN(pods))
+ dat += "ERROR: No Pod detected
"
+
+ // Scanner
+ if (!isnull(src.scanner))
+ var/mob/living/scanner_occupant = get_mob_or_brainmob(scanner.occupant)
+
+ dat += "Scanner Functions
"
+
+ dat += ""
+ if(!scanner_occupant)
+ dat += "Scanner Unoccupied"
+ else if(loading)
+ dat += "[scanner_occupant] => Scanning..."
+ else
+ if(scanner_occupant.ckey != scantemp_ckey)
+ scantemp = "Ready to Scan"
+ scantemp_ckey = scanner_occupant.ckey
+ dat += "[scanner_occupant] => [scantemp]"
+ dat += "
"
+
+ if(scanner_occupant)
+ dat += "Start Scan"
+ dat += "
[src.scanner.locked ? "Unlock Scanner" : "Lock Scanner"]"
+ else
+ dat += "Start Scan"
+
+ // Database
+ dat += "Database Functions
"
+ if (src.records.len && src.records.len > 0)
+ dat += "View Records ([src.records.len])
"
+ else
+ dat += "View Records (0)
"
+ if (src.diskette)
+ dat += "Eject Disk
"
+
+
+
+ if(2)
+ dat += "Current records
"
+ dat += "<< Back
"
+ for(var/datum/data/record/R in records)
+ dat += "[R.fields["name"]]
Scan ID [R.fields["id"]] View Record"
+ if(3)
+ dat += "Selected Record
"
+ dat += "<< Back
"
+
+ if (!src.active_record)
+ dat += "Record not found."
+ else
+ dat += "[src.active_record.fields["name"]]
"
+ dat += "Scan ID [src.active_record.fields["id"]] Clone
"
+
+ var/obj/item/implant/health/H = locate(src.active_record.fields["imp"])
+
+ if ((H) && (istype(H)))
+ dat += "Health Implant Data:
[H.sensehealth()]
"
+ else
+ dat += "Unable to locate Health Implant.
"
+
+ dat += "Unique Identifier:
[src.active_record.fields["UI"]]
"
+ dat += "Structural Enzymes:
[src.active_record.fields["SE"]]
"
+
+ if(diskette && diskette.fields)
+ dat += ""
+ dat += "
Inserted Disk
"
+ dat += "
Contents: "
+ var/list/L = list()
+ if(diskette.fields["UI"])
+ L += "Unique Identifier"
+ if(diskette.fields["UE"] && diskette.fields["name"] && diskette.fields["blood_type"])
+ L += "Unique Enzymes"
+ if(diskette.fields["SE"])
+ L += "Structural Enzymes"
+ dat += english_list(L, "Empty", " + ", " + ")
+ dat += "
Load from Disk"
+
+ dat += "
Save to Disk"
+ dat += "
"
+
+ dat += "Delete Record"
+
+ if(4)
+ if (!src.active_record)
+ src.menu = 2
+ dat = "[src.temp]
"
+ dat += "Confirm Record Deletion
"
+
+ dat += "Scan card to confirm.
"
+ dat += "Cancel"
+
+
+ var/datum/browser/popup = new(user, "cloning", "Cloning System Control")
+ popup.set_content(dat)
+ popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
+ popup.open()
+
+/obj/machinery/computer/cloning/Topic(href, href_list)
+ if(..())
+ return
+
+ if(loading)
+ return
+
+ if(href_list["task"])
+ switch(href_list["task"])
+ if("autoprocess")
+ autoprocess = 1
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ if("stopautoprocess")
+ autoprocess = 0
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+
+ else if ((href_list["scan"]) && !isnull(scanner) && scanner.is_operational())
+ scantemp = ""
+
+ loading = 1
+ src.updateUsrDialog()
+ playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0)
+ say("Initiating scan...")
+
+ spawn(20)
+ src.scan_occupant(scanner.occupant)
+
+ loading = 0
+ src.updateUsrDialog()
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
+
+ //No locking an open scanner.
+ else if ((href_list["lock"]) && !isnull(scanner) && scanner.is_operational())
+ if ((!scanner.locked) && (scanner.occupant))
scanner.locked = TRUE
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- else
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ else
scanner.locked = FALSE
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
-
- else if(href_list["view_rec"])
- playsound(src, "terminal_type", 25, 0)
- src.active_record = find_record("id", href_list["view_rec"], records)
- if(active_record)
- if(!active_record.fields["ckey"])
- records -= active_record
- active_record = null
- src.temp = "Record Corrupt"
- else
- src.menu = 3
- else
- src.temp = "Record missing."
-
- else if (href_list["del_rec"])
- if ((!src.active_record) || (src.menu < 3))
- return
- if (src.menu == 3) //If we are viewing a record, confirm deletion
- src.temp = "Delete record?"
- src.menu = 4
- playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0)
-
- else if (src.menu == 4)
- var/obj/item/card/id/C = usr.get_active_held_item()
- if (istype(C)||istype(C, /obj/item/device/pda))
- if(src.check_access(C))
- src.temp = "[src.active_record.fields["name"]] => Record deleted."
- src.records.Remove(active_record)
- active_record = null
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
- src.menu = 2
- else
- src.temp = "Access Denied."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
-
- else if (href_list["disk"]) //Load or eject.
- switch(href_list["disk"])
- if("load")
- if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields)
- src.temp = "Load error."
- src.updateUsrDialog()
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
- if (!src.active_record)
- src.temp = "Record error."
- src.menu = 1
- src.updateUsrDialog()
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
-
- for(var/key in diskette.fields)
- src.active_record.fields[key] = diskette.fields[key]
- src.temp = "Load successful."
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
-
- if("eject")
- if(src.diskette)
- src.diskette.loc = src.loc
- src.diskette = null
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
- if("save")
- if(!diskette || diskette.read_only || !active_record || !active_record.fields)
- src.temp = "Save error."
- src.updateUsrDialog()
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
-
- diskette.fields = active_record.fields.Copy()
- diskette.name = "data disk - '[src.diskette.fields["name"]]'"
- src.temp = "Save successful."
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
-
- else if (href_list["refresh"])
- src.updateUsrDialog()
- playsound(src, "terminal_type", 25, 0)
-
- else if (href_list["clone"])
- var/datum/data/record/C = find_record("id", href_list["clone"], records)
- //Look for that player! They better be dead!
- if(C)
- var/obj/machinery/clonepod/pod = GetAvailablePod()
- //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
- if(!LAZYLEN(pods))
- temp = "No Clonepods detected."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- else if(!pod)
- temp = "No Clonepods available."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- else if(!config.revival_cloning)
- temp = "Unable to initiate cloning cycle."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- else if(pod.occupant)
- temp = "Cloning cycle already in progress."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- else if(pod.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"]))
- temp = "[C.fields["name"]] => Cloning cycle in progress..."
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
- records.Remove(C)
- if(active_record == C)
- active_record = null
- menu = 1
- else
- temp = "[C.fields["name"]] => Initialisation failure."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
-
- else
- temp = "Data corruption."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
-
- else if (href_list["menu"])
- src.menu = text2num(href_list["menu"])
- playsound(src, "terminal_type", 25, 0)
-
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- return
-
-/obj/machinery/computer/cloning/proc/scan_occupant(occupant)
- var/mob/living/mob_occupant = get_mob_or_brainmob(occupant)
- var/datum/dna/dna
- if(iscarbon(mob_occupant))
- var/mob/living/carbon/C = mob_occupant
- dna = C.has_dna()
- if(isbrain(mob_occupant))
- var/mob/living/brain/B = mob_occupant
- dna = B.stored_dna
-
- if(!istype(dna))
- scantemp = "Unable to locate valid genetic data."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
- if(mob_occupant.suiciding || mob_occupant.hellbound)
- scantemp = "Subject's brain is not responding to scanning stimuli."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
- if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2))
- scantemp = "Subject no longer contains the fundamental materials required to create a living clone."
- playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
- return
- if ((!mob_occupant.ckey) || (!mob_occupant.client))
- scantemp = "Mental interface failure."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
- if (find_record("ckey", mob_occupant.ckey, records))
- scantemp = "Subject already in database."
- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
- return
-
- var/datum/data/record/R = new()
- if(dna.species)
- // We store the instance rather than the path, because some
- // species (abductors, slimepeople) store state in their
- // species datums
- R.fields["mrace"] = dna.species
- else
- var/datum/species/rando_race = pick(config.roundstart_races)
- R.fields["mrace"] = rando_race.type
-
- R.fields["ckey"] = mob_occupant.ckey
- R.fields["name"] = mob_occupant.real_name
- R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6)
- R.fields["UE"] = dna.unique_enzymes
- R.fields["UI"] = dna.uni_identity
- R.fields["SE"] = dna.struc_enzymes
- R.fields["blood_type"] = dna.blood_type
- R.fields["features"] = dna.features
- R.fields["factions"] = mob_occupant.faction
-
- if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning.
- R.fields["mind"] = "\ref[mob_occupant.mind]"
-
- //Add an implant if needed
- var/obj/item/implant/health/imp
- for(var/obj/item/implant/health/HI in mob_occupant.implants)
- imp = HI
- break
- if(!imp)
- imp = new /obj/item/implant/health(mob_occupant)
- imp.implant(mob_occupant)
- R.fields["imp"] = "\ref[imp]"
-
- src.records += R
- scantemp = "Subject successfully scanned."
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
+ else if(href_list["view_rec"])
+ playsound(src, "terminal_type", 25, 0)
+ src.active_record = find_record("id", href_list["view_rec"], records)
+ if(active_record)
+ if(!active_record.fields["ckey"])
+ records -= active_record
+ active_record = null
+ src.temp = "Record Corrupt"
+ else
+ src.menu = 3
+ else
+ src.temp = "Record missing."
+
+ else if (href_list["del_rec"])
+ if ((!src.active_record) || (src.menu < 3))
+ return
+ if (src.menu == 3) //If we are viewing a record, confirm deletion
+ src.temp = "Delete record?"
+ src.menu = 4
+ playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0)
+
+ else if (src.menu == 4)
+ var/obj/item/card/id/C = usr.get_active_held_item()
+ if (istype(C)||istype(C, /obj/item/device/pda))
+ if(src.check_access(C))
+ src.temp = "[src.active_record.fields["name"]] => Record deleted."
+ src.records.Remove(active_record)
+ active_record = null
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ src.menu = 2
+ else
+ src.temp = "Access Denied."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+
+ else if (href_list["disk"]) //Load or eject.
+ switch(href_list["disk"])
+ if("load")
+ if (!diskette || !istype(diskette.fields) || !diskette.fields["name"] || !diskette.fields)
+ src.temp = "Load error."
+ src.updateUsrDialog()
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+ if (!src.active_record)
+ src.temp = "Record error."
+ src.menu = 1
+ src.updateUsrDialog()
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+
+ for(var/key in diskette.fields)
+ src.active_record.fields[key] = diskette.fields[key]
+ src.temp = "Load successful."
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
+ if("eject")
+ if(src.diskette)
+ src.diskette.loc = src.loc
+ src.diskette = null
+ playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0)
+ if("save")
+ if(!diskette || diskette.read_only || !active_record || !active_record.fields)
+ src.temp = "Save error."
+ src.updateUsrDialog()
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+
+ diskette.fields = active_record.fields.Copy()
+ diskette.name = "data disk - '[src.diskette.fields["name"]]'"
+ src.temp = "Save successful."
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+
+ else if (href_list["refresh"])
+ src.updateUsrDialog()
+ playsound(src, "terminal_type", 25, 0)
+
+ else if (href_list["clone"])
+ var/datum/data/record/C = find_record("id", href_list["clone"], records)
+ //Look for that player! They better be dead!
+ if(C)
+ var/obj/machinery/clonepod/pod = GetAvailablePod()
+ //Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
+ if(!LAZYLEN(pods))
+ temp = "No Clonepods detected."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ else if(!pod)
+ temp = "No Clonepods available."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ else if(!CONFIG_GET(flag/revival_cloning))
+ temp = "Unable to initiate cloning cycle."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ else if(pod.occupant)
+ temp = "Cloning cycle already in progress."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ else if(pod.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"]))
+ temp = "[C.fields["name"]] => Cloning cycle in progress..."
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
+ records.Remove(C)
+ if(active_record == C)
+ active_record = null
+ menu = 1
+ else
+ temp = "[C.fields["name"]] => Initialisation failure."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+
+ else
+ temp = "Data corruption."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+
+ else if (href_list["menu"])
+ src.menu = text2num(href_list["menu"])
+ playsound(src, "terminal_type", 25, 0)
+
+ src.add_fingerprint(usr)
+ src.updateUsrDialog()
+ return
+
+/obj/machinery/computer/cloning/proc/scan_occupant(occupant)
+ var/mob/living/mob_occupant = get_mob_or_brainmob(occupant)
+ var/datum/dna/dna
+ if(iscarbon(mob_occupant))
+ var/mob/living/carbon/C = mob_occupant
+ dna = C.has_dna()
+ if(isbrain(mob_occupant))
+ var/mob/living/brain/B = mob_occupant
+ dna = B.stored_dna
+
+ if(!istype(dna))
+ scantemp = "Unable to locate valid genetic data."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+ if(mob_occupant.suiciding || mob_occupant.hellbound)
+ scantemp = "Subject's brain is not responding to scanning stimuli."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+ if((mob_occupant.disabilities & NOCLONE) && (src.scanner.scan_level < 2))
+ scantemp = "Subject no longer contains the fundamental materials required to create a living clone."
+ playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
+ return
+ if ((!mob_occupant.ckey) || (!mob_occupant.client))
+ scantemp = "Mental interface failure."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+ if (find_record("ckey", mob_occupant.ckey, records))
+ scantemp = "Subject already in database."
+ playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
+ return
+
+ var/datum/data/record/R = new()
+ if(dna.species)
+ // We store the instance rather than the path, because some
+ // species (abductors, slimepeople) store state in their
+ // species datums
+ R.fields["mrace"] = dna.species
+ else
+ var/datum/species/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races))
+ R.fields["mrace"] = rando_race.type
+
+ R.fields["ckey"] = mob_occupant.ckey
+ R.fields["name"] = mob_occupant.real_name
+ R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6)
+ R.fields["UE"] = dna.unique_enzymes
+ R.fields["UI"] = dna.uni_identity
+ R.fields["SE"] = dna.struc_enzymes
+ R.fields["blood_type"] = dna.blood_type
+ R.fields["features"] = dna.features
+ R.fields["factions"] = mob_occupant.faction
+
+ if (!isnull(mob_occupant.mind)) //Save that mind so traitors can continue traitoring after cloning.
+ R.fields["mind"] = "\ref[mob_occupant.mind]"
+
+ //Add an implant if needed
+ var/obj/item/implant/health/imp
+ for(var/obj/item/implant/health/HI in mob_occupant.implants)
+ imp = HI
+ break
+ if(!imp)
+ imp = new /obj/item/implant/health(mob_occupant)
+ imp.implant(mob_occupant)
+ R.fields["imp"] = "\ref[imp]"
+
+ src.records += R
+ scantemp = "Subject successfully scanned."
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index bd203772cb..89b2bc4620 100755
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -454,7 +454,7 @@
if (src.authenticated==2)
dat += "
Captain Functions"
dat += "
\[ Make a Captain's Announcement \]"
- if(config.cross_allowed)
+ if(CONFIG_GET(string/cross_server_address))
dat += "
\[ Send a message to an allied station \]"
if(SSmapping.config.allow_custom_shuttles == "yes")
dat += "
\[ Purchase Shuttle \]"
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index f2ea3238ef..6ec144d257 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -124,7 +124,7 @@
dat += "| ID: | [active1.fields["id"]] |
"
dat += "| Sex: | [active1.fields["sex"]] |
"
dat += "| Age: | [active1.fields["age"]] |
"
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
dat += "| Species: | [active1.fields["species"]] |
"
dat += "| Fingerprint: | [active1.fields["fingerprint"]] |
"
dat += "| Physical Status: | [active1.fields["p_stat"]] |
"
@@ -543,7 +543,7 @@
P.info = "Medical Record - (MR-[GLOB.data_core.medicalPrintCount])
"
if(active1 in GLOB.data_core.general)
P.info += text("Name: [] ID: []
\nSex: []
\nAge: []
", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"])
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
P.info += "\nSpecies: [active1.fields["species"]]
"
P.info += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
else
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 00787f10e2..1a74c44c30 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -186,7 +186,7 @@
| ID: | [active1.fields["id"]] |
| Sex: | [active1.fields["sex"]] |
| Age: | [active1.fields["age"]] |
"}
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
dat += "| Species: | [active1.fields["species"]] |
"
dat += {"| Rank: | [active1.fields["rank"]] |
| Fingerprint: | [active1.fields["fingerprint"]] |
@@ -373,7 +373,7 @@ What a mess.*/
P.info = "Security Record - (SR-[GLOB.data_core.securityPrintCount])
"
if((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)))
P.info += text("Name: [] ID: []
\nSex: []
\nAge: []
", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"])
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
P.info += "\nSpecies: [active1.fields["species"]]
"
P.info += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"])
else
@@ -519,7 +519,7 @@ What a mess.*/
G.fields["rank"] = "Unassigned"
G.fields["sex"] = "Male"
G.fields["age"] = "Unknown"
- if(config.mutant_races)
+ if(CONFIG_GET(flag/join_with_mutant_race))
G.fields["species"] = "Human"
G.fields["photo_front"] = new /icon()
G.fields["photo_side"] = new /icon()
@@ -604,7 +604,7 @@ What a mess.*/
active1.fields["age"] = t1
if("species")
if(istype(active1, /datum/data/record))
- var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_species
+ var/t1 = input("Select a species", "Species Selection") as null|anything in CONFIG_GET(keyed_flag_list/roundstart_races)
if(!canUseSecurityRecordsConsole(usr, t1, a1))
return
active1.fields["species"] = t1
@@ -772,7 +772,7 @@ What a mess.*/
if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
if(7)
- R.fields["species"] = pick(GLOB.roundstart_species)
+ R.fields["species"] = pick(CONFIG_GET(keyed_flag_list/roundstart_races))
if(8)
var/datum/data/record/G = pick(GLOB.data_core.general)
R.fields["photo_front"] = G.fields["photo_front"]
diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm
index fd7a87ac8c..45788b77b9 100644
--- a/code/game/objects/items/AI_modules.dm
+++ b/code/game/objects/items/AI_modules.dm
@@ -54,7 +54,7 @@ AI MODULES
for(var/mylaw in lawlist)
if(mylaw != "")
tot_laws++
- if(tot_laws > config.silicon_max_law_amount && !bypass_law_amt_check)//allows certain boards to avoid this check, eg: reset
+ if(tot_laws > CONFIG_GET(number/silicon_max_law_amount) && !bypass_law_amt_check)//allows certain boards to avoid this check, eg: reset
to_chat(user, "Not enough memory allocated to [law_datum.owner ? law_datum.owner : "the AI core"]'s law processor to handle this amount of laws.")
message_admins("[key_name_admin(user)] tried to upload laws to [law_datum.owner ? key_name_admin(law_datum.owner) : "an AI core"] that would exceed the law cap.")
overflow = TRUE
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index ca5fa2c28b..23905200e9 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -72,16 +72,15 @@
user.visible_message("[user] is jamming [src] up [user.p_their()] nose and into [user.p_their()] brain. It looks like [user.p_theyre()] trying to commit suicide!")
return (BRUTELOSS|OXYLOSS)
-/obj/item/toy/crayon/New()
- ..()
+/obj/item/toy/crayon/Initialize()
+ . = ..()
// Makes crayons identifiable in things like grinders
if(name == "crayon")
name = "[item_color] crayon"
- if(config)
- if(config.mutant_races == 1)
- graffiti |= "antilizard"
- graffiti |= "prolizard"
+ if(CONFIG_GET(flag/join_with_mutant_race))
+ graffiti |= "antilizard"
+ graffiti |= "prolizard"
all_drawables = graffiti + letters + numerals + oriented + runes + graffiti_large_h
drawtype = pick(all_drawables)
diff --git a/code/game/objects/items/manuals.dm b/code/game/objects/items/manuals.dm
index 7ee1f49a48..c0298d8122 100644
--- a/code/game/objects/items/manuals.dm
+++ b/code/game/objects/items/manuals.dm
@@ -882,7 +882,8 @@
..()
/obj/item/book/manual/wiki/proc/initialize_wikibook()
- if(config.wikiurl)
+ var/wikiurl = CONFIG_GET(string/wikiurl)
+ if(wikiurl)
dat = {"
@@ -900,7 +901,7 @@
}
You start skimming through the manual...
-
+
diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm
index 0a7b9eb312..709d86d4d7 100644
--- a/code/game/objects/structures/ai_core.dm
+++ b/code/game/objects/structures/ai_core.dm
@@ -134,7 +134,7 @@
to_chat(user, "Sticking an inactive [M.name] into the frame would sort of defeat the purpose.")
return
- if((config) && (!config.allow_ai) || jobban_isbanned(M.brainmob, "AI"))
+ if(!CONFIG_GET(flag/allow_ai) || jobban_isbanned(M.brainmob, "AI"))
to_chat(user, "This [M.name] does not seem to fit!")
return
diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm
index 39a075b045..aed1679322 100644
--- a/code/game/objects/structures/beds_chairs/chair.dm
+++ b/code/game/objects/structures/beds_chairs/chair.dm
@@ -98,7 +98,7 @@
set category = "Object"
set src in oview(1)
- if(config.ghost_interaction)
+ if(CONFIG_GET(flag/ghost_interaction))
spin()
else
if(!usr || !isturf(usr.loc))
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index a920a53c7f..1bf7daf2e2 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -23,7 +23,7 @@
return
move_delay = 1
if(step(src, direction))
- spawn(config.walk_speed*move_speed_multiplier)
+ spawn(CONFIG_GET(number/walk_delay) * move_speed_multiplier)
move_delay = 0
else
move_delay = 0
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index a32db59bc5..296e4ba757 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -1,225 +1,226 @@
-//wip wip wup
-/obj/structure/mirror
- name = "mirror"
- desc = "Mirror mirror on the wall, who's the most robust of them all?"
- icon = 'icons/obj/watercloset.dmi'
- icon_state = "mirror"
- density = FALSE
- anchored = TRUE
- max_integrity = 200
- integrity_failure = 100
-
-
-/obj/structure/mirror/attack_hand(mob/user)
- if(broken || !Adjacent(user))
- return
-
- if(ishuman(user))
- var/mob/living/carbon/human/H = user
-
- var/userloc = H.loc
-
- //see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments!
- //this is largely copypasted from there.
-
- //handle facial hair (if necessary)
- if(H.gender == MALE)
- var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
- if(userloc != H.loc)
- return //no tele-grooming
- if(new_style)
- H.facial_hair_style = new_style
- else
- H.facial_hair_style = "Shaved"
-
- //handle normal hair
- var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
- if(userloc != H.loc)
- return //no tele-grooming
- if(new_style)
- H.hair_style = new_style
-
- H.update_hair()
-
-/obj/structure/mirror/examine_status(mob/user)
- if(broken)
- return // no message spam
- ..()
-
-/obj/structure/mirror/obj_break(damage_flag)
- if(!broken && !(flags_1 & NODECONSTRUCT_1))
- icon_state = "mirror_broke"
- playsound(src, "shatter", 70, 1)
- desc = "Oh no, seven years of bad luck!"
- broken = 1
-
-/obj/structure/mirror/deconstruct(disassembled = TRUE)
- if(!(flags_1 & NODECONSTRUCT_1))
- if(!disassembled)
- new /obj/item/shard( src.loc )
- qdel(src)
-
-/obj/structure/mirror/attackby(obj/item/I, mob/living/user, params)
- if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
- var/obj/item/weldingtool/WT = I
- if(broken)
- user.changeNext_move(CLICK_CD_MELEE)
- if(WT.remove_fuel(0, user))
- to_chat(user, "You begin repairing [src]...")
- playsound(src, 'sound/items/welder.ogg', 100, 1)
- if(do_after(user, 10*I.toolspeed, target = src))
- if(!user || !WT || !WT.isOn())
- return
- to_chat(user, "You repair [src].")
- broken = 0
- icon_state = initial(icon_state)
- desc = initial(desc)
- else
- return ..()
-
-/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
- switch(damage_type)
- if(BRUTE)
- playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
- if(BURN)
- playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
-
-
-/obj/structure/mirror/magic
- name = "magic mirror"
- desc = "Turn and face the strange... face."
- icon_state = "magic_mirror"
- var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombie")
- var/list/choosable_races = list()
-
-/obj/structure/mirror/magic/New()
- if(!choosable_races.len)
- for(var/speciestype in subtypesof(/datum/species))
- var/datum/species/S = new speciestype()
- if(!(S.id in races_blacklist))
- choosable_races += S.id
- ..()
-
-/obj/structure/mirror/magic/lesser/New()
- choosable_races = GLOB.roundstart_species
- ..()
-
-/obj/structure/mirror/magic/badmin/New()
- for(var/speciestype in subtypesof(/datum/species))
- var/datum/species/S = new speciestype()
- choosable_races += S.id
- ..()
-
-/obj/structure/mirror/magic/attack_hand(mob/user)
- if(!ishuman(user))
- return
-
- var/mob/living/carbon/human/H = user
-
- var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes")
-
- if(!Adjacent(user))
- return
-
- switch(choice)
- if("name")
- var/newname = copytext(sanitize(input(H, "Who are we again?", "Name change", H.name) as null|text),1,MAX_NAME_LEN)
-
- if(!newname)
- return
- if(!Adjacent(user))
- return
- H.real_name = newname
- H.name = newname
- if(H.dna)
- H.dna.real_name = newname
- if(H.mind)
- H.mind.name = newname
-
- if("race")
- var/newrace
- var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races
- newrace = GLOB.species_list[racechoice]
-
- if(!newrace)
- return
- if(!Adjacent(user))
- return
- H.set_species(newrace, icon_update=0)
-
- if(H.dna.species.use_skintones)
- var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
-
- if(new_s_tone)
- H.skin_tone = new_s_tone
- H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
-
- if(MUTCOLORS in H.dna.species.species_traits)
- var/new_mutantcolor = input(user, "Choose your skin color:", "Race change") as color|null
- if(new_mutantcolor)
- var/temp_hsv = RGBtoHSV(new_mutantcolor)
-
- if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright
- H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
-
- else
- to_chat(H, "Invalid color. Your color is not bright enough.")
-
- H.update_body()
- H.update_hair()
- H.update_body_parts()
- H.update_mutations_overlay() // no hulk lizard
-
- if("gender")
- if(!(H.gender in list("male", "female"))) //blame the patriarchy
- return
- if(!Adjacent(user))
- return
- if(H.gender == "male")
- if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes")
- H.gender = "female"
- to_chat(H, "Man, you feel like a woman!")
- else
- return
-
- else
- if(alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes")
- H.gender = "male"
- to_chat(H, "Whoa man, you feel like a man!")
- else
- return
- H.dna.update_ui_block(DNA_GENDER_BLOCK)
- H.update_body()
- H.update_mutations_overlay() //(hulk male/female)
-
- if("hair")
- var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color")
- if(!Adjacent(user))
- return
- if(hairchoice == "Style") //So you just want to use a mirror then?
- ..()
- else
- var/new_hair_color = input(H, "Choose your hair color", "Hair Color") as null|color
- if(new_hair_color)
- H.hair_color = sanitize_hexcolor(new_hair_color)
- H.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK)
- if(H.gender == "male")
- var/new_face_color = input(H, "Choose your facial hair color", "Hair Color") as null|color
- if(new_face_color)
- H.facial_hair_color = sanitize_hexcolor(new_face_color)
- H.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
- H.update_hair()
-
- if("eyes")
- var/new_eye_color = input(H, "Choose your eye color", "Eye Color") as null|color
- if(!Adjacent(user))
- return
- if(new_eye_color)
- H.eye_color = sanitize_hexcolor(new_eye_color)
- H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
- H.update_body()
- if(choice)
- curse(user)
-
-/obj/structure/mirror/magic/proc/curse(mob/living/user)
- return
+//wip wip wup
+/obj/structure/mirror
+ name = "mirror"
+ desc = "Mirror mirror on the wall, who's the most robust of them all?"
+ icon = 'icons/obj/watercloset.dmi'
+ icon_state = "mirror"
+ density = FALSE
+ anchored = TRUE
+ max_integrity = 200
+ integrity_failure = 100
+
+
+/obj/structure/mirror/attack_hand(mob/user)
+ if(broken || !Adjacent(user))
+ return
+
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+
+ var/userloc = H.loc
+
+ //see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments!
+ //this is largely copypasted from there.
+
+ //handle facial hair (if necessary)
+ if(H.gender == MALE)
+ var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
+ if(userloc != H.loc)
+ return //no tele-grooming
+ if(new_style)
+ H.facial_hair_style = new_style
+ else
+ H.facial_hair_style = "Shaved"
+
+ //handle normal hair
+ var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
+ if(userloc != H.loc)
+ return //no tele-grooming
+ if(new_style)
+ H.hair_style = new_style
+
+ H.update_hair()
+
+/obj/structure/mirror/examine_status(mob/user)
+ if(broken)
+ return // no message spam
+ ..()
+
+/obj/structure/mirror/obj_break(damage_flag)
+ if(!broken && !(flags_1 & NODECONSTRUCT_1))
+ icon_state = "mirror_broke"
+ playsound(src, "shatter", 70, 1)
+ desc = "Oh no, seven years of bad luck!"
+ broken = 1
+
+/obj/structure/mirror/deconstruct(disassembled = TRUE)
+ if(!(flags_1 & NODECONSTRUCT_1))
+ if(!disassembled)
+ new /obj/item/shard( src.loc )
+ qdel(src)
+
+/obj/structure/mirror/attackby(obj/item/I, mob/living/user, params)
+ if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
+ var/obj/item/weldingtool/WT = I
+ if(broken)
+ user.changeNext_move(CLICK_CD_MELEE)
+ if(WT.remove_fuel(0, user))
+ to_chat(user, "You begin repairing [src]...")
+ playsound(src, 'sound/items/welder.ogg', 100, 1)
+ if(do_after(user, 10*I.toolspeed, target = src))
+ if(!user || !WT || !WT.isOn())
+ return
+ to_chat(user, "You repair [src].")
+ broken = 0
+ icon_state = initial(icon_state)
+ desc = initial(desc)
+ else
+ return ..()
+
+/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
+ switch(damage_type)
+ if(BRUTE)
+ playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
+ if(BURN)
+ playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
+
+
+/obj/structure/mirror/magic
+ name = "magic mirror"
+ desc = "Turn and face the strange... face."
+ icon_state = "magic_mirror"
+ var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombie")
+ var/list/choosable_races = list()
+
+/obj/structure/mirror/magic/New()
+ if(!choosable_races.len)
+ for(var/speciestype in subtypesof(/datum/species))
+ var/datum/species/S = new speciestype()
+ if(!(S.id in races_blacklist))
+ choosable_races += S.id
+ ..()
+
+/obj/structure/mirror/magic/lesser/New()
+ var/list/L = CONFIG_GET(keyed_flag_list/roundstart_races)
+ choosable_races = L.Copy()
+ ..()
+
+/obj/structure/mirror/magic/badmin/New()
+ for(var/speciestype in subtypesof(/datum/species))
+ var/datum/species/S = new speciestype()
+ choosable_races += S.id
+ ..()
+
+/obj/structure/mirror/magic/attack_hand(mob/user)
+ if(!ishuman(user))
+ return
+
+ var/mob/living/carbon/human/H = user
+
+ var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes")
+
+ if(!Adjacent(user))
+ return
+
+ switch(choice)
+ if("name")
+ var/newname = copytext(sanitize(input(H, "Who are we again?", "Name change", H.name) as null|text),1,MAX_NAME_LEN)
+
+ if(!newname)
+ return
+ if(!Adjacent(user))
+ return
+ H.real_name = newname
+ H.name = newname
+ if(H.dna)
+ H.dna.real_name = newname
+ if(H.mind)
+ H.mind.name = newname
+
+ if("race")
+ var/newrace
+ var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races
+ newrace = GLOB.species_list[racechoice]
+
+ if(!newrace)
+ return
+ if(!Adjacent(user))
+ return
+ H.set_species(newrace, icon_update=0)
+
+ if(H.dna.species.use_skintones)
+ var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
+
+ if(new_s_tone)
+ H.skin_tone = new_s_tone
+ H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
+
+ if(MUTCOLORS in H.dna.species.species_traits)
+ var/new_mutantcolor = input(user, "Choose your skin color:", "Race change") as color|null
+ if(new_mutantcolor)
+ var/temp_hsv = RGBtoHSV(new_mutantcolor)
+
+ if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright
+ H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
+
+ else
+ to_chat(H, "Invalid color. Your color is not bright enough.")
+
+ H.update_body()
+ H.update_hair()
+ H.update_body_parts()
+ H.update_mutations_overlay() // no hulk lizard
+
+ if("gender")
+ if(!(H.gender in list("male", "female"))) //blame the patriarchy
+ return
+ if(!Adjacent(user))
+ return
+ if(H.gender == "male")
+ if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes")
+ H.gender = "female"
+ to_chat(H, "Man, you feel like a woman!")
+ else
+ return
+
+ else
+ if(alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes")
+ H.gender = "male"
+ to_chat(H, "Whoa man, you feel like a man!")
+ else
+ return
+ H.dna.update_ui_block(DNA_GENDER_BLOCK)
+ H.update_body()
+ H.update_mutations_overlay() //(hulk male/female)
+
+ if("hair")
+ var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color")
+ if(!Adjacent(user))
+ return
+ if(hairchoice == "Style") //So you just want to use a mirror then?
+ ..()
+ else
+ var/new_hair_color = input(H, "Choose your hair color", "Hair Color") as null|color
+ if(new_hair_color)
+ H.hair_color = sanitize_hexcolor(new_hair_color)
+ H.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK)
+ if(H.gender == "male")
+ var/new_face_color = input(H, "Choose your facial hair color", "Hair Color") as null|color
+ if(new_face_color)
+ H.facial_hair_color = sanitize_hexcolor(new_face_color)
+ H.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
+ H.update_hair()
+
+ if("eyes")
+ var/new_eye_color = input(H, "Choose your eye color", "Eye Color") as null|color
+ if(!Adjacent(user))
+ return
+ if(new_eye_color)
+ H.eye_color = sanitize_hexcolor(new_eye_color)
+ H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
+ H.update_body()
+ if(choice)
+ curse(user)
+
+/obj/structure/mirror/magic/proc/curse(mob/living/user)
+ return
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 6e3717e9a6..a51030be2b 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -67,7 +67,7 @@
return
/turf/open/space/proc/update_starlight()
- if(config.starlight)
+ if(CONFIG_GET(flag/starlight))
for(var/t in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm
if(isspaceturf(t))
//let's NOT update this that much pls
diff --git a/code/game/world.dm b/code/game/world.dm
index 3763a408ac..316ed70961 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -12,7 +12,7 @@ GLOBAL_PROTECT(security_mode)
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
- config = new
+ new /datum/controller/configuration
CheckSchemaVersion()
SetRoundID()
@@ -25,7 +25,7 @@ GLOBAL_PROTECT(security_mode)
load_motd()
load_admins()
LoadVerbs(/datum/verbs/menu)
- if(config.usewhitelist)
+ if(CONFIG_GET(flag/usewhitelist))
load_whitelist()
LoadBans()
@@ -33,7 +33,7 @@ GLOBAL_PROTECT(security_mode)
Master.Initialize(10, FALSE)
- if(config.irc_announce_new_game)
+ if(CONFIG_GET(flag/irc_announce_new_game))
IRCBroadcast("New round starting on [SSmapping.config.map_name]!")
/world/proc/SetupExternalRSC()
@@ -48,7 +48,7 @@ GLOBAL_PROTECT(security_mode)
#endif
/world/proc/CheckSchemaVersion()
- if(config.sql_enabled)
+ if(CONFIG_GET(flag/sql_enabled))
if(SSdbcore.Connect())
log_world("Database connection established.")
var/datum/DBQuery/query_db_version = SSdbcore.NewQuery("SELECT major, minor FROM [format_table_name("schema_revision")] ORDER BY date DESC LIMIT 1")
@@ -68,7 +68,7 @@ GLOBAL_PROTECT(security_mode)
log_world("Your server failed to establish a connection with the database.")
/world/proc/SetRoundID()
- if(config.sql_enabled)
+ if(CONFIG_GET(flag/sql_enabled))
if(SSdbcore.Connect())
var/datum/DBQuery/query_round_start = SSdbcore.NewQuery("INSERT INTO [format_table_name("round")] (start_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]')")
query_round_start.Execute()
@@ -122,12 +122,13 @@ GLOBAL_PROTECT(security_mode)
var/pinging = ("ping" in input)
var/playing = ("players" in input)
- if(!pinging && !playing && config && config.log_world_topic)
+ if(!pinging && !playing && config && CONFIG_GET(flag/log_world_topic))
WRITE_FILE(GLOB.world_game_log, "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]")
if(input[SERVICE_CMD_PARAM_KEY])
return ServiceCommand(input)
- var/key_valid = (global.comms_allowed && input["key"] == global.comms_key)
+ var/comms_key = CONFIG_GET(string/comms_key)
+ var/key_valid = (comms_key && input["key"] == comms_key)
if(pinging)
var/x = 1
@@ -157,10 +158,10 @@ GLOBAL_PROTECT(security_mode)
var/list/s = list()
s["version"] = GLOB.game_version
s["mode"] = GLOB.master_mode
- s["respawn"] = config ? GLOB.abandon_allowed : 0
+ s["respawn"] = config ? !CONFIG_GET(flag/norespawn) : FALSE
s["enter"] = GLOB.enter_allowed
- s["vote"] = config.allow_vote_mode
- s["ai"] = config.allow_ai
+ s["vote"] = CONFIG_GET(flag/allow_vote_mode)
+ s["ai"] = CONFIG_GET(flag/allow_ai)
s["host"] = host ? host : null
s["active_players"] = get_active_player_count()
s["players"] = GLOB.clients.len
@@ -262,17 +263,6 @@ GLOBAL_PROTECT(security_mode)
GLOB.join_motd = file2text("config/motd.txt") + "
" + GLOB.revdata.GetTestMergeInfo()
/world/proc/update_status()
- var/s = ""
-
- if (config && config.server_name)
- s += "[config.server_name] — "
-
- s += "[station_name()]";
- s += " ("
- s += "" //Change this to wherever you want the hub to link to.
- s += "Default" //Replace this with something else. Or ever better, delete it and uncomment the game version.
- s += ""
- s += ")"
var/list/features = list()
@@ -282,13 +272,25 @@ GLOBAL_PROTECT(security_mode)
if (!GLOB.enter_allowed)
features += "closed"
- features += GLOB.abandon_allowed ? "respawn" : "no respawn"
+ var/s = ""
+ var/hostedby
+ if(config)
+ var/server_name = CONFIG_GET(string/servername)
+ if (server_name)
+ s += "[server_name] — "
+ features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn"
+ if(CONFIG_GET(flag/allow_vote_mode))
+ features += "vote"
+ if(CONFIG_GET(flag/allow_ai))
+ features += "AI allowed"
+ hostedby = CONFIG_GET(string/hostedby)
- if (config && config.allow_vote_mode)
- features += "vote"
-
- if (config && config.allow_ai)
- features += "AI allowed"
+ s += "[station_name()]";
+ s += " ("
+ s += "" //Change this to wherever you want the hub to link to.
+ s += "Default" //Replace this with something else. Or ever better, delete it and uncomment the game version.
+ s += ""
+ s += ")"
var/n = 0
for (var/mob/M in GLOB.player_list)
@@ -300,8 +302,8 @@ GLOBAL_PROTECT(security_mode)
else if (n > 0)
features += "~[n] player"
- if (!host && config && config.hostedby)
- features += "hosted by [config.hostedby]"
+ if (!host && hostedby)
+ features += "hosted by [hostedby]"
if (features)
s += ": [jointext(features, ", ")]"
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index 39a465d2b4..10a3774ae1 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -20,7 +20,7 @@
admin = 1
//Whitelist
- if(config.usewhitelist)
+ if(CONFIG_GET(flag/usewhitelist))
if(!check_whitelist(ckey(key)))
if (admin)
log_admin("The admin [key] has been allowed to bypass the whitelist")
@@ -32,19 +32,20 @@
//Guest Checking
if(IsGuestKey(key))
- if (!GLOB.guests_allowed)
+ if (CONFIG_GET(flag/guest_ban))
log_access("Failed Login: [key] - Guests not allowed")
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
- if (config.panic_bunker && SSdbcore && SSdbcore.IsConnected())
+ if (CONFIG_GET(flag/panic_bunker) && SSdbcore.Connect())
log_access("Failed Login: [key] - Guests not allowed during panic bunker")
return list("reason"="guest", "desc"="\nReason: Sorry but the server is currently not accepting connections from never before seen players or guests. If you have played on this server with a byond account before, please log in to the byond account you have played from.")
//Population Cap Checking
- if(config.extreme_popcap && living_player_count() >= config.extreme_popcap && !admin)
+ var/extreme_popcap = CONFIG_GET(number/extreme_popcap)
+ if(extreme_popcap && living_player_count() >= extreme_popcap && !admin)
log_access("Failed Login: [key] - Population cap reached")
- return list("reason"="popcap", "desc"= "\nReason: [config.extreme_popcap_message]")
+ return list("reason"="popcap", "desc"= "\nReason: [CONFIG_GET(string/extreme_popcap_message)]")
- if(config.ban_legacy_system)
+ if(CONFIG_GET(flag/ban_legacy_system))
//Ban Checking
. = CheckBan( ckey(key), computer_id, address )
diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm
index 5ea980a91d..27d5502edf 100644
--- a/code/modules/admin/NewBan.dm
+++ b/code/modules/admin/NewBan.dm
@@ -11,8 +11,9 @@ GLOBAL_PROTECT(Banlist)
. = list()
var/appeal
- if(config && config.banappeals)
- appeal = "\nFor more information on your ban, or to appeal, head to [config.banappeals]"
+ var/bran = CONFIG_GET(string/banappeals)
+ if(bran)
+ appeal = "\nFor more information on your ban, or to appeal, head to [bran]"
GLOB.Banlist.cd = "/base"
if( "[ckey][id]" in GLOB.Banlist.dir )
GLOB.Banlist.cd = "[ckey][id]"
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index b56caa4e9a..881e59204d 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -31,7 +31,7 @@
if(M.client)
body += " played by [M.client] "
body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\]"
- if(config.use_exp_tracking)
+ if(CONFIG_GET(flag/use_exp_tracking))
body += "\[" + M.client.get_exp_living() + "\]"
if(isnewplayer(M))
@@ -555,28 +555,30 @@
set category = "Server"
set desc="People can't be AI"
set name="Toggle AI"
- config.allow_ai = !( config.allow_ai )
- if (!( config.allow_ai ))
+ var/alai = CONFIG_GET(flag/allow_ai)
+ CONFIG_SET(flag/allow_ai, !alai)
+ if (alai)
to_chat(world, "The AI job is no longer chooseable.")
else
to_chat(world, "The AI job is chooseable now.")
log_admin("[key_name(usr)] toggled AI allowed.")
world.update_status()
- SSblackbox.add_details("admin_toggle","Toggle AI|[config.allow_ai]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_toggle","Toggle AI|[!alai]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggleaban()
set category = "Server"
set desc="Respawn basically"
set name="Toggle Respawn"
- GLOB.abandon_allowed = !( GLOB.abandon_allowed )
- if (GLOB.abandon_allowed)
+ var/new_nores = !CONFIG_GET(flag/norespawn)
+ CONFIG_SET(flag/norespawn, new_nores)
+ if (!new_nores)
to_chat(world, "You may now respawn.")
else
to_chat(world, "You may no longer respawn :(")
- message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
- log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].")
+ message_admins("[key_name_admin(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
+ log_admin("[key_name(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
world.update_status()
- SSblackbox.add_details("admin_toggle","Toggle Respawn|[GLOB.abandon_allowed]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_toggle","Toggle Respawn|[!new_nores]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/delay()
set category = "Server"
@@ -683,14 +685,15 @@
set category = "Server"
set desc="Guests can't enter"
set name="Toggle guests"
- GLOB.guests_allowed = !( GLOB.guests_allowed )
- if (!( GLOB.guests_allowed ))
+ var/new_guest_ban = !CONFIG_GET(flag/guest_ban)
+ CONFIG_SET(flag/guest_ban, new_guest_ban)
+ if (new_guest_ban)
to_chat(world, "Guests may no longer enter the game.")
else
to_chat(world, "Guests may now enter the game.")
- log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed?"":"dis"]allowed.")
- message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed?"":"dis"]allowed.")
- SSblackbox.add_details("admin_toggle","Toggle Guests|[GLOB.guests_allowed]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ log_admin("[key_name(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")
+ message_admins("[key_name_admin(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")
+ SSblackbox.add_details("admin_toggle","Toggle Guests|[!new_guest_ban]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/output_ai_laws()
var/ai_number = 0
@@ -828,10 +831,10 @@
/client/proc/adminGreet(logout)
if(SSticker.HasRoundStarted())
var/string
- if(logout && config && config.announce_admin_logout)
+ if(logout && CONFIG_GET(flag/announce_admin_logout))
string = pick(
"Admin logout: [key_name(src)]")
- else if(!logout && config && config.announce_admin_login && (prefs.toggles & ANNOUNCE_LOGIN))
+ else if(!logout && CONFIG_GET(flag/announce_admin_login) && (prefs.toggles & ANNOUNCE_LOGIN))
string = pick(
"Admin login: [key_name(src)]")
if(string)
diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm
index 67d0b4dbf7..be9e423a17 100644
--- a/code/modules/admin/admin_ranks.dm
+++ b/code/modules/admin/admin_ranks.dm
@@ -117,7 +117,7 @@ GLOBAL_PROTECT(admin_ranks)
return
GLOB.admin_ranks.Cut()
- if(config.admin_legacy_system)
+ if(CONFIG_GET(flag/admin_legacy_system))
var/previous_rights = 0
//load text from file and process each line separately
for(var/line in world.file2list("config/admin_ranks.txt"))
@@ -143,7 +143,7 @@ GLOBAL_PROTECT(admin_ranks)
if(!SSdbcore.Connect())
log_world("Failed to connect to database in load_admin_ranks(). Reverting to legacy system.")
WRITE_FILE(GLOB.world_game_log, "Failed to connect to database in load_admin_ranks(). Reverting to legacy system.")
- config.admin_legacy_system = 1
+ CONFIG_SET(flag/admin_legacy_system, TRUE)
load_admin_ranks()
return
@@ -191,7 +191,7 @@ GLOBAL_PROTECT(admin_ranks)
for(var/datum/admin_rank/R in GLOB.admin_ranks)
rank_names[R.name] = R
- if(config.admin_legacy_system)
+ if(CONFIG_GET(flag/admin_legacy_system))
//load text from file
var/list/lines = world.file2list("config/admins.txt")
@@ -219,7 +219,7 @@ GLOBAL_PROTECT(admin_ranks)
if(!SSdbcore.Connect())
log_world("Failed to connect to database in load_admins(). Reverting to legacy system.")
WRITE_FILE(GLOB.world_game_log, "Failed to connect to database in load_admins(). Reverting to legacy system.")
- config.admin_legacy_system = 1
+ CONFIG_SET(flag/admin_legacy_system, TRUE)
load_admins()
return
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 526d05b76b..0f2702f3b6 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -262,7 +262,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
verbs += GLOB.admin_verbs_poll
if(rights & R_SOUNDS)
verbs += GLOB.admin_verbs_sounds
- if(config.invoke_youtubedl)
+ if(CONFIG_GET(string/invoke_youtubedl))
verbs += /client/proc/play_web_sound
if(rights & R_SPAWN)
verbs += GLOB.admin_verbs_spawn
@@ -399,7 +399,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list(
set name = "Unban Panel"
set category = "Admin"
if(holder)
- if(config.ban_legacy_system)
+ if(CONFIG_GET(flag/ban_legacy_system))
holder.unbanpanel()
else
holder.DB_ban_panel()
diff --git a/code/modules/admin/ipintel.dm b/code/modules/admin/ipintel.dm
index 50f81e01c3..fa9951f276 100644
--- a/code/modules/admin/ipintel.dm
+++ b/code/modules/admin/ipintel.dm
@@ -14,18 +14,18 @@
. = FALSE
if (intel < 0)
return
- if (intel <= config.ipintel_rating_bad)
- if (world.realtime < cacherealtime+(config.ipintel_save_good*60*60*10))
+ if (intel <= CONFIG_GET(number/ipintel_rating_bad))
+ if (world.realtime < cacherealtime + (CONFIG_GET(number/ipintel_save_good) * 60 * 60 * 10))
return TRUE
else
- if (world.realtime < cacherealtime+(config.ipintel_save_bad*60*60*10))
+ if (world.realtime < cacherealtime + (CONFIG_GET(number/ipintel_save_bad) * 60 * 60 * 10))
return TRUE
/proc/get_ip_intel(ip, bypasscache = FALSE, updatecache = TRUE)
var/datum/ipintel/res = new()
res.ip = ip
. = res
- if (!ip || !config.ipintel_email || !SSipintel.enabled)
+ if (!ip || !CONFIG_GET(string/ipintel_email) || !SSipintel.enabled)
return
if (!bypasscache)
var/datum/ipintel/cachedintel = SSipintel.cache[ip]
@@ -34,19 +34,20 @@
return cachedintel
if(SSdbcore.Connect())
+ var/rating_bad = CONFIG_GET(number/ipintel_rating_bad)
var/datum/DBQuery/query_get_ip_intel = SSdbcore.NewQuery({"
SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW())
FROM [format_table_name("ipintel")]
WHERE
ip = INET_ATON('[ip]')
AND ((
- intel < [config.ipintel_rating_bad]
+ intel < [rating_bad]
AND
- date + INTERVAL [config.ipintel_save_good] HOUR > NOW()
+ date + INTERVAL [CONFIG_GET(number/ipintel_save_good)] HOUR > NOW()
) OR (
- intel >= [config.ipintel_rating_bad]
+ intel >= [rating_bad]
AND
- date + INTERVAL [config.ipintel_save_bad] HOUR > NOW()
+ date + INTERVAL [CONFIG_GET(number/ipintel_save_bad)] HOUR > NOW()
))
"})
if(!query_get_ip_intel.Execute())
@@ -77,7 +78,7 @@
if (!SSipintel.enabled)
return
- var/list/http[] = world.Export("http://[config.ipintel_domain]/check.php?ip=[ip]&contact=[config.ipintel_email]&format=json&flags_1=f")
+ var/list/http[] = world.Export("http://[CONFIG_GET(string/ipintel_domain)]/check.php?ip=[ip]&contact=[CONFIG_GET(string/ipintel_email)]&format=json&flags=f")
if (http)
var/status = text2num(http["STATUS"])
diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm
index f0f263f815..24a53eff2b 100644
--- a/code/modules/admin/permissionverbs/permissionedit.dm
+++ b/code/modules/admin/permissionverbs/permissionedit.dm
@@ -51,7 +51,7 @@
usr << browse(output,"window=editrights;size=900x650")
/datum/admins/proc/log_admin_rank_modification(adm_ckey, new_rank)
- if(config.admin_legacy_system)
+ if(CONFIG_GET(flag/admin_legacy_system))
return
if(!usr.client)
@@ -105,7 +105,7 @@
/datum/admins/proc/log_admin_permission_modification(adm_ckey, new_permission)
- if(config.admin_legacy_system)
+ if(CONFIG_GET(flag/admin_legacy_system))
return
if(!usr.client)
return
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index 39e07e0a9f..9e43ef92f8 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -329,14 +329,14 @@
else
dat += "ETA: [(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]
"
dat += "Continuous Round Status
"
- dat += "[config.continuous[SSticker.mode.config_tag] ? "Continue if antagonists die" : "End on antagonist death"]"
- if(config.continuous[SSticker.mode.config_tag])
- dat += ", [config.midround_antag[SSticker.mode.config_tag] ? "creating replacement antagonists" : "not creating new antagonists"]
"
+ dat += "[CONFIG_GET(keyed_flag_list/continuous)[SSticker.mode.config_tag] ? "Continue if antagonists die" : "End on antagonist death"]"
+ if(CONFIG_GET(keyed_flag_list/continuous)[SSticker.mode.config_tag])
+ dat += ", [CONFIG_GET(keyed_flag_list/midround_antag)[SSticker.mode.config_tag] ? "creating replacement antagonists" : "not creating new antagonists"]
"
else
dat += "
"
- if(config.midround_antag[SSticker.mode.config_tag])
- dat += "Time limit: [config.midround_antag_time_check] minutes into round
"
- dat += "Living crew limit: [config.midround_antag_life_check * 100]% of crew alive
"
+ if(CONFIG_GET(keyed_flag_list/midround_antag)[SSticker.mode.config_tag])
+ dat += "Time limit: [CONFIG_GET(number/midround_antag_time_check)] minutes into round
"
+ dat += "Living crew limit: [CONFIG_GET(number/midround_antag_life_check) * 100]% of crew alive
"
dat += "If limits past: [SSticker.mode.round_ends_with_antag_death ? "End The Round" : "Continue As Extended"]
"
dat += "End Round Now
"
dat += "[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]"
diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm
index 99f95cd6f4..9fd49ed497 100644
--- a/code/modules/admin/secrets.dm
+++ b/code/modules/admin/secrets.dm
@@ -354,16 +354,9 @@
SSblackbox.add_details("admin_secrets_fun_used","Bomb Cap")
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null
- if (newBombCap < 4)
+ if (!CONFIG_SET(number/bombcap, newBombCap))
return
- GLOB.MAX_EX_DEVESTATION_RANGE = round(newBombCap/4)
- GLOB.MAX_EX_HEAVY_RANGE = round(newBombCap/2)
- GLOB.MAX_EX_LIGHT_RANGE = newBombCap
- //I don't know why these are their own variables, but fuck it, they are.
- GLOB.MAX_EX_FLASH_RANGE = newBombCap
- GLOB.MAX_EX_FLAME_RANGE = newBombCap
-
message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]")
log_admin("[key_name(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]")
diff --git a/code/modules/admin/sql_message_system.dm b/code/modules/admin/sql_message_system.dm
index 50236c548d..587bd6b26c 100644
--- a/code/modules/admin/sql_message_system.dm
+++ b/code/modules/admin/sql_message_system.dm
@@ -33,8 +33,9 @@
if(!timestamp)
timestamp = SQLtime()
if(!server)
- if (config && config.server_sql_name)
- server = config.server_sql_name
+ var/ssqlname = CONFIG_GET(string/serversqlname)
+ if (ssqlname)
+ server = ssqlname
server = sanitizeSQL(server)
if(isnull(secret))
switch(alert("Hide note from being viewed by players?", "Secret note?","Yes","No","Cancel"))
@@ -216,8 +217,10 @@
var/editor_ckey = query_get_messages.item[8]
var/age = text2num(query_get_messages.item[9])
var/alphatext = ""
- if (agegate && type == "note" && isnum(config.note_stale_days) && isnum(config.note_fresh_days) && config.note_stale_days > config.note_fresh_days)
- var/alpha = Clamp(100 - (age - config.note_fresh_days) * (85 / (config.note_stale_days - config.note_fresh_days)), 15, 100)
+ var/nsd = CONFIG_GET(number/note_stale_days)
+ var/nfd = CONFIG_GET(number/note_fresh_days)
+ if (agegate && type == "note" && isnum(nsd) && isnum(nfd) && nsd > nfd)
+ var/alpha = Clamp(100 - (age - nfd) * (85 / (nsd - nfd)), 15, 100)
if (alpha < 100)
if (alpha <= 15)
if (skipped)
@@ -353,8 +356,9 @@ proc/get_message_output(type, target_ckey)
var/notetext
notesfile >> notetext
var/server
- if(config && config.server_sql_name)
- server = config.server_sql_name
+ var/ssqlname = CONFIG_GET(string/serversqlname)
+ if (ssqlname)
+ server = ssqlname
var/regex/note = new("^(\\d{2}-\\w{3}-\\d{4}) \\| (.+) ~(\\w+)$", "i")
note.Find(notetext)
var/timestamp = note.group[1]
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 7f9f5a7d27..c182107a6a 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -5,7 +5,7 @@
return
var/msg = !auth ? "no" : "a bad"
message_admins("[key_name_admin(usr)] clicked an href with [msg] authorization key!")
- if(config.debug_admin_hrefs)
+ if(CONFIG_GET(flag/debug_admin_hrefs))
message_admins("Debug mode enabled, call not blocked. Please ask your coders to review this round's logs.")
log_world("UAH: [href]")
return TRUE
@@ -318,35 +318,36 @@
else if(href_list["toggle_continuous"])
if(!check_rights(R_ADMIN))
return
-
- if(!config.continuous[SSticker.mode.config_tag])
- config.continuous[SSticker.mode.config_tag] = 1
+ var/list/continuous = CONFIG_GET(keyed_flag_list/continuous)
+ if(!continuous[SSticker.mode.config_tag])
+ continuous[SSticker.mode.config_tag] = TRUE
else
- config.continuous[SSticker.mode.config_tag] = 0
+ continuous[SSticker.mode.config_tag] = FALSE
- message_admins("[key_name_admin(usr)] toggled the round to [config.continuous[SSticker.mode.config_tag] ? "continue if all antagonists die" : "end with the antagonists"].")
+ message_admins("[key_name_admin(usr)] toggled the round to [continuous[SSticker.mode.config_tag] ? "continue if all antagonists die" : "end with the antagonists"].")
check_antagonists()
else if(href_list["toggle_midround_antag"])
if(!check_rights(R_ADMIN))
return
- if(!config.midround_antag[SSticker.mode.config_tag])
- config.midround_antag[SSticker.mode.config_tag] = 1
+ var/list/midround_antag = CONFIG_GET(keyed_flag_list/midround_antag)
+ if(!midround_antag[SSticker.mode.config_tag])
+ midround_antag[SSticker.mode.config_tag] = TRUE
else
- config.midround_antag[SSticker.mode.config_tag] = 0
+ midround_antag[SSticker.mode.config_tag] = FALSE
- message_admins("[key_name_admin(usr)] toggled the round to [config.midround_antag[SSticker.mode.config_tag] ? "use" : "skip"] the midround antag system.")
+ message_admins("[key_name_admin(usr)] toggled the round to [midround_antag[SSticker.mode.config_tag] ? "use" : "skip"] the midround antag system.")
check_antagonists()
else if(href_list["alter_midround_time_limit"])
if(!check_rights(R_ADMIN))
return
- var/timer = input("Enter new maximum time",, config.midround_antag_time_check ) as num|null
+ var/timer = input("Enter new maximum time",, CONFIG_GET(number/midround_antag_time_check)) as num|null
if(!timer)
return
- config.midround_antag_time_check = timer
+ CONFIG_SET(number/midround_antag_time_check, timer)
message_admins("[key_name_admin(usr)] edited the maximum midround antagonist time to [timer] minutes.")
check_antagonists()
@@ -354,9 +355,10 @@
if(!check_rights(R_ADMIN))
return
- var/ratio = input("Enter new life ratio",, config.midround_antag_life_check*100) as num
- if(ratio)
- config.midround_antag_life_check = ratio/100
+ var/ratio = input("Enter new life ratio",, CONFIG_GET(number/midround_antag_life_check) * 100) as num
+ if(!ratio)
+ return
+ CONFIG_SET(number/midround_antag_life_check, ratio / 100)
message_admins("[key_name_admin(usr)] edited the midround antagonist living crew ratio to [ratio]% alive.")
check_antagonists()
@@ -586,8 +588,9 @@
to_chat(M, "You have been appearance banned by [usr.client.ckey].")
to_chat(M, "The reason is: [reason]")
to_chat(M, "Appearance ban can be lifted only upon request.")
- if(config.banappeals)
- to_chat(M, "To try to resolve this matter head to [config.banappeals]")
+ var/bran = CONFIG_GET(string/banappeals)
+ if(bran)
+ to_chat(M, "To try to resolve this matter head to [bran]")
else
to_chat(M, "No ban appeals URL has been set.")
if("No")
@@ -1156,8 +1159,9 @@
to_chat(M, "This is a temporary ban, it will be removed in [mins] minutes.")
SSblackbox.inc("ban_tmp",1)
SSblackbox.inc("ban_tmp_mins",mins)
- if(config.banappeals)
- to_chat(M, "To try to resolve this matter head to [config.banappeals]")
+ var/bran = CONFIG_GET(string/banappeals)
+ if(bran)
+ to_chat(M, "To try to resolve this matter head to [bran]")
else
to_chat(M, "No ban appeals URL has been set.")
log_admin_private("[key_name(usr)] has banned [M.ckey].\nReason: [key_name(M)]\nThis will be removed in [mins] minutes.")
@@ -1180,8 +1184,9 @@
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
to_chat(M, "You have been banned by [usr.client.ckey].\nReason: [reason]")
to_chat(M, "This is a permanent ban.")
- if(config.banappeals)
- to_chat(M, "To try to resolve this matter head to [config.banappeals]")
+ var/bran = CONFIG_GET(string/banappeals)
+ if(bran)
+ to_chat(M, "To try to resolve this matter head to [bran]")
else
to_chat(M, "No ban appeals URL has been set.")
if(!DB_ban_record(BANTYPE_PERMA, M, -1, reason))
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index 7922a89c80..a61de11c30 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -589,19 +589,20 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/proc/send2irc(msg,msg2)
if(world.RunningService())
world.ExportService("[SERVICE_REQUEST_IRC_ADMIN_CHANNEL_MESSAGE] [msg] | [msg2]")
- else if(config.useircbot)
+ else if(CONFIG_GET(flag/useircbot))
shell("python nudge.py [msg] [msg2]")
/proc/send2otherserver(source,msg,type = "Ahelp")
- if(config.cross_allowed)
+ var/comms_key = CONFIG_GET(string/comms_key)
+ if(comms_key)
var/list/message = list()
message["message_sender"] = source
message["message"] = msg
- message["source"] = "([config.cross_name])"
- message["key"] = global.comms_key
+ message["source"] = "([CONFIG_GET(string/cross_comms_name)])"
+ message["key"] = comms_key
message["crossmessage"] = type
- world.Export("[config.cross_address]?[list2params(message)]")
+ world.Export("[CONFIG_GET(string/cross_server_address)]?[list2params(message)]")
/proc/ircadminwho()
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index db29021463..038e454a24 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -185,7 +185,7 @@
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
- if(config.popup_admin_pm)
+ if(CONFIG_GET(flag/popup_admin_pm))
spawn() //so we don't hold the caller proc up
var/sender = src
var/sendername = key
@@ -277,7 +277,7 @@
return "Error: Ticket could not be found"
var/static/stealthkey
- var/adminname = config.showircname ? irc_tagged : "Administrator"
+ var/adminname = CONFIG_GET(flag/show_irc_name) ? irc_tagged : "Administrator"
if(!C)
return "Error: No client"
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index cb5ce19d68..cff80e6117 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -845,11 +845,11 @@ GLOBAL_PROTECT(LastAdminCalledProc)
if(!holder)
return
- global.medals_enabled = !global.medals_enabled
+ GLOB.medals_enabled = !GLOB.medals_enabled
- message_admins("[key_name_admin(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
+ message_admins("[key_name_admin(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
SSblackbox.add_details("admin_verb","Toggle Medal Disable") // If...
- log_admin("[key_name(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
+ log_admin("[key_name(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
/client/proc/view_runtimes()
set category = "Debug"
diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm
index bedcd0a6e5..f893c43e08 100644
--- a/code/modules/admin/verbs/fps.dm
+++ b/code/modules/admin/verbs/fps.dm
@@ -7,13 +7,14 @@
if(!check_rights(R_DEBUG))
return
- var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [config.fps])","FPS", world.fps) as num|null)
+ var/cfg_fps = CONFIG_GET(number/fps)
+ var/new_fps = round(input("Sets game frames-per-second. Can potentially break the game (default: [cfg_fps])","FPS", world.fps) as num|null)
if(new_fps <= 0)
to_chat(src, "Error: set_server_fps(): Invalid world.fps value. No changes made.")
return
- if(new_fps > config.fps*1.5)
- if(alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [config.fps]","Warning!","Confirm","ABORT-ABORT-ABORT") != "Confirm")
+ if(new_fps > cfg_fps * 1.5)
+ if(alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!","Confirm","ABORT-ABORT-ABORT") != "Confirm")
return
var/msg = "[key_name(src)] has modified world.fps to [new_fps]"
@@ -21,4 +22,5 @@
message_admins(msg, 0)
SSblackbox.add_details("admin_toggle","Set Server FPS|[new_fps]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ CONFIG_SET(number/fps, new_fps)
world.fps = new_fps
diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm
index e8ba7c8bab..d14fb1f167 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -31,10 +31,10 @@
/datum/admins/proc/makeTraitors()
var/datum/game_mode/traitor/temp = new
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
temp.restricted_jobs += temp.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
@@ -67,10 +67,10 @@
/datum/admins/proc/makeChanglings()
var/datum/game_mode/changeling/temp = new
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
temp.restricted_jobs += temp.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
@@ -100,10 +100,10 @@
/datum/admins/proc/makeRevs()
var/datum/game_mode/revolution/temp = new
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
temp.restricted_jobs += temp.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
@@ -142,10 +142,10 @@
/datum/admins/proc/makeCult()
var/datum/game_mode/cult/temp = new
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
temp.restricted_jobs += temp.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
@@ -175,10 +175,10 @@
/datum/admins/proc/makeClockCult()
var/datum/game_mode/clockwork_cult/temp = new
- if(config.protect_roles_from_antagonist)
+ if(CONFIG_GET(flag/protect_roles_from_antagonist))
temp.restricted_jobs += temp.protected_jobs
- if(config.protect_assistant_from_antagonist)
+ if(CONFIG_GET(flag/protect_assistant_from_antagonist))
temp.restricted_jobs += "Assistant"
var/list/mob/living/carbon/human/candidates = list()
@@ -340,7 +340,7 @@
missiondesc += "
Your Mission: [mission]"
to_chat(Commando, missiondesc)
- if(config.enforce_human_authority)
+ if(CONFIG_GET(flag/enforce_human_authority))
Commando.set_species(/datum/species/human)
//Logging and cleanup
@@ -382,7 +382,7 @@
missionobj.completed = 1
newmob.mind.objectives += missionobj
- if(config.enforce_human_authority)
+ if(CONFIG_GET(flag/enforce_human_authority))
newmob.set_species(/datum/species/human)
//Greet the official
@@ -497,7 +497,7 @@
missiondesc += "
Your Mission: [mission]"
to_chat(ERTOperative, missiondesc)
- if(config.enforce_human_authority)
+ if(CONFIG_GET(flag/enforce_human_authority))
ERTOperative.set_species(/datum/species/human)
//Logging and cleanup
diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm
index 3da486be78..b159445963 100644
--- a/code/modules/admin/verbs/panicbunker.dm
+++ b/code/modules/admin/verbs/panicbunker.dm
@@ -1,15 +1,16 @@
/client/proc/panicbunker()
set category = "Server"
set name = "Toggle Panic Bunker"
- if (!config.sql_enabled)
+ if (!CONFIG_GET(flag/sql_enabled))
to_chat(usr, "The Database is not enabled!")
return
- config.panic_bunker = (!config.panic_bunker)
+ var/new_pb = !CONFIG_GET(flag/panic_bunker)
+ CONFIG_SET(flag/panic_bunker, new_pb)
- log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")]")
- message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"enabled":"disabled")].")
- if (config.panic_bunker && (!SSdbcore || !SSdbcore.IsConnected()))
+ log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [new_pb ? "on" : "off"]")
+ message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [new_pb ? "enabled" : "disabled"].")
+ if (new_pb && !SSdbcore.Connect())
message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.")
- SSblackbox.add_details("admin_toggle","Toggle Panic Bunker|[config.panic_bunker]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_toggle","Toggle Panic Bunker|[new_pb]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm
index 61df0cb8d1..d63d0d712f 100644
--- a/code/modules/admin/verbs/playsound.dm
+++ b/code/modules/admin/verbs/playsound.dm
@@ -62,7 +62,8 @@
if(!check_rights(R_SOUNDS))
return
- if(!config.invoke_youtubedl)
+ var/ytdl = CONFIG_GET(string/invoke_youtubedl)
+ if(!ytdl)
to_chat(src, "Youtube-dl was not configured, action unavailable") //Check config.txt for the INVOKE_YOUTUBEDL value
return
@@ -79,7 +80,7 @@
to_chat(src, "For youtube-dl shortcuts like ytsearch: please use the appropriate full url from the website.")
return
var/shell_scrubbed_input = shell_url_scrub(web_sound_input)
- var/list/output = world.shelleo("[config.invoke_youtubedl] --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --get-url \"[shell_scrubbed_input]\"")
+ var/list/output = world.shelleo("[ytdl] --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --get-url \"[shell_scrubbed_input]\"")
var/errorlevel = output[SHELLEO_ERRORLEVEL]
var/stdout = output[SHELLEO_STDOUT]
var/stderr = output[SHELLEO_STDERR]
diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm
index e271cdb3a7..483c9470a2 100644
--- a/code/modules/admin/verbs/possess.dm
+++ b/code/modules/admin/verbs/possess.dm
@@ -2,7 +2,7 @@
set name = "Possess Obj"
set category = "Object"
- if(O.dangerous_possession && config.forbid_singulo_possession)
+ if(O.dangerous_possession && CONFIG_GET(flag/forbid_singulo_possession))
to_chat(usr, "[O] is too powerful for you to possess.")
return
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index 975e8aa731..cdbdb4a311 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -174,7 +174,7 @@
return
if(automute)
- if(!config.automute_on)
+ if(!CONFIG_GET(flag/automute_on))
return
else
if(!check_rights())
@@ -707,8 +707,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!")
return
- if(config.force_random_names)
- config.force_random_names = 0
+ var/frn = CONFIG_GET(flag/force_random_names)
+ if(frn)
+ CONFIG_SET(flag/force_random_names, FALSE)
message_admins("Admin [key_name_admin(usr)] has disabled \"Everyone is Special\" mode.")
to_chat(usr, "Disabled.")
return
@@ -726,7 +727,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
to_chat(usr, "Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet.")
- config.force_random_names = 1
+ CONFIG_SET(flag/force_random_names, TRUE)
SSblackbox.add_details("admin_verb","Make Everyone Random") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -734,15 +735,15 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Server"
set name = "Toggle random events on/off"
set desc = "Toggles random events such as meteors, black holes, blob (but not space dust) on/off"
- if(!config.allow_random_events)
- config.allow_random_events = 1
+ var/new_are = !CONFIG_GET(flag/allow_random_events)
+ CONFIG_SET(flag/allow_random_events, new_are)
+ if(new_are)
to_chat(usr, "Random events enabled")
message_admins("Admin [key_name_admin(usr)] has enabled random events.")
else
- config.allow_random_events = 0
to_chat(usr, "Random events disabled")
message_admins("Admin [key_name_admin(usr)] has disabled random events.")
- SSblackbox.add_details("admin_toggle","Toggle Random Events|[config.allow_random_events]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_toggle","Toggle Random Events|[new_are]") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/admin_change_sec_level()
diff --git a/code/modules/admin/verbs/reestablish_db_connection.dm b/code/modules/admin/verbs/reestablish_db_connection.dm
index 3578e98b1b..5c5edf6d17 100644
--- a/code/modules/admin/verbs/reestablish_db_connection.dm
+++ b/code/modules/admin/verbs/reestablish_db_connection.dm
@@ -1,7 +1,7 @@
/client/proc/reestablish_db_connection()
set category = "Special Verbs"
set name = "Reestablish DB Connection"
- if (!config.sql_enabled)
+ if (!CONFIG_GET(flag/sql_enabled))
to_chat(usr, "The Database is not enabled!")
return
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 9a721bee62..12f99f3c50 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -80,7 +80,7 @@ GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation)
if(!GLOB.the_gateway)
GLOB.the_gateway = src
update_icon()
- wait = world.time + config.gateway_delay //+ thirty minutes default
+ wait = world.time + CONFIG_GET(number/gateway_delay) //+ thirty minutes default
awaygate = locate(/obj/machinery/gateway/centeraway)
/obj/machinery/gateway/centerstation/Destroy()
diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm
index 6fbc7d552f..60936aa5fb 100644
--- a/code/modules/client/client_procs.dm
+++ b/code/modules/client/client_procs.dm
@@ -42,7 +42,8 @@
to_chat(src, "An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)")
src << browse("...", "window=asset_cache_browser")
- if (!holder && config.minutetopiclimit)
+ var/mtl = CONFIG_GET(number/minute_topic_limit)
+ if (!holder && mtl)
var/minute = round(world.time, 600)
if (!topiclimiter)
topiclimiter = new(LIMITER_SIZE)
@@ -50,17 +51,18 @@
topiclimiter[CURRENT_MINUTE] = minute
topiclimiter[MINUTE_COUNT] = 0
topiclimiter[MINUTE_COUNT] += 1
- if (topiclimiter[MINUTE_COUNT] > config.minutetopiclimit)
+ if (topiclimiter[MINUTE_COUNT] > mtl)
var/msg = "Your previous action was ignored because you've done too many in a minute."
if (minute != topiclimiter[ADMINSWARNED_AT]) //only one admin message per-minute. (if they spam the admins can just boot/ban them)
topiclimiter[ADMINSWARNED_AT] = minute
msg += " Administrators have been informed."
- log_game("[key_name(src)] Has hit the per-minute topic limit of [config.minutetopiclimit] topic calls in a given game minute")
- message_admins("[key_name_admin(src)] [ADMIN_FLW(usr)] [ADMIN_KICK(usr)] Has hit the per-minute topic limit of [config.minutetopiclimit] topic calls in a given game minute")
+ log_game("[key_name(src)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute")
+ message_admins("[key_name_admin(src)] [ADMIN_FLW(usr)] [ADMIN_KICK(usr)] Has hit the per-minute topic limit of [mtl] topic calls in a given game minute")
to_chat(src, "[msg]")
return
- if (!holder && config.secondtopiclimit)
+ var/stl = CONFIG_GET(number/second_topic_limit)
+ if (!holder && stl)
var/second = round(world.time, 10)
if (!topiclimiter)
topiclimiter = new(LIMITER_SIZE)
@@ -68,7 +70,7 @@
topiclimiter[CURRENT_SECOND] = second
topiclimiter[SECOND_COUNT] = 0
topiclimiter[SECOND_COUNT] += 1
- if (topiclimiter[SECOND_COUNT] > config.secondtopiclimit)
+ if (topiclimiter[SECOND_COUNT] > stl)
to_chat(src, "Your previous action was ignored because you've done too many in a second")
return
@@ -110,7 +112,7 @@
return 1
/client/proc/handle_spam_prevention(message, mute_type)
- if(config.automute_on && !holder && src.last_message == message)
+ if(CONFIG_GET(flag/automute_on) && !holder && last_message == message)
src.last_message_count++
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
to_chat(src, "You have exceeded the spam filter limit for identical messages. An auto-mute was applied.")
@@ -174,11 +176,11 @@ GLOBAL_LIST(external_rsc_urls)
if(localhost_rank)
var/datum/admins/localhost_holder = new(localhost_rank, ckey)
localhost_holder.associate(src)
- if(config.autoadmin)
+ if(CONFIG_GET(flag/autoadmin))
if(!GLOB.admin_datums[ckey])
var/datum/admin_rank/autorank
for(var/datum/admin_rank/R in GLOB.admin_ranks)
- if(R.name == config.autoadmin_rank)
+ if(R.name == CONFIG_GET(string/autoadmin_rank))
autorank = R
break
if(!autorank)
@@ -206,7 +208,7 @@ GLOBAL_LIST(external_rsc_urls)
log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[byond_version]")
var/alert_mob_dupe_login = FALSE
- if(config.log_access)
+ if(CONFIG_GET(flag/log_access))
for(var/I in GLOB.clients)
if(!I || I == src)
continue
@@ -240,30 +242,32 @@ GLOBAL_LIST(external_rsc_urls)
connection_realtime = world.realtime
connection_timeofday = world.timeofday
winset(src, null, "command=\".configure graphics-hwmode on\"")
- if (byond_version < config.client_error_version) //Out of date client.
+ var/cev = CONFIG_GET(number/client_error_version)
+ var/cwv = CONFIG_GET(number/client_warn_version)
+ if (byond_version < cev) //Out of date client.
to_chat(src, "Your version of byond is too old:")
- to_chat(src, config.client_error_message)
+ to_chat(src, CONFIG_GET(string/client_error_message))
to_chat(src, "Your version: [byond_version]")
- to_chat(src, "Required version: [config.client_error_version] or later")
+ to_chat(src, "Required version: [cev] or later")
to_chat(src, "Visit http://www.byond.com/download/ to get the latest version of byond.")
if (holder)
to_chat(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade")
else
qdel(src)
return 0
- else if (byond_version < config.client_warn_version) //We have words for this client.
+ else if (byond_version < cwv) //We have words for this client.
to_chat(src, "Your version of byond may be getting out of date:")
- to_chat(src, config.client_warn_message)
+ to_chat(src, CONFIG_GET(string/client_warn_message))
to_chat(src, "Your version: [byond_version]")
- to_chat(src, "Required version to remove this message: [config.client_warn_version] or later")
+ to_chat(src, "Required version to remove this message: [cwv] or later")
to_chat(src, "Visit http://www.byond.com/download/ to get the latest version of byond.")
if (connection == "web" && !holder)
- if (!config.allowwebclient)
+ if (!CONFIG_GET(flag/allow_webclient))
to_chat(src, "Web client is disabled")
qdel(src)
return 0
- if (config.webclientmembersonly && !IsByondMember())
+ if (CONFIG_GET(flag/webclient_only_byond_members) && !IsByondMember())
to_chat(src, "Sorry, but the web client is restricted to byond members only.")
qdel(src)
return 0
@@ -276,25 +280,24 @@ GLOBAL_LIST(external_rsc_urls)
add_admin_verbs()
to_chat(src, get_message_output("memo"))
adminGreet()
- if((global.comms_key == "default_pwd" || length(global.comms_key) <= 6) && global.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms.
- to_chat(src, "The server's API key is either too short or is the default value! Consider changing it immediately!")
add_verbs_from_config()
var/cached_player_age = set_client_age_from_db(tdata) //we have to cache this because other shit may change it and we need it's current value now down below.
if (isnum(cached_player_age) && cached_player_age == -1) //first connection
player_age = 0
+ var/nnpa = CONFIG_GET(number/notify_new_player_age)
if (isnum(cached_player_age) && cached_player_age == -1) //first connection
- if (config.notify_new_player_age >= 0)
+ if (nnpa >= 0)
message_admins("New user: [key_name_admin(src)] is connecting here for the first time.")
- if (config.irc_first_connection_alert)
+ if (CONFIG_GET(flag/irc_first_connection_alert))
send2irc_adminless_only("New-user", "[key_name(src)] is connecting for the first time!")
- else if (isnum(cached_player_age) && cached_player_age < config.notify_new_player_age)
+ else if (isnum(cached_player_age) && cached_player_age < nnpa)
message_admins("New user: [key_name_admin(src)] just connected with an age of [cached_player_age] day[(player_age==1?"":"s")]")
- if(config.use_account_age_for_jobs && account_age >= 0)
+ if(CONFIG_GET(flag/use_account_age_for_jobs) && account_age >= 0)
player_age = account_age
- if(account_age >= 0 && account_age < config.notify_new_player_account_age)
+ if(account_age >= 0 && account_age < nnpa)
message_admins("[key_name_admin(src)] (IP: [address], ID: [computer_id]) is a new BYOND account [account_age] day[(account_age==1?"":"s")] old, created on [account_join_date].")
- if (config.irc_first_connection_alert)
+ if (CONFIG_GET(flag/irc_first_connection_alert))
send2irc_adminless_only("new_byond_user", "[key_name(src)] (IP: [address], ID: [computer_id]) is a new BYOND account [account_age] day[(account_age==1?"":"s")] old, created on [account_join_date].")
get_message_output("watchlist entry", ckey)
check_ip_intel()
@@ -306,7 +309,7 @@ GLOBAL_LIST(external_rsc_urls)
if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates.
to_chat(src, "You have unread updates in the changelog.")
- if(config.aggressive_changelog)
+ if(CONFIG_GET(flag/aggressive_changelog))
changelog()
else
winset(src, "infowindow.changelog", "font-style=bold")
@@ -316,7 +319,7 @@ GLOBAL_LIST(external_rsc_urls)
to_chat(src, message)
GLOB.clientmessages.Remove(ckey)
- if(config && config.autoconvert_notes)
+ if(CONFIG_GET(flag/autoconvert_notes))
convert_notes_sql(ckey)
to_chat(src, get_message_output("message", ckey))
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
@@ -432,15 +435,17 @@ GLOBAL_LIST(external_rsc_urls)
if(!query_client_in_db.Execute())
return
if(!query_client_in_db.NextRow())
- if (config.panic_bunker && !holder && !(ckey in GLOB.deadmins))
+ if (CONFIG_GET(flag/panic_bunker) && !holder && !(ckey in GLOB.deadmins))
log_access("Failed Login: [key] - New account attempting to connect during panic bunker")
message_admins("Failed Login: [key] - New account attempting to connect during panic bunker")
to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.")
var/list/connectiontopic_a = params2list(connectiontopic)
- if(config.panic_address && !connectiontopic_a["redirect"])
- to_chat(src, "Sending you to [config.panic_server_name ? config.panic_server_name : config.panic_address].")
+ var/list/panic_addr = CONFIG_GET(string/panic_address)
+ if(panic_addr && !connectiontopic_a["redirect"])
+ var/panic_name = CONFIG_GET(string/panic_server_name)
+ to_chat(src, "Sending you to [panic_name ? panic_name : panic_addr].")
winset(src, null, "command=.options")
- src << link("[config.panic_address]?redirect=1")
+ src << link("[panic_addr]?redirect=1")
qdel(src)
return
@@ -501,7 +506,7 @@ GLOBAL_LIST(external_rsc_urls)
if (connection != "seeker")
return
topic = params2list(topic)
- if (!config.check_randomizer)
+ if (!CONFIG_GET(flag/check_randomizer))
return
var/static/cidcheck = list()
var/static/tokens = list()
@@ -594,15 +599,15 @@ GLOBAL_LIST(external_rsc_urls)
/client/proc/check_ip_intel()
set waitfor = 0 //we sleep when getting the intel, no need to hold up the client connection while we sleep
- if (config.ipintel_email)
+ if (CONFIG_GET(string/ipintel_email))
var/datum/ipintel/res = get_ip_intel(address)
- if (res.intel >= config.ipintel_rating_bad)
+ if (res.intel >= CONFIG_GET(number/ipintel_rating_bad))
message_admins("Proxy Detection: [key_name_admin(src)] IP intel rated [res.intel*100]% likely to be a Proxy/VPN.")
ip_intel = res.intel
/client/proc/add_verbs_from_config()
- if(config.see_own_notes)
+ if(CONFIG_GET(flag/see_own_notes))
verbs += /client/proc/self_notes
@@ -612,7 +617,7 @@ GLOBAL_LIST(external_rsc_urls)
//checks if a client is afk
//3000 frames = 5 minutes
-/client/proc/is_afk(duration = config.inactivity_period)
+/client/proc/is_afk(duration = CONFIG_GET(number/inactivity_period))
if(inactivity > duration)
return inactivity
return FALSE
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 15b0bd95df..38e0b0bd90 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -46,7 +46,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/preferred_map = null
var/uses_glasses_colour = 0
-
+
var/screenshake = 100
var/damagescreenshake = 2
@@ -277,6 +277,168 @@ GLOBAL_LIST_EMPTY(preferences_datums)
// dat += "Size: [character_size]
"
dat += "
"
+ dat += "Body
"
+ dat += "Random Body "
+ dat += "Always Random Body: [be_random_body ? "Yes" : "No"]
"
+
+ dat += ""
+
+ if(CONFIG_GET(flag/join_with_mutant_race))
+ dat += "Species: [pref_species.name] "
+ else
+ dat += "Species: Human "
+
+ dat += "Underwear: [underwear] "
+ dat += "Undershirt: [undershirt] "
+ dat += "Socks: [socks] "
+ dat += "Backpack: [backbag] "
+ dat += "Uplink Spawn Location: [uplink_spawn_loc]
| "
+
+ if(pref_species.use_skintones)
+
+ dat += ""
+
+ dat += "Skin Tone"
+
+ dat += "[skin_tone] "
+
+ dat += " | "
+
+ if(HAIR in pref_species.species_traits)
+
+ dat += ""
+
+ dat += "Hair Style"
+
+ dat += "[hair_style] "
+ dat += "< > "
+ dat += " Change "
+
+
+ dat += " | "
+
+ dat += "Facial Hair Style"
+
+ dat += "[facial_hair_style] "
+ dat += "< > "
+ dat += " Change "
+
+ dat += " | "
+
+ if(EYECOLOR in pref_species.species_traits)
+
+ dat += ""
+
+ dat += "Eye Color"
+
+ dat += " Change "
+
+ dat += " | "
+
+ if(CONFIG_GET(flag/join_with_mutant_race)) //We don't allow mutant bodyparts for humans either unless this is true.
+
+ if((MUTCOLORS in pref_species.species_traits) || (MUTCOLORS_PARTSONLY in pref_species.species_traits))
+
+ dat += ""
+
+ dat += "Mutant Color"
+
+ dat += " Change "
+
+ dat += " | "
+
+ if("tail_lizard" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Tail"
+
+ dat += "[features["tail_lizard"]] "
+
+ dat += " | "
+
+ if("snout" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Snout"
+
+ dat += "[features["snout"]] "
+
+ dat += " | "
+
+ if("horns" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Horns"
+
+ dat += "[features["horns"]] "
+
+ dat += " | "
+
+ if("frills" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Frills"
+
+ dat += "[features["frills"]] "
+
+ dat += " | "
+
+ if("spines" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Spines"
+
+ dat += "[features["spines"]] "
+
+ dat += " | "
+
+ if("body_markings" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Body Markings"
+
+ dat += "[features["body_markings"]] "
+
+ dat += " | "
+ if("legs" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Legs"
+
+ dat += "[features["legs"]] "
+
+ dat += " | "
+ if(CONFIG_GET(flag/join_with_mutant_humans))
+
+ if("tail_human" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Tail"
+
+ dat += "[features["tail_human"]] "
+
+ dat += " | "
+
+ if("ears" in pref_species.mutant_bodyparts)
+ dat += ""
+
+ dat += "Ears"
+
+ dat += "[features["ears"]] "
+
+ dat += " | "
+
+ if("wings" in pref_species.mutant_bodyparts && GLOB.r_wings_list.len >1)
+ dat += ""
+
+ dat += "Wings"
+
+ dat += "[features["wings"]] "
+
+ dat += " | "
+
+ dat += "
"
+
if (1) // Game Preferences
dat += ""
dat += "General Settings"
@@ -295,7 +457,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Ghost pda: [(chat_toggles & CHAT_GHOSTPDA) ? "All Messages" : "Nearest Creatures"] "
dat += "Pull requests: [(chat_toggles & CHAT_PULLR) ? "Yes" : "No"] "
dat += "Midround Antagonist: [(toggles & MIDROUND_ANTAG) ? "Yes" : "No"] "
- if(config.allow_Metadata)
+ if(CONFIG_GET(flag/allow_metadata))
dat += "OOC Notes: Edit "
if(user.client)
@@ -332,7 +494,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Ghosts of Others: [button_name] "
- if (config.maprotation)
+ if (CONFIG_GET(flag/maprotation))
var/p_map = preferred_map
if (!p_map)
p_map = "Default"
@@ -347,7 +509,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
p_map = VM.map_name
else
p_map += " (No longer exists)"
- if(config.allow_map_voting)
+ if(CONFIG_GET(flag/allow_map_voting))
dat += "Preferred Map: [p_map] "
dat += "FPS: [clientfps] "
@@ -385,7 +547,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Be [capitalize(i)]: BANNED "
else
var/days_remaining = null
- if(config.use_age_restriction_for_jobs && ispath(GLOB.special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age
+ if(ispath(GLOB.special_roles[i]) && CONFIG_GET(flag/use_age_restriction_for_jobs)) //If it's a game mode antag, check if the player meets the minimum age
var/mode_path = GLOB.special_roles[i]
var/datum/game_mode/temp_mode = new mode_path
days_remaining = temp_mode.get_remaining_days(user.client)
@@ -409,7 +571,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "[features["flavor_text"]]"
else
dat += "[TextPreview(features["flavor_text"])]... "
- if(config.mutant_races)//really don't need this check, but fuck un-tabbing all those lines
+ if(CONFIG_GET(flag/join_with_mutant_race))//really don't need this check, but fuck un-tabbing all those lines
dat += "Body"
dat += "Gender: [gender == MALE ? "Male" : "Female"] "
dat += "Species:[pref_species.id] "
@@ -599,7 +761,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if((job_civilian_low & ASSISTANT) && (rank != "Assistant") && !jobban_isbanned(user, "Assistant"))
HTML += "[rank] | |
"
continue
- if(config.enforce_human_authority && !user.client.prefs.pref_species.qualifies_for_rank(rank, user.client.prefs.features))
+ if(CONFIG_GET(flag/enforce_human_authority) && !user.client.prefs.pref_species.qualifies_for_rank(rank, user.client.prefs.features))
if(user.client.prefs.pref_species.id == "human")
HTML += "[rank] \[MUTANT\] | "
else
@@ -1023,10 +1185,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("species")
- var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_species
+ var/result = input(user, "Select a species", "Species Selection") as null|anything in CONFIG_GET(keyed_flag_list/roundstart_races)
if(result)
- var/newtype = GLOB.roundstart_species[result]
+ var/newtype = GLOB.species_list[result]
pref_species = new newtype()
//Now that we changed our species, we must verify that the mutant colour is still allowed.
var/temp_hsv = RGBtoHSV(features["mcolor"])
@@ -1622,7 +1784,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(be_random_body)
random_character(gender)
- if(config.humans_need_surnames)
+ if(CONFIG_GET(flag/humans_need_surnames))
var/firstspace = findtext(real_name, " ")
var/name_length = length(real_name)
if(!firstspace) //we need a surname
@@ -1657,7 +1819,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.dna.features = features.Copy() //Flavor text is now a DNA feature
character.dna.real_name = character.real_name
var/datum/species/chosen_species
- if(pref_species != /datum/species/human && config.mutant_races)
+ if(pref_species != /datum/species/human && CONFIG_GET(flag/join_with_mutant_race))
chosen_species = pref_species.type
else
chosen_species = /datum/species/human
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index 9daad5cae7..d58d1cec77 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -290,11 +290,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//Species
var/species_id
S["species"] >> species_id
- if(config.mutant_races && species_id && (species_id in GLOB.roundstart_species))
- var/newtype = GLOB.roundstart_species[species_id]
+ var/list/roundstart_races = CONFIG_GET(keyed_flag_list/roundstart_races)
+ if(species_id && (species_id in roundstart_races) && CONFIG_GET(flag/join_with_mutant_race))
+ var/newtype = GLOB.species_list[species_id]
pref_species = new newtype()
- else if (config.roundstart_races.len)
- var/rando_race = pick(config.roundstart_races)
+ else if (roundstart_races.len)
+ var/rando_race = pick(roundstart_races)
if (rando_race)
pref_species = new rando_race()
@@ -327,8 +328,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["feature_lizard_spines"] >> features["spines"]
S["feature_lizard_body_markings"] >> features["body_markings"]
S["feature_lizard_legs"] >> features["legs"]
- S["feature_human_tail"] >> features["tail_human"]
- S["feature_human_ears"] >> features["ears"]
+ if(!CONFIG_GET(flag/join_with_mutant_humans))
+ features["tail_human"] = "none"
+ features["ears"] = "none"
+ else
+ S["feature_human_tail"] >> features["tail_human"]
+ S["feature_human_ears"] >> features["ears"]
S["clown_name"] >> custom_names["clown"]
S["mime_name"] >> custom_names["mime"]
S["ai_name"] >> custom_names["ai"]
diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm
index 7715362c06..e2022729be 100644
--- a/code/modules/client/verbs/ooc.dm
+++ b/code/modules/client/verbs/ooc.dm
@@ -62,7 +62,7 @@
if(holder)
if(!holder.fakekey || C.holder)
if(check_rights_for(src, R_ADMIN))
- to_chat(C, "[config.allow_admin_ooccolor && prefs.ooccolor ? "" :"" ]OOC: [keyname][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]")
+ to_chat(C, "[CONFIG_GET(flag/allow_admin_ooccolor) && prefs.ooccolor ? "" :"" ]OOC: [keyname][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]")
else
to_chat(C, "OOC: [keyname][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]")
else
@@ -239,7 +239,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR)
set category = "OOC"
set desc = "View the notes that admins have written about you"
- if(!config.see_own_notes)
+ if(!CONFIG_GET(flag/see_own_notes))
to_chat(usr, "Sorry, that function is not enabled on this server.")
return
diff --git a/code/modules/emoji/emoji_parse.dm b/code/modules/emoji/emoji_parse.dm
index 58f261f8cc..7d1953738f 100644
--- a/code/modules/emoji/emoji_parse.dm
+++ b/code/modules/emoji/emoji_parse.dm
@@ -1,6 +1,6 @@
/proc/emoji_parse(text)
. = text
- if(!config.emojis)
+ if(!CONFIG_GET(flag/emojis))
return
var/static/list/emojis = icon_states(icon('icons/emoji.dmi'))
var/parsed = ""
diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm
index c0c8cf5b74..17ac8b3628 100644
--- a/code/modules/error_handler/error_handler.dm
+++ b/code/modules/error_handler/error_handler.dm
@@ -33,14 +33,20 @@ GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
// We can runtime before config is initialized because BYOND initialize objs/map before a bunch of other stuff happens.
// This is a bunch of workaround code for that. Hooray!
-
- var/configured_error_cooldown = initial(config.error_cooldown)
- var/configured_error_limit = initial(config.error_limit)
- var/configured_error_silence_time = initial(config.error_silence_time)
+ var/configured_error_cooldown
+ var/configured_error_limit
+ var/configured_error_silence_time
if(config)
- configured_error_cooldown = config.error_cooldown
- configured_error_limit = config.error_limit
- configured_error_silence_time = config.error_silence_time
+ configured_error_cooldown = CONFIG_GET(number/error_cooldown)
+ configured_error_limit = CONFIG_GET(number/error_limit)
+ configured_error_silence_time = CONFIG_GET(number/error_silence_time)
+ else
+ var/datum/config_entry/CE = /datum/config_entry/number/error_cooldown
+ configured_error_cooldown = initial(CE.value)
+ CE = /datum/config_entry/number/error_limit
+ configured_error_limit = initial(CE.value)
+ CE = /datum/config_entry/number/error_silence_time
+ configured_error_silence_time = initial(CE.value)
//Each occurence of a unique error adds to its cooldown time...
diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm
index dddff75bb2..b19153956f 100644
--- a/code/modules/error_handler/error_viewer.dm
+++ b/code/modules/error_handler/error_viewer.dm
@@ -119,9 +119,10 @@ GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache)
//log_debug("Runtime in [e.file], line [e.line]: [html_encode(e.name)] [error_entry.make_link(viewtext)]")
var/err_msg_delay
if(config)
- err_msg_delay = config.error_msg_delay
+ err_msg_delay = CONFIG_GET(number/error_msg_delay)
else
- err_msg_delay = initial(config.error_msg_delay)
+ var/datum/config_entry/CE = /datum/config_entry/number/error_msg_delay
+ err_msg_delay = initial(CE.value)
error_source.next_message_at = world.time + err_msg_delay
/datum/error_viewer/error_source
diff --git a/code/modules/events/_event.dm b/code/modules/events/_event.dm
index 92399f8934..9c3abf8cb3 100644
--- a/code/modules/events/_event.dm
+++ b/code/modules/events/_event.dm
@@ -29,8 +29,8 @@
/datum/round_event_control/New()
if(config && !wizardevent) // Magic is unaffected by configs
- earliest_start = Ceiling(earliest_start * config.events_min_time_mul)
- min_players = Ceiling(min_players * config.events_min_players_mul)
+ earliest_start = Ceiling(earliest_start * CONFIG_GET(number/events_min_time_mul))
+ min_players = Ceiling(min_players * CONFIG_GET(number/events_min_players_mul))
/datum/round_event_control/wizard
wizardevent = 1
diff --git a/code/modules/events/wizard/summons.dm b/code/modules/events/wizard/summons.dm
index dfdcd889ca..64778ae65d 100644
--- a/code/modules/events/wizard/summons.dm
+++ b/code/modules/events/wizard/summons.dm
@@ -6,7 +6,7 @@
earliest_start = 0
/datum/round_event_control/wizard/summonguns/New()
- if(config.no_summon_guns)
+ if(CONFIG_GET(flag/no_summon_guns))
weight = 0
..()
@@ -21,7 +21,7 @@
earliest_start = 0
/datum/round_event_control/wizard/summonmagic/New()
- if(config.no_summon_magic)
+ if(CONFIG_GET(flag/no_summon_magic))
weight = 0
..()
diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm
index 3c332b950c..26321c6dc8 100644
--- a/code/modules/hydroponics/grown/replicapod.dm
+++ b/code/modules/hydroponics/grown/replicapod.dm
@@ -55,7 +55,7 @@
var/obj/machinery/hydroponics/parent = loc
var/make_podman = 0
var/ckey_holder = null
- if(config.revival_pod_plants)
+ if(CONFIG_GET(flag/revival_pod_plants))
if(ckey)
for(var/mob/M in GLOB.player_list)
if(isobserver(M))
diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm
index f7679898d4..220fa2e9ac 100644
--- a/code/modules/jobs/job_exp.dm
+++ b/code/modules/jobs/job_exp.dm
@@ -6,13 +6,13 @@ GLOBAL_PROTECT(exp_to_update)
/datum/job/proc/required_playtime_remaining(client/C)
if(!C)
return 0
- if(!config.use_exp_tracking)
+ if(!CONFIG_GET(flag/use_exp_tracking))
return 0
if(!exp_requirements || !exp_type)
return 0
if(!job_is_xp_locked(src.title))
return 0
- if(config.use_exp_restrictions_admin_bypass && check_rights(R_ADMIN, FALSE, C.mob))
+ if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights(R_ADMIN, FALSE, C.mob))
return 0
var/isexempt = C.prefs.db_flags & DB_FLAG_EXEMPT
if(isexempt)
@@ -26,20 +26,21 @@ GLOBAL_PROTECT(exp_to_update)
/datum/job/proc/get_exp_req_amount()
if(title in GLOB.command_positions)
- if(config.use_exp_restrictions_heads_hours)
- return config.use_exp_restrictions_heads_hours * 60
+ var/uerhh = CONFIG_GET(number/use_exp_restrictions_heads_hours)
+ if(uerhh)
+ return uerhh * 60
return exp_requirements
/datum/job/proc/get_exp_req_type()
if(title in GLOB.command_positions)
- if(config.use_exp_restrictions_heads_department && exp_type_department)
+ if(CONFIG_GET(flag/use_exp_restrictions_heads_department) && exp_type_department)
return exp_type_department
return exp_type
/proc/job_is_xp_locked(jobtitle)
- if(!config.use_exp_restrictions_heads && jobtitle in GLOB.command_positions)
+ if(!CONFIG_GET(flag/use_exp_restrictions_heads) && jobtitle in GLOB.command_positions)
return FALSE
- if(!config.use_exp_restrictions_other && !(jobtitle in GLOB.command_positions))
+ if(!CONFIG_GET(flag/use_exp_restrictions_other) && !(jobtitle in GLOB.command_positions))
return FALSE
return TRUE
@@ -55,7 +56,7 @@ GLOBAL_PROTECT(exp_to_update)
return amount
/client/proc/get_exp_report()
- if(!config.use_exp_tracking)
+ if(!CONFIG_GET(flag/use_exp_tracking))
return "Tracking is disabled in the server configuration file."
var/list/play_records = prefs.exp
if(!play_records.len)
@@ -86,7 +87,7 @@ GLOBAL_PROTECT(exp_to_update)
return_text += "- [dep] [get_exp_format(exp_data[dep])] ([percentage]%)
"
else
return_text += "- [dep] [get_exp_format(exp_data[dep])]
"
- if(config.use_exp_restrictions_admin_bypass && check_rights(R_ADMIN, 0, mob))
+ if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights(R_ADMIN, 0, mob))
return_text += "- Admin (all jobs auto-unlocked)
"
return_text += ""
var/list/jobs_locked = list()
@@ -139,7 +140,7 @@ GLOBAL_PROTECT(exp_to_update)
//resets a client's exp to what was in the db.
/client/proc/set_exp_from_db()
- if(!config.use_exp_tracking)
+ if(!CONFIG_GET(flag/use_exp_tracking))
return -1
if(!SSdbcore.Connect())
return -1
@@ -181,7 +182,7 @@ GLOBAL_PROTECT(exp_to_update)
/client/proc/update_exp_list(minutes, announce_changes = FALSE)
- if(!config.use_exp_tracking)
+ if(!CONFIG_GET(flag/use_exp_tracking))
return -1
if(!SSdbcore.Connect())
return -1
diff --git a/code/modules/jobs/job_types/assistant.dm b/code/modules/jobs/job_types/assistant.dm
index 41c3cd0a94..26d57d1e76 100644
--- a/code/modules/jobs/job_types/assistant.dm
+++ b/code/modules/jobs/job_types/assistant.dm
@@ -1,42 +1,43 @@
-/*
-Assistant
-*/
-/datum/job/assistant
- title = "Assistant"
- flag = ASSISTANT
- department_flag = CIVILIAN
- faction = "Station"
- total_positions = -1
- spawn_positions = -1
- supervisors = "absolutely everyone"
- selection_color = "#dddddd"
- access = list() //See /datum/job/assistant/get_access()
- minimal_access = list() //See /datum/job/assistant/get_access()
- outfit = /datum/outfit/job/assistant
-
-
-/datum/job/assistant/get_access()
- if((config.jobs_have_maint_access & ASSISTANTS_HAVE_MAINT_ACCESS) || !config.jobs_have_minimal_access) //Config has assistant maint access set
- . = ..()
+/*
+Assistant
+*/
+/datum/job/assistant
+ title = "Assistant"
+ flag = ASSISTANT
+ department_flag = CIVILIAN
+ faction = "Station"
+ total_positions = -1
+ spawn_positions = -1
+ supervisors = "absolutely everyone"
+ selection_color = "#dddddd"
+ access = list() //See /datum/job/assistant/get_access()
+ minimal_access = list() //See /datum/job/assistant/get_access()
+ outfit = /datum/outfit/job/assistant
+
+
+/datum/job/assistant/get_access()
+ if(CONFIG_GET(flag/assistants_have_maint_access) || !CONFIG_GET(flag/jobs_have_minimal_access)) //Config has assistant maint access set
+ . = ..()
. |= list(ACCESS_MAINT_TUNNELS)
- else
- return ..()
-
-/datum/job/assistant/config_check()
- if(config && !(config.assistant_cap == 0))
- total_positions = config.assistant_cap
- spawn_positions = config.assistant_cap
- return 1
- return 0
-
-
-/datum/outfit/job/assistant
- name = "Assistant"
- jobtype = /datum/job/assistant
-
-/datum/outfit/job/assistant/pre_equip(mob/living/carbon/human/H)
- ..()
- if (config.grey_assistants)
- uniform = /obj/item/clothing/under/color/grey
- else
- uniform = /obj/item/clothing/under/color/random
+ else
+ return ..()
+
+/datum/job/assistant/config_check()
+ var/ac = CONFIG_GET(number/assistant_cap)
+ if(ac != 0)
+ total_positions = ac
+ spawn_positions = ac
+ return 1
+ return 0
+
+
+/datum/outfit/job/assistant
+ name = "Assistant"
+ jobtype = /datum/job/assistant
+
+/datum/outfit/job/assistant/pre_equip(mob/living/carbon/human/H)
+ ..()
+ if (CONFIG_GET(flag/grey_assistants))
+ uniform = /obj/item/clothing/under/color/grey
+ else
+ uniform = /obj/item/clothing/under/color/random
diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm
index 6b736db7fe..2e18807541 100644
--- a/code/modules/jobs/job_types/job.dm
+++ b/code/modules/jobs/job_types/job.dm
@@ -75,7 +75,7 @@
if(!visualsOnly && announce)
announce(H)
- if(config.enforce_human_authority && (title in GLOB.command_positions))
+ if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions))
H.dna.features["tail_human"] = "None"
H.dna.features["ears"] = "None"
H.regenerate_icons()
@@ -86,12 +86,12 @@
. = list()
- if(config.jobs_have_minimal_access)
+ if(CONFIG_GET(flag/jobs_have_minimal_access))
. = src.minimal_access.Copy()
else
. = src.access.Copy()
- if(config.jobs_have_maint_access & EVERYONE_HAS_MAINT_ACCESS) //Config has global maint access set
+ if(CONFIG_GET(flag/everyone_has_maint_access)) //Config has global maint access set
. |= list(ACCESS_MAINT_TUNNELS)
/datum/job/proc/announce_head(var/mob/living/carbon/human/H, var/channels) //tells the given channel that the given mob is the new department head. See communications.dm for valid channels.
@@ -109,7 +109,7 @@
/datum/job/proc/available_in_days(client/C)
if(!C)
return 0
- if(!config.use_age_restriction_for_jobs)
+ if(!CONFIG_GET(flag/use_age_restriction_for_jobs))
return 0
if(!isnum(C.player_age))
return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced
diff --git a/code/modules/jobs/job_types/security.dm b/code/modules/jobs/job_types/security.dm
index 67a705455c..442b75c972 100644
--- a/code/modules/jobs/job_types/security.dm
+++ b/code/modules/jobs/job_types/security.dm
@@ -1,6 +1,6 @@
//Warden and regular officers add this result to their get_access()
/datum/job/proc/check_config_for_sec_maint()
- if(config.jobs_have_maint_access & SECURITY_HAS_MAINT_ACCESS)
+ if(CONFIG_GET(flag/security_has_maint_access))
return list(ACCESS_MAINT_TUNNELS)
return list()
@@ -246,7 +246,7 @@ GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, S
W.access |= dep_access
var/teleport = 0
- if(!config.sec_start_brig)
+ if(!CONFIG_GET(flag/sec_start_brig))
if(destination || spawn_point)
teleport = 1
if(teleport)
diff --git a/code/modules/jobs/job_types/silicon.dm b/code/modules/jobs/job_types/silicon.dm
index 2e0a710d41..bc3b31b2bf 100644
--- a/code/modules/jobs/job_types/silicon.dm
+++ b/code/modules/jobs/job_types/silicon.dm
@@ -1,57 +1,55 @@
-/*
-AI
-*/
-/datum/job/ai
- title = "AI"
- flag = AI_JF
- department_flag = ENGSEC
- faction = "Station"
- total_positions = 0
- spawn_positions = 1
- selection_color = "#ccffcc"
- supervisors = "your laws"
- req_admin_notify = 1
- minimal_player_age = 30
+/*
+AI
+*/
+/datum/job/ai
+ title = "AI"
+ flag = AI_JF
+ department_flag = ENGSEC
+ faction = "Station"
+ total_positions = 0
+ spawn_positions = 1
+ selection_color = "#ccffcc"
+ supervisors = "your laws"
+ req_admin_notify = 1
+ minimal_player_age = 30
exp_requirements = 180
exp_type = EXP_TYPE_CREW
-
-/datum/job/ai/equip(mob/living/carbon/human/H)
- return H.AIize(FALSE)
-
-/datum/job/ai/after_spawn(mob/living/silicon/ai/AI, mob/M)
- AI.rename_self("ai", M.client)
-
- //we may have been created after our borg
- if(SSticker.current_state == GAME_STATE_SETTING_UP)
- for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs)
- if(!R.connected_ai)
- R.TryConnectToAI()
-
-
-/datum/job/ai/config_check()
- if(config && config.allow_ai)
- return 1
- return 0
-
-/*
-Cyborg
-*/
-/datum/job/cyborg
- title = "Cyborg"
- flag = CYBORG
- department_flag = ENGSEC
- faction = "Station"
- total_positions = 0
- spawn_positions = 1
- supervisors = "your laws and the AI" //Nodrak
- selection_color = "#ddffdd"
- minimal_player_age = 21
+
+/datum/job/ai/equip(mob/living/carbon/human/H)
+ return H.AIize(FALSE)
+
+/datum/job/ai/after_spawn(mob/living/silicon/ai/AI, mob/M)
+ AI.rename_self("ai", M.client)
+
+ //we may have been created after our borg
+ if(SSticker.current_state == GAME_STATE_SETTING_UP)
+ for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs)
+ if(!R.connected_ai)
+ R.TryConnectToAI()
+
+
+/datum/job/ai/config_check()
+ return CONFIG_GET(flag/allow_ai)
+
+/*
+Cyborg
+*/
+/datum/job/cyborg
+ title = "Cyborg"
+ flag = CYBORG
+ department_flag = ENGSEC
+ faction = "Station"
+ total_positions = 0
+ spawn_positions = 1
+ supervisors = "your laws and the AI" //Nodrak
+ selection_color = "#ddffdd"
+ minimal_player_age = 21
exp_requirements = 120
exp_type = EXP_TYPE_CREW
-
-/datum/job/cyborg/equip(mob/living/carbon/human/H)
- return H.Robotize(FALSE, FALSE)
-
-/datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M)
- if(config.rename_cyborg) //name can't be set in robot/New without the client
- R.rename_self("cyborg", M.client)
\ No newline at end of file
+
+/datum/job/cyborg/equip(mob/living/carbon/human/H)
+ return H.Robotize(FALSE, FALSE)
+
+/datum/job/cyborg/after_spawn(mob/living/silicon/robot/R, mob/M)
+ if(CONFIG_GET(flag/rename_cyborg)) //name can't be set in robot/New without the client
+ R.rename_self("cyborg", M.client)
diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm
index 8a6250403f..26b671dd96 100644
--- a/code/modules/mob/dead/dead.dm
+++ b/code/modules/mob/dead/dead.dm
@@ -11,7 +11,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
prepare_huds()
- if(config.cross_allowed)
+ if(CONFIG_GET(string/cross_server_address))
verbs += /mob/dead/proc/server_hop
return INITIALIZE_HINT_NORMAL
@@ -32,19 +32,20 @@ INITIALIZE_IMMEDIATE(/mob/dead)
set desc= "Jump to the other server"
if(notransform)
return
- if(!config.cross_allowed)
+ var/csa = CONFIG_GET(string/cross_server_address)
+ if(csa)
verbs -= /mob/dead/proc/server_hop
to_chat(src, "Server Hop has been disabled.")
return
- if (alert(src, "Jump to server running at [config.cross_address]?", "Server Hop", "Yes", "No") != "Yes")
+ if (alert(src, "Jump to server running at [csa]?", "Server Hop", "Yes", "No") != "Yes")
return 0
- if (client && config.cross_allowed)
- to_chat(src, "Sending you to [config.cross_address].")
+ if (client && csa)
+ to_chat(src, "Sending you to [csa].")
new /obj/screen/splash(client)
notransform = TRUE
sleep(29) //let the animation play
notransform = FALSE
winset(src, null, "command=.options") //other wise the user never knows if byond is downloading resources
- client << link(config.cross_address + "?server_hop=[key]")
+ client << link(csa + "?server_hop=[key]")
else
to_chat(src, "There is no other server configured!")
diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm
index 1e3561c8a0..b684e1ef28 100644
--- a/code/modules/mob/dead/new_player/login.dm
+++ b/code/modules/mob/dead/new_player/login.dm
@@ -1,5 +1,5 @@
/mob/dead/new_player/Login()
- if(config.use_exp_tracking)
+ if(CONFIG_GET(flag/use_exp_tracking))
client.set_exp_from_db()
client.set_db_player_flags()
if(!mind)
@@ -15,8 +15,9 @@
if(GLOB.admin_notice)
to_chat(src, "Admin Notice:\n \t [GLOB.admin_notice]")
- if(config.soft_popcap && living_player_count() >= config.soft_popcap)
- to_chat(src, "Server Notice:\n \t [config.soft_popcap_message]")
+ var/spc = CONFIG_GET(number/soft_popcap)
+ if(spc && living_player_count() >= spc)
+ to_chat(src, "Server Notice:\n \t [CONFIG_GET(string/soft_popcap_message)]")
sight |= SEE_TURFS
diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm
index 4ecf2845db..aca1d9b63f 100644
--- a/code/modules/mob/dead/new_player/new_player.dm
+++ b/code/modules/mob/dead/new_player/new_player.dm
@@ -97,10 +97,12 @@
//Determines Relevent Population Cap
var/relevant_cap
- if(config.hard_popcap && config.extreme_popcap)
- relevant_cap = min(config.hard_popcap, config.extreme_popcap)
+ var/hpc = CONFIG_GET(number/hard_popcap)
+ var/epc = CONFIG_GET(number/extreme_popcap)
+ if(hpc && epc)
+ relevant_cap = min(hpc, epc)
else
- relevant_cap = max(config.hard_popcap, config.extreme_popcap)
+ relevant_cap = max(hpc, epc)
if(href_list["show_preferences"])
client.prefs.ShowChoices(src)
@@ -133,7 +135,7 @@
return
if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in GLOB.admin_datums)))
- to_chat(usr, "[config.hard_popcap_message]")
+ to_chat(usr, "[CONFIG_GET(string/hard_popcap_message)]")
var/queue_position = SSticker.queued_players.Find(usr)
if(queue_position == 1)
@@ -309,7 +311,7 @@
return 0
if(job.required_playtime_remaining(client))
return 0
- if(config.enforce_human_authority && !client.prefs.pref_species.qualifies_for_rank(rank, client.prefs.features))
+ if(CONFIG_GET(flag/enforce_human_authority) && !client.prefs.pref_species.qualifies_for_rank(rank, client.prefs.features))
return 0
return 1
@@ -326,11 +328,11 @@
var/arrivals_docked = TRUE
if(SSshuttle.arrivals)
close_spawn_windows() //In case we get held up
- if(SSshuttle.arrivals.damaged && config.arrivals_shuttle_require_safe_latejoin)
+ if(SSshuttle.arrivals.damaged && CONFIG_GET(flag/arrivals_shuttle_require_safe_latejoin))
src << alert("The arrivals shuttle is currently malfunctioning! You cannot join.")
return FALSE
- if(config.arrivals_shuttle_require_undocked)
+ if(CONFIG_GET(flag/arrivals_shuttle_require_undocked))
SSshuttle.arrivals.RequireUndocked(src)
arrivals_docked = SSshuttle.arrivals.mode != SHUTTLE_CALL
@@ -374,7 +376,7 @@
GLOB.joined_player_list += character.ckey
GLOB.latejoiners += character
- if(config.allow_latejoin_antagonists && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais.
+ if(CONFIG_GET(flag/allow_latejoin_antagonists) && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais.
if(SSshuttle.emergency)
switch(SSshuttle.emergency.mode)
if(SHUTTLE_RECALL, SHUTTLE_IDLE)
@@ -458,7 +460,7 @@
var/mob/living/carbon/human/H = new(loc)
- if(config.force_random_names || jobban_isbanned(src, "appearance"))
+ if(CONFIG_GET(flag/force_random_names) || jobban_isbanned(src, "appearance"))
client.prefs.random_character()
client.prefs.real_name = client.prefs.pref_species.random_name(gender,1)
client.prefs.copy_to(H)
diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm
index 0a8dc6c733..cc98fd827e 100644
--- a/code/modules/mob/dead/new_player/preferences_setup.dm
+++ b/code/modules/mob/dead/new_player/preferences_setup.dm
@@ -14,7 +14,7 @@
facial_hair_color = hair_color
eye_color = random_eye_color()
if(!pref_species)
- var/rando_race = pick(config.roundstart_races)
+ var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races))
pref_species = new rando_race()
features = random_features()
age = rand(AGE_MIN,AGE_MAX)
diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm
index c437daef48..94ed0129c7 100644
--- a/code/modules/mob/living/brain/brain.dm
+++ b/code/modules/mob/living/brain/brain.dm
@@ -19,7 +19,7 @@
/mob/living/brain/proc/create_dna()
stored_dna = new /datum/dna/stored(src)
if(!stored_dna.species)
- var/rando_race = pick(config.roundstart_races)
+ var/rando_race = pick(CONFIG_GET(keyed_flag_list/roundstart_races))
stored_dna.species = new rando_race()
/mob/living/brain/Destroy()
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 0a325521b0..9d9e327fec 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -1,124 +1,126 @@
-/mob/living/carbon/alien/humanoid
- name = "alien"
- icon_state = "alien"
- pass_flags = PASSTABLE
- butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 5, /obj/item/stack/sheet/animalhide/xeno = 1)
- possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
- limb_destroyer = 1
- var/obj/item/r_store = null
- var/obj/item/l_store = null
- var/caste = ""
- var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
- var/leap_on_click = 0
- var/pounce_cooldown = 0
- var/pounce_cooldown_time = 30
- var/custom_pixel_x_offset = 0 //for admin fuckery.
- var/custom_pixel_y_offset = 0
- var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
- var/drooling = 0 //For Neruotoxic spit overlays
- bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
- /obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
- devourable = TRUE
-
-
-//This is fine right now, if we're adding organ specific damage this needs to be updated
-/mob/living/carbon/alien/humanoid/Initialize()
- AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
- . = ..()
-
-/mob/living/carbon/alien/humanoid/movement_delay()
- . = ..()
- . += move_delay_add + config.alien_delay + sneaking //move_delay_add is used to slow aliens with stun
-
-/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
- . = handcuffed
-
-
-/mob/living/carbon/alien/humanoid/show_inv(mob/user)
- user.set_machine(src)
- var/list/dat = list()
- dat += {"
-
- [name]
-
"}
- for(var/i in 1 to held_items.len)
- var/obj/item/I = get_item_for_held_index(i)
- dat += "
[get_held_index_name(i)]:[(I && !(I.flags_1 & ABSTRACT_1)) ? I : "Empty"]"
- dat += "
Empty Pouches"
-
- if(handcuffed)
- dat += "
Handcuffed"
- if(legcuffed)
- dat += "
Legcuffed"
-
- dat += {"
-
-
Close
- "}
- user << browse(dat.Join(), "window=mob\ref[src];size=325x500")
- onclose(user, "mob\ref[src]")
-
-
-/mob/living/carbon/alien/humanoid/Topic(href, href_list)
- ..()
- //strip panel
- if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
- if(href_list["pouches"])
- visible_message("[usr] tries to empty [src]'s pouches.", \
- "[usr] tries to empty [src]'s pouches.")
- if(do_mob(usr, src, POCKET_STRIP_DELAY * 0.5))
- dropItemToGround(r_store)
- dropItemToGround(l_store)
-
-/mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I)
- playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
- ..(I, cuff_break = INSTANT_CUFFBREAK)
-
-/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
- if(pulledby.grab_state)
- visible_message("[src] has broken free of [pulledby]'s grip!")
- pulledby.stop_pulling()
- . = 0
-
-/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
- if(leaping)
- return -32
- else if(custom_pixel_y_offset)
- return custom_pixel_y_offset
- else
- return initial(pixel_y)
-
-/mob/living/carbon/alien/humanoid/get_standard_pixel_x_offset(lying = 0)
- if(leaping)
- return -32
- else if(custom_pixel_x_offset)
- return custom_pixel_x_offset
- else
- return initial(pixel_x)
-
-/mob/living/carbon/alien/humanoid/get_permeability_protection()
- return 0.8
-
-/mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno)
- drop_all_held_items()
- for(var/atom/movable/A in stomach_contents)
- stomach_contents.Remove(A)
- new_xeno.stomach_contents.Add(A)
- A.loc = new_xeno
- ..()
-
-//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
-/proc/get_alien_type(var/alienpath)
- for(var/mob/living/carbon/alien/humanoid/A in GLOB.living_mob_list)
- if(!istype(A, alienpath))
- continue
- if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid.
- continue
- return A
- return FALSE
-
-
-/mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath)
- if(breath && breath.total_moles() > 0 && !sneaking)
- playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
- ..()
\ No newline at end of file
+/mob/living/carbon/alien/humanoid
+ name = "alien"
+ icon_state = "alien"
+ pass_flags = PASSTABLE
+ butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab/xeno = 5, /obj/item/stack/sheet/animalhide/xeno = 1)
+ possible_a_intents = list(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
+ limb_destroyer = 1
+ var/obj/item/r_store = null
+ var/obj/item/l_store = null
+ var/caste = ""
+ var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
+ var/leap_on_click = 0
+ var/pounce_cooldown = 0
+ var/pounce_cooldown_time = 30
+ var/custom_pixel_x_offset = 0 //for admin fuckery.
+ var/custom_pixel_y_offset = 0
+ var/sneaking = 0 //For sneaky-sneaky mode and appropriate slowdown
+ var/drooling = 0 //For Neruotoxic spit overlays
+ bodyparts = list(/obj/item/bodypart/chest/alien, /obj/item/bodypart/head/alien, /obj/item/bodypart/l_arm/alien,
+ /obj/item/bodypart/r_arm/alien, /obj/item/bodypart/r_leg/alien, /obj/item/bodypart/l_leg/alien)
+
+
+//This is fine right now, if we're adding organ specific damage this needs to be updated
+/mob/living/carbon/alien/humanoid/Initialize()
+ AddAbility(new/obj/effect/proc_holder/alien/regurgitate(null))
+ . = ..()
+
+/mob/living/carbon/alien/humanoid/movement_delay()
+ . = ..()
+ var/static/config_alien_delay
+ if(isnull(config_alien_delay))
+ config_alien_delay = CONFIG_GET(number/alien_delay)
+ . += move_delay_add + config_alien_delay + sneaking //move_delay_add is used to slow aliens with stun
+
+/mob/living/carbon/alien/humanoid/restrained(ignore_grab)
+ . = handcuffed
+
+
+/mob/living/carbon/alien/humanoid/show_inv(mob/user)
+ user.set_machine(src)
+ var/list/dat = list()
+ dat += {"
+
+ [name]
+
"}
+ for(var/i in 1 to held_items.len)
+ var/obj/item/I = get_item_for_held_index(i)
+ dat += "
[get_held_index_name(i)]:[(I && !(I.flags_1 & ABSTRACT_1)) ? I : "Empty"]"
+ dat += "
Empty Pouches"
+
+ if(handcuffed)
+ dat += "
Handcuffed"
+ if(legcuffed)
+ dat += "
Legcuffed"
+
+ dat += {"
+
+
Close
+ "}
+ user << browse(dat.Join(), "window=mob\ref[src];size=325x500")
+ onclose(user, "mob\ref[src]")
+
+
+/mob/living/carbon/alien/humanoid/Topic(href, href_list)
+ ..()
+ //strip panel
+ if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
+ if(href_list["pouches"])
+ visible_message("[usr] tries to empty [src]'s pouches.", \
+ "[usr] tries to empty [src]'s pouches.")
+ if(do_mob(usr, src, POCKET_STRIP_DELAY * 0.5))
+ dropItemToGround(r_store)
+ dropItemToGround(l_store)
+
+/mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I)
+ playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
+ ..(I, cuff_break = INSTANT_CUFFBREAK)
+
+/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
+ if(pulledby.grab_state)
+ visible_message("[src] has broken free of [pulledby]'s grip!")
+ pulledby.stop_pulling()
+ . = 0
+
+/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
+ if(leaping)
+ return -32
+ else if(custom_pixel_y_offset)
+ return custom_pixel_y_offset
+ else
+ return initial(pixel_y)
+
+/mob/living/carbon/alien/humanoid/get_standard_pixel_x_offset(lying = 0)
+ if(leaping)
+ return -32
+ else if(custom_pixel_x_offset)
+ return custom_pixel_x_offset
+ else
+ return initial(pixel_x)
+
+/mob/living/carbon/alien/humanoid/get_permeability_protection()
+ return 0.8
+
+/mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno)
+ drop_all_held_items()
+ for(var/atom/movable/A in stomach_contents)
+ stomach_contents.Remove(A)
+ new_xeno.stomach_contents.Add(A)
+ A.loc = new_xeno
+ ..()
+
+//For alien evolution/promotion/queen finder procs. Checks for an active alien of that type
+/proc/get_alien_type(var/alienpath)
+ for(var/mob/living/carbon/alien/humanoid/A in GLOB.living_mob_list)
+ if(!istype(A, alienpath))
+ continue
+ if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid.
+ continue
+ return A
+ return FALSE
+
+
+/mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath)
+ if(breath && breath.total_moles() > 0 && !sneaking)
+ playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5)
+ ..()
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 06f3007e6b..4fba96df58 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -1,8 +1,9 @@
/mob/living/carbon/human/movement_delay()
. = 0
- . += ..()
- . += config.human_delay
- . += dna.species.movement_delay(src)
+ var/static/config_human_delay
+ if(isnull(config_human_delay))
+ config_human_delay = CONFIG_GET(number/human_delay)
+ . += ..() + config_human_delay + dna.species.movement_delay(src)
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
if(isobj(shoes) && (shoes.flags_1&NOSLIP_1) && !(lube&GALOSHES_DONT_HELP))
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index 81e918e152..2fcfe97d65 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -62,7 +62,11 @@
if (bodytemperature < 283.222)
. += (283.222 - bodytemperature) / 10 * 1.75
- return . + config.monkey_delay
+
+ var/static/config_monkey_delay
+ if(isnull(config_monkey_delay))
+ config_monkey_delay = CONFIG_GET(number/monkey_delay)
+ . += config_monkey_delay
/mob/living/carbon/monkey/Stat()
..()
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index fccb3ab8dd..8401d92676 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -157,7 +157,7 @@
/mob/living/proc/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- bruteloss = Clamp((bruteloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ bruteloss = Clamp((bruteloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -168,7 +168,7 @@
/mob/living/proc/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- oxyloss = Clamp((oxyloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ oxyloss = Clamp((oxyloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -187,7 +187,7 @@
/mob/living/proc/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- toxloss = Clamp((toxloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ toxloss = Clamp((toxloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -206,7 +206,7 @@
/mob/living/proc/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- fireloss = Clamp((fireloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ fireloss = Clamp((fireloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -217,7 +217,7 @@
/mob/living/proc/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(!forced && (status_flags & GODMODE))
return FALSE
- cloneloss = Clamp((cloneloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ cloneloss = Clamp((cloneloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
if(updating_health)
updatehealth()
return amount
@@ -236,7 +236,7 @@
/mob/living/proc/adjustBrainLoss(amount)
if(status_flags & GODMODE)
return 0
- brainloss = Clamp((brainloss + (amount * config.damage_multiplier)), 0, maxHealth*2)
+ brainloss = Clamp((brainloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2)
/mob/living/proc/setBrainLoss(amount)
if(status_flags & GODMODE)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 1cf99e8d9e..2907389970 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -412,7 +412,7 @@
set category = "OOC"
set src in view()
- if(config.allow_Metadata)
+ if(CONFIG_GET(flag/allow_metadata))
if(client)
to_chat(src, "[src]'s Metainfo:
[client.prefs.metadata]")
else
@@ -464,16 +464,21 @@
if(isopenturf(loc) && !is_flying())
var/turf/open/T = loc
. += T.slowdown
+ var/static/config_run_delay
+ var/static/config_walk_delay
+ if(isnull(config_run_delay))
+ config_run_delay = CONFIG_GET(number/run_delay)
+ config_walk_delay = CONFIG_GET(number/walk_delay)
if(ignorewalk)
- . += config.run_speed
+ . += config_run_delay
else
switch(m_intent)
if(MOVE_INTENT_RUN)
if(drowsyness > 0)
. += 6
- . += config.run_speed
+ . += config_run_delay
if(MOVE_INTENT_WALK)
- . += config.walk_speed
+ . += config_walk_delay
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
if(!has_gravity())
diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm
index e148bd2763..8429889ebd 100644
--- a/code/modules/mob/living/silicon/ai/say.dm
+++ b/code/modules/mob/living/silicon/ai/say.dm
@@ -15,7 +15,7 @@
return "[radio_freq ? " (" + speaker.GetJob() + ")" : ""]" + "[speaker.GetSource() ? "" : ""]"
/mob/living/silicon/ai/IsVocal()
- return !config.silent_ai
+ return !CONFIG_GET(flag/silent_ai)
/mob/living/silicon/ai/radio(message, message_mode, list/spans, language)
if(incapacitated())
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index e264f00cf1..bd1493452f 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -211,9 +211,9 @@
"MediHound" = /obj/item/robot_module/medihound, \
"Security K9" = /obj/item/robot_module/k9, \
"Scrub Puppy" = /obj/item/robot_module/scrubpup)
- if(!config.forbid_peaceborg)
+ if(!CONFIG_GET(flag/disable_peaceborg))
modulelist["Peacekeeper"] = /obj/item/robot_module/peacekeeper
- if(!config.forbid_secborg)
+ if(!CONFIG_GET(flag/disable_secborg))
modulelist["Security"] = /obj/item/robot_module/security
var/input_module = input("Please, select a module!", "Robot", null, null) as null|anything in modulelist
diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm
index 167137d9d1..762d86dee9 100644
--- a/code/modules/mob/living/silicon/robot/robot_movement.dm
+++ b/code/modules/mob/living/silicon/robot/robot_movement.dm
@@ -5,8 +5,10 @@
/mob/living/silicon/robot/movement_delay()
. = ..()
- . += speed
- . += config.robot_delay
+ var/static/config_robot_delay
+ if(isnull(config_robot_delay))
+ config_robot_delay = CONFIG_GET(number/robot_delay)
+ . += speed + config_robot_delay
/mob/living/silicon/robot/mob_negates_gravity()
return magpulse
diff --git a/code/modules/mob/living/silicon/robot/say.dm b/code/modules/mob/living/silicon/robot/say.dm
index 866debc30e..910373e89b 100644
--- a/code/modules/mob/living/silicon/robot/say.dm
+++ b/code/modules/mob/living/silicon/robot/say.dm
@@ -1,2 +1,2 @@
/mob/living/silicon/robot/IsVocal()
- return !config.silent_borg
+ return !CONFIG_GET(flag/silent_borg)
diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm
index 01a30e9b04..5405ee03c6 100644
--- a/code/modules/mob/living/simple_animal/damage_procs.dm
+++ b/code/modules/mob/living/simple_animal/damage_procs.dm
@@ -9,33 +9,33 @@
/mob/living/simple_animal/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE)
if(forced)
- . = adjustHealth(amount * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
else if(damage_coeff[BRUTE])
- . = adjustHealth(amount * damage_coeff[BRUTE] * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * damage_coeff[BRUTE] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
/mob/living/simple_animal/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE)
if(forced)
- . = adjustHealth(amount * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
else if(damage_coeff[BURN])
- . = adjustHealth(amount * damage_coeff[BURN] * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * damage_coeff[BURN] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
/mob/living/simple_animal/adjustOxyLoss(amount, updating_health = TRUE, forced = FALSE)
if(forced)
- . = adjustHealth(amount * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
else if(damage_coeff[OXY])
- . = adjustHealth(amount * damage_coeff[OXY] * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * damage_coeff[OXY] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
/mob/living/simple_animal/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE)
if(forced)
- . = adjustHealth(amount * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
else if(damage_coeff[TOX])
- . = adjustHealth(amount * damage_coeff[TOX] * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * damage_coeff[TOX] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
/mob/living/simple_animal/adjustCloneLoss(amount, updating_health = TRUE, forced = FALSE)
if(forced)
- . = adjustHealth(amount * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * CONFIG_GET(number/damage_multiplier), updating_health, forced)
else if(damage_coeff[CLONE])
- . = adjustHealth(amount * damage_coeff[CLONE] * config.damage_multiplier, updating_health, forced)
+ . = adjustHealth(amount * damage_coeff[CLONE] * CONFIG_GET(number/damage_multiplier), updating_health, forced)
/mob/living/simple_animal/adjustStaminaLoss(amount)
return
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
index 8881eb5407..9900133723 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm
@@ -30,7 +30,7 @@
/obj/item/drone_shell/attack_ghost(mob/user)
if(jobban_isbanned(user,"drone"))
return
- if(config.use_age_restriction_for_jobs)
+ if(CONFIG_GET(flag/use_age_restriction_for_jobs))
if(!isnum(user.client.player_age)) //apparently what happens when there's no DB connected. just don't let anybody be a drone without admin intervention
return
if(user.client.player_age < DRONE_MINIMUM_AGE)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
index a80340c28a..3d2f7cf28e 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
@@ -130,7 +130,7 @@
if(admin_spawned)
return FALSE
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
for(var/mob/living/L in view(7,src))
if(L.stat)
continue
@@ -147,10 +147,10 @@
set waitfor = FALSE
if(!player || !medal)
return
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
- var/result = world.SetMedal(medal, player, global.medal_hub, global.medal_pass)
+ if(MedalsAvailable())
+ var/result = world.SetMedal(medal, player, CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
if(isnull(result))
- global.medals_enabled = FALSE
+ GLOB.medals_enabled = FALSE
log_game("MEDAL ERROR: Could not contact hub to award medal:[medal] player:[player.ckey]")
message_admins("Error! Failed to contact hub to award [medal] medal to [player.ckey]!")
else if (result)
@@ -161,9 +161,8 @@
set waitfor = FALSE
if(!score || !player)
return
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
var/list/oldscore = GetScore(score,player,1)
-
if(increment)
if(!oldscore[score])
oldscore[score] = 1
@@ -174,10 +173,10 @@
var/newscoreparam = list2params(oldscore)
- var/result = world.SetScores(player.ckey, newscoreparam, global.medal_hub, global.medal_pass)
+ var/result = world.SetScores(player.ckey, newscoreparam, CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
if(isnull(result))
- global.medals_enabled = FALSE
+ GLOB.medals_enabled = FALSE
log_game("SCORE ERROR: Could not contact hub to set score. Score:[score] player:[player.ckey]")
message_admins("Error! Failed to contact hub to set [score] score for [player.ckey]!")
@@ -186,11 +185,11 @@
if(!score || !player)
return
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
- var/scoreget = world.GetScores(player.ckey, score, global.medal_hub, global.medal_pass)
+ var/scoreget = world.GetScores(player.ckey, score, CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
if(isnull(scoreget))
- global.medals_enabled = FALSE
+ GLOB.medals_enabled = FALSE
log_game("SCORE ERROR: Could not contact hub to get score. Score:[score] player:[player.ckey]")
message_admins("Error! Failed to contact hub to get score: [score] for [player.ckey]!")
return
@@ -207,12 +206,12 @@
if(!player || !medal)
return
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
- var/result = world.GetMedal(medal, player, global.medal_hub, global.medal_pass)
+ var/result = world.GetMedal(medal, player, CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
if(isnull(result))
- global.medals_enabled = FALSE
+ GLOB.medals_enabled = FALSE
log_game("MEDAL ERROR: Could not contact hub to get medal:[medal] player:[player.ckey]")
message_admins("Error! Failed to contact hub to get [medal] medal for [player.ckey]!")
else if (result)
@@ -222,12 +221,12 @@
if(!player || !medal)
return
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
- var/result = world.ClearMedal(medal, player, global.medal_hub, global.medal_pass)
+ var/result = world.ClearMedal(medal, player, CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
if(isnull(result))
- global.medals_enabled = FALSE
+ GLOB.medals_enabled = FALSE
log_game("MEDAL ERROR: Could not contact hub to clear medal:[medal] player:[player.ckey]")
message_admins("Error! Failed to contact hub to clear [medal] medal for [player.ckey]!")
else if (result)
@@ -237,6 +236,9 @@
/proc/ClearScore(client/player)
- world.SetScores(player.ckey, "", global.medal_hub, global.medal_pass)
+ world.SetScores(player.ckey, "", CONFIG_GET(string/medal_hub_address), CONFIG_GET(string/medal_hub_password))
+
+/proc/MedalsAvailable()
+ return CONFIG_GET(string/medal_hub_address) && CONFIG_GET(string/medal_hub_password) && GLOB.medals_enabled
#undef MEDAL_PREFIX
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm
index 5a3672af6d..d5d116d678 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/necropolis_tendril.dm
@@ -55,7 +55,7 @@
last_tendril = FALSE
break
if(last_tendril && !admin_spawned)
- if(global.medal_hub && global.medal_pass && global.medals_enabled)
+ if(MedalsAvailable())
for(var/mob/living/L in view(7,src))
if(L.stat)
continue
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index 144fec4a4a..5467aad549 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -275,7 +275,10 @@
. = speed
- . += config.animal_delay
+ var/static/config_animal_delay
+ if(isnull(config_animal_delay))
+ config_animal_delay = CONFIG_GET(number/animal_delay)
+ . += config_animal_delay
/mob/living/simple_animal/Stat()
..()
diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm
index 6026a86724..a3c37e9889 100644
--- a/code/modules/mob/living/simple_animal/slime/life.dm
+++ b/code/modules/mob/living/simple_animal/slime/life.dm
@@ -234,7 +234,7 @@
Feedstop(0, 0)
return
- add_nutrition((rand(7,15) * config.damage_multiplier))
+ add_nutrition((rand(7, 15) * CONFIG_GET(number/damage_multiplier)))
//Heal yourself.
adjustBruteLoss(-3)
diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm
index 0e7d7a157e..92d64702bb 100644
--- a/code/modules/mob/living/simple_animal/slime/slime.dm
+++ b/code/modules/mob/living/simple_animal/slime/slime.dm
@@ -146,7 +146,10 @@
if(health <= 0) // if damaged, the slime moves twice as slow
. *= 2
- . += config.slime_delay
+ var/static/config_slime_delay
+ if(isnull(config_slime_delay))
+ config_slime_delay = CONFIG_GET(number/slime_delay)
+ . += config_slime_delay
/mob/living/simple_animal/slime/ObjCollide(obj/O)
if(!client && powerlevel > 0)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index f768cbe2d2..df99f53e88 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -436,7 +436,7 @@
set name = "Respawn"
set category = "OOC"
- if (!( GLOB.abandon_allowed ))
+ if (CONFIG_GET(flag/norespawn))
return
if ((stat != DEAD || !( SSticker )))
to_chat(usr, "You must be dead to use this!")
diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm
index f9763cde7d..a543e0825b 100644
--- a/code/modules/mob/transform_procs.dm
+++ b/code/modules/mob/transform_procs.dm
@@ -383,7 +383,7 @@
else if(transfer_after)
R.key = key
- if (config.rename_cyborg)
+ if (CONFIG_GET(flag/rename_cyborg))
R.rename_self("cyborg")
if(R.mmi)
diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm
index 5dd6d16d54..ead6a35eea 100644
--- a/code/modules/modular_computers/file_system/programs/card.dm
+++ b/code/modules/modular_computers/file_system/programs/card.dm
@@ -44,7 +44,7 @@
addtimer(CALLBACK(src, .proc/SetConfigCooldown), 0)
/datum/computer_file/program/card_mod/proc/SetConfigCooldown()
- change_position_cooldown = config.id_console_jobslot_delay
+ change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
/datum/computer_file/program/card_mod/event_idremoved(background, slot)
if(!slot || slot == 2)// slot being false means both are removed
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index e18ac0ab5c..84db583282 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -280,7 +280,7 @@
if(can_hit_target(original, permutated))
Collide(original)
Range()
- sleep(config.run_speed * 0.9)
+ sleep(CONFIG_GET(number/run_delay) * 0.9)
//Returns true if the target atom is on our current turf and above the right layer
/obj/item/projectile/proc/can_hit_target(atom/target, var/list/passthrough)
diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm
index 8c4f80b772..6571ab79b5 100644
--- a/code/modules/projectiles/projectile/magic.dm
+++ b/code/modules/projectiles/projectile/magic.dm
@@ -276,7 +276,9 @@
to_chat(new_mob, "Your form morphs into that of a [randomize].")
- to_chat(new_mob, config.policies["polymorph"])
+ var/poly_msg = CONFIG_GET(keyed_string_list/policy)["polymorph"]
+ if(poly_msg)
+ to_chat(new_mob, poly_msg)
qdel(M)
return new_mob
diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm
index 1fa3e89d3a..a145028ad3 100644
--- a/code/modules/security_levels/security_levels.dm
+++ b/code/modules/security_levels/security_levels.dm
@@ -21,7 +21,7 @@ GLOBAL_VAR_INIT(security_level, 0)
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
switch(level)
if(SEC_LEVEL_GREEN)
- minor_announce(config.alert_desc_green, "Attention! Security level lowered to green:")
+ minor_announce(CONFIG_GET(string/alert_green), "Attention! Security level lowered to green:")
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
if(GLOB.security_level >= SEC_LEVEL_RED)
SSshuttle.emergency.modTimer(4)
@@ -33,11 +33,11 @@ GLOBAL_VAR_INIT(security_level, 0)
FA.update_icon()
if(SEC_LEVEL_BLUE)
if(GLOB.security_level < SEC_LEVEL_BLUE)
- minor_announce(config.alert_desc_blue_upto, "Attention! Security level elevated to blue:",1)
+ minor_announce(CONFIG_GET(string/alert_blue_upto), "Attention! Security level elevated to blue:",1)
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
SSshuttle.emergency.modTimer(0.5)
else
- minor_announce(config.alert_desc_blue_downto, "Attention! Security level lowered to blue:")
+ minor_announce(CONFIG_GET(string/alert_blue_downto), "Attention! Security level lowered to blue:")
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
SSshuttle.emergency.modTimer(2)
GLOB.security_level = SEC_LEVEL_BLUE
@@ -47,14 +47,14 @@ GLOBAL_VAR_INIT(security_level, 0)
FA.update_icon()
if(SEC_LEVEL_RED)
if(GLOB.security_level < SEC_LEVEL_RED)
- minor_announce(config.alert_desc_red_upto, "Attention! Code red!",1)
+ minor_announce(CONFIG_GET(string/alert_red_upto), "Attention! Code red!",1)
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
if(GLOB.security_level == SEC_LEVEL_GREEN)
SSshuttle.emergency.modTimer(0.25)
else
SSshuttle.emergency.modTimer(0.5)
else
- minor_announce(config.alert_desc_red_downto, "Attention! Code red!")
+ minor_announce(CONFIG_GET(string/alert_red_downto), "Attention! Code red!")
GLOB.security_level = SEC_LEVEL_RED
/* - At the time of commit, setting status displays didn't work properly
@@ -68,7 +68,7 @@ GLOBAL_VAR_INIT(security_level, 0)
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
pod.admin_controlled = 0
if(SEC_LEVEL_DELTA)
- minor_announce(config.alert_desc_delta, "Attention! Delta security level reached!",1)
+ minor_announce(CONFIG_GET(string/alert_delta), "Attention! Delta security level reached!",1)
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
if(GLOB.security_level == SEC_LEVEL_GREEN)
SSshuttle.emergency.modTimer(0.25)
diff --git a/code/modules/server_tools/server_tools.dm b/code/modules/server_tools/server_tools.dm
index f16a56b2f9..9cacb4542f 100644
--- a/code/modules/server_tools/server_tools.dm
+++ b/code/modules/server_tools/server_tools.dm
@@ -77,7 +77,8 @@ GLOBAL_PROTECT(reboot_mode)
if(rtod - last_irc_status < IRC_STATUS_THROTTLE)
return
last_irc_status = rtod
- return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [config.server ? config.server : "[world.internet_address]:[world.port]"]"
+ var/config_server = CONFIG_GET(string/server)
+ return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [config_server ? config_server : "[world.internet_address]:[world.port]"]"
if(SERVICE_CMD_ADMIN_MSG)
return IrcPm(params[SERVICE_CMD_PARAM_TARGET], params[SERVICE_CMD_PARAM_MESSAGE], params[SERVICE_CMD_PARAM_SENDER])
diff --git a/code/modules/shuttle/arrivals.dm b/code/modules/shuttle/arrivals.dm
index 16aa279901..b42ee4e0e4 100644
--- a/code/modules/shuttle/arrivals.dm
+++ b/code/modules/shuttle/arrivals.dm
@@ -130,7 +130,7 @@
return FALSE
/obj/docking_port/mobile/arrivals/proc/SendToStation()
- var/dockTime = config.arrivals_shuttle_dock_window
+ var/dockTime = CONFIG_GET(number/arrivals_shuttle_dock_window)
if(mode == SHUTTLE_CALL && timeLeft(1) > dockTime)
if(console)
console.say(damaged ? "Initiating emergency docking for repairs!" : "Now approaching: [station_name()].")
diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm
index b239e39576..f05a3a7e42 100644
--- a/code/modules/surgery/bodyparts/bodyparts.dm
+++ b/code/modules/surgery/bodyparts/bodyparts.dm
@@ -108,8 +108,9 @@
/obj/item/bodypart/proc/receive_damage(brute, burn, updating_health = 1)
if(owner && (owner.status_flags & GODMODE))
return 0 //godmode
- brute = max(brute * config.damage_multiplier,0)
- burn = max(burn * config.damage_multiplier,0)
+ var/dmg_mlt = CONFIG_GET(number/damage_multiplier)
+ brute = max(brute * dmg_mlt, 0)
+ burn = max(burn * dmg_mlt, 0)
if(status == BODYPART_ROBOTIC) //This makes robolimbs not damageable by chems and makes it stronger
diff --git a/config/config.txt b/config/config.txt
index 80a587885b..079ec0d9c6 100644
--- a/config/config.txt
+++ b/config/config.txt
@@ -300,8 +300,11 @@ ALLOW_MAP_VOTING 1
#MAPROTATIONCHANCEDELTA 0.75
## AUTOADMIN
+## The default admin rank
+AUTOADMIN_RANK Game Master
+
## Uncomment to automatically give that admin rank to all players
-#AUTOADMIN Game Admin
+#AUTOADMIN
## GENERATE_MINIMAPS
## Generating minimaps(For crew monitor) is slow and bogs down testing, so its disabled by default and must be enabled by uncommenting this config if you are running a production server.
diff --git a/config/game_options.txt b/config/game_options.txt
index b609f8b582..77e33fa873 100644
--- a/config/game_options.txt
+++ b/config/game_options.txt
@@ -85,7 +85,6 @@ PROBABILITY REVOLUTION 2
PROBABILITY CULT 2
PROBABILITY CHANGELING 2
PROBABILITY WIZARD 4
-PROBABILITY MALFUNCTION 1
PROBABILITY BLOB 2
PROBABILITY RAGINMAGES 2
PROBABILITY MONKEY 0
@@ -115,7 +114,6 @@ CONTINUOUS CULT
CONTINUOUS CLOCKWORK_CULT
CONTINUOUS CHANGELING
CONTINUOUS WIZARD
-CONTINUOUS MALFUNCTION
CONTINUOUS BLOB
CONTINUOUS ABDUCTION
#CONTINUOUS RAGINMAGES
@@ -141,7 +139,6 @@ MIDROUND_ANTAG CULT
MIDROUND_ANTAG CLOCKWORK_CULT
MIDROUND_ANTAG CHANGELING
MIDROUND_ANTAG WIZARD
-MIDROUND_ANTAG MALFUNCTION
MIDROUND_ANTAG BLOB
MIDROUND_ANTAG ABDUCTION
#MIDROUND_ANTAG RAGINMAGES
@@ -486,7 +483,7 @@ LAVALAND_BUDGET 60
Space_Budget 16
## Time in ds from when a player latejoins till the arrival shuttle docks at the station
-## Must be at least 30 to not break parallax I recommended at least 55 to be visually/aurally appropriate
+## Must be at least 30. At least 55 recommended to be visually/aurally appropriate
ARRIVALS_SHUTTLE_DOCK_WINDOW 55
## Uncomment to require the arrivals shuttle to be in flight (if it can fly) before late join players can join
diff --git a/interface/interface.dm b/interface/interface.dm
index 9ee5309585..9d420e9821 100644
--- a/interface/interface.dm
+++ b/interface/interface.dm
@@ -3,12 +3,13 @@
set name = "wiki"
set desc = "Type what you want to know about. This will open the wiki in your web browser. Type nothing to go to the main page."
set hidden = 1
- if(config.wikiurl)
+ var/wikiurl = CONFIG_GET(string/wikiurl)
+ if(wikiurl)
if(query)
- var/output = config.wikiurl + "/index.php?title=Special%3ASearch&profile=default&search=" + query
+ var/output = wikiurl + "/index.php?title=Special%3ASearch&profile=default&search=" + query
src << link(output)
else if (query != null)
- src << link(config.wikiurl)
+ src << link(wikiurl)
else
to_chat(src, "The wiki URL is not set in the server configuration.")
return
@@ -17,10 +18,11 @@
set name = "forum"
set desc = "Visit the forum."
set hidden = 1
- if(config.forumurl)
+ var/forumurl = CONFIG_GET(string/forumurl)
+ if(forumurl)
if(alert("This will open the forum in your browser. Are you sure?",,"Yes","No")=="No")
return
- src << link(config.forumurl)
+ src << link(forumurl)
else
to_chat(src, "The forum URL is not set in the server configuration.")
return
@@ -29,10 +31,11 @@
set name = "rules"
set desc = "Show Server Rules."
set hidden = 1
- if(config.rulesurl)
+ var/rulesurl = CONFIG_GET(string/rulesurl)
+ if(rulesurl)
if(alert("This will open the rules in your browser. Are you sure?",,"Yes","No")=="No")
return
- src << link(config.rulesurl)
+ src << link(rulesurl)
else
to_chat(src, "The rules URL is not set in the server configuration.")
return
@@ -41,10 +44,11 @@
set name = "github"
set desc = "Visit Github"
set hidden = 1
- if(config.githuburl)
+ var/githuburl = CONFIG_GET(string/githuburl)
+ if(githuburl)
if(alert("This will open the Github repository in your browser. Are you sure?",,"Yes","No")=="No")
return
- src << link(config.githuburl)
+ src << link(githuburl)
else
to_chat(src, "The Github URL is not set in the server configuration.")
return
@@ -53,14 +57,15 @@
set name = "report-issue"
set desc = "Report an issue"
set hidden = 1
- if(config.githuburl)
+ var/githuburl = CONFIG_GET(string/githuburl)
+ if(githuburl)
var/message = "This will open the Github issue reporter in your browser. Are you sure?"
if(GLOB.revdata.testmerge.len)
message += "
The following experimental changes are active and are probably the cause of any new or sudden issues you may experience. If possible, please try to find a specific thread for your issue instead of posting to the general issue tracker:
"
message += GLOB.revdata.GetTestMergeInfo(FALSE)
if(tgalert(src, message, "Report Issue","Yes","No")=="No")
return
- src << link("[config.githuburl]/issues/new")
+ src << link("[githuburl]/issues/new")
else
to_chat(src, "The Github URL is not set in the server configuration.")
return
diff --git a/tgstation.dme b/tgstation.dme
index 71100ec838..00948c2c45 100755
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -28,11 +28,12 @@
#include "code\__DEFINES\atmospherics.dm"
#include "code\__DEFINES\atom_hud.dm"
#include "code\__DEFINES\callbacks.dm"
-#include "code\__DEFINES\citadel_defines.dm"
#include "code\__DEFINES\cinematics.dm"
+#include "code\__DEFINES\citadel_defines.dm"
#include "code\__DEFINES\clockcult.dm"
#include "code\__DEFINES\combat.dm"
#include "code\__DEFINES\components.dm"
+#include "code\__DEFINES\configuration.dm"
#include "code\__DEFINES\construction.dm"
#include "code\__DEFINES\contracts.dm"
#include "code\__DEFINES\cult.dm"
@@ -112,7 +113,6 @@
#include "code\_globalvars\genetics.dm"
#include "code\_globalvars\logging.dm"
#include "code\_globalvars\misc.dm"
-#include "code\_globalvars\sensitive.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
#include "code\_globalvars\lists\maintenance_loot.dm"
#include "code\_globalvars\lists\mapping.dm"
@@ -189,7 +189,6 @@
#include "code\citadel\organs\womb.dm"
#include "code\citadel\toys\dildos.dm"
#include "code\controllers\admin.dm"
-#include "code\controllers\configuration.dm"
#include "code\controllers\configuration_citadel.dm"
#include "code\controllers\controller.dm"
#include "code\controllers\failsafe.dm"
@@ -197,6 +196,12 @@
#include "code\controllers\hooks.dm"
#include "code\controllers\master.dm"
#include "code\controllers\subsystem.dm"
+#include "code\controllers\configuration\config_entry.dm"
+#include "code\controllers\configuration\configuration.dm"
+#include "code\controllers\configuration\entries\comms.dm"
+#include "code\controllers\configuration\entries\config.dm"
+#include "code\controllers\configuration\entries\dbconfig.dm"
+#include "code\controllers\configuration\entries\game_options.dm"
#include "code\controllers\subsystem\acid.dm"
#include "code\controllers\subsystem\air.dm"
#include "code\controllers\subsystem\assets.dm"
@@ -2284,9 +2289,9 @@
#include "code\modules\VR\vr_sleeper.dm"
#include "code\modules\zombie\items.dm"
#include "code\modules\zombie\organs.dm"
-#include "modular_citadel\cit_screenshake.dm"
#include "interface\interface.dm"
#include "interface\menu.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"
+#include "modular_citadel\cit_screenshake.dm"
// END_INCLUDE