Merge pull request #15980 from AffectedArc07/toml-config

[READY] Converts configs to use TOML + Configuration refactor
This commit is contained in:
variableundefined
2021-07-25 08:26:29 -04:00
committed by GitHub
193 changed files with 2577 additions and 2858 deletions
+1 -1
View File
@@ -116,7 +116,7 @@
return
if(!src.client.holder)
if(!config.dsay_allowed)
if(!GLOB.dsay_enabled)
to_chat(src, "<span class='warning'>Deadchat is globally muted</span>")
return
@@ -126,7 +126,7 @@
/mob/living/carbon/alien/movement_delay()
. = ..()
. += move_delay_add + config.alien_delay //move_delay_add is used to slow aliens with stuns
. += move_delay_add + GLOB.configuration.movement.alien_delay //move_delay_add is used to slow aliens with stuns
/mob/living/carbon/alien/getDNA()
return null
@@ -99,7 +99,7 @@
new_xeno.mind.assigned_role = SPECIAL_ROLE_XENOMORPH
new_xeno.mind.special_role = SPECIAL_ROLE_XENOMORPH
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
to_chat(new_xeno, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Xenomorph)</span>")
to_chat(new_xeno, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Xenomorph)</span>")
if(gib_on_success)
owner.gib()
+1 -1
View File
@@ -13,7 +13,7 @@
/mob/living/carbon/brain/Life()
. = ..()
if(.)
if(!container && (world.time - timeofhostdeath) > config.revival_brain_life)
if(!container && (world.time - timeofhostdeath) > GLOB.configuration.general.revival_brain_life)
death()
/mob/living/carbon/brain/breathe()
-2
View File
@@ -1130,8 +1130,6 @@ so that different stomachs can handle things in different ways VB*/
//to recalculate and update the mob's total tint from tinted equipment it's wearing.
/mob/living/carbon/proc/update_tint()
if(!GLOB.tinted_weldhelh)
return
var/tinttotal = get_total_tint()
if(tinttotal >= TINT_BLIND)
overlay_fullscreen("tint", /obj/screen/fullscreen/blind)
@@ -320,7 +320,7 @@
for(var/current_species_name in GLOB.all_species)
var/datum/species/current_species = GLOB.all_species[current_species_name]
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
if(check_whitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
if(whitelist.len && !(current_species_name in whitelist))
continue
if(blacklist.len && (current_species_name in blacklist))
@@ -1942,3 +1942,16 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
runechat_msg_location = loc
else
runechat_msg_location = src
/mob/living/carbon/human/verb/Examine_OOC()
set name = "Examine Meta-Info (OOC)"
set category = "OOC"
set src in view()
if(GLOB.configuration.general.allow_character_metadata)
if(client)
to_chat(usr, "[src]'s Metainfo:<br>[sanitize(client.prefs.metadata)]")
else
to_chat(usr, "[src] does not have any stored infomation!")
else
to_chat(usr, "OOC Metadata is not supported by this server!")
@@ -1,7 +1,7 @@
/mob/living/carbon/human/movement_delay()
. = 0
. += ..()
. += config.human_delay
. += GLOB.configuration.movement.human_delay
. += dna.species.movement_delay(src)
/mob/living/carbon/human/Process_Spacemove(movement_dir = 0)
+1 -1
View File
@@ -61,7 +61,7 @@
player_logged++
if(istype(loc, /obj/machinery/cryopod))
return
if(config.auto_cryo_ssd_mins && (player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0)
if(GLOB.configuration.afk.ssd_auto_cryo_minutes && (player_logged >= (GLOB.configuration.afk.ssd_auto_cryo_minutes * 30)) && player_logged % 30 == 0)
var/turf/T = get_turf(src)
if(!is_station_level(T.z))
return
@@ -129,17 +129,11 @@
if((head_organ.dna.species.name in tmp_hair.species_allowed) && (robohead.company in tmp_hair.models_allowed)) //Populate the list of available monitor styles only with styles that the monitor-head is allowed to use.
hair += i
var/file = file2text("config/custom_sprites.txt") //Pulls up the custom_sprites list
var/lines = splittext(file, "\n")
for(var/line in lines) // Looks for lines set up as screen:ckey:screen_name
var/list/Entry = splittext(line, ":") // split lines
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i]) // Cleans up lines
if(Entry.len != 3 || Entry[1] != "screen") // Ignore entries that aren't for screens
continue
if(Entry[2] == H.ckey) // They're in the list? Custom sprite time, var and icon change required
hair += Entry[3] // Adds custom screen to list
if(H.ckey in GLOB.configuration.custom_sprites.ipc_screen_map)
// key: ckey | value: list of icon states
for(var/style in GLOB.configuration.custom_sprites.ipc_screen_map[H.ckey])
hair += style
var/new_style = input(H, "Select a monitor display", "Monitor Display", head_organ.h_style) as null|anything in hair
var/new_color = input("Please select hair color.", "Monitor Color", head_organ.hair_colour) as null|color
+3 -19
View File
@@ -519,22 +519,6 @@
/mob/living/proc/UpdateDamageIcon()
return
/mob/living/proc/Examine_OOC()
set name = "Examine Meta-Info (OOC)"
set category = "OOC"
set src in view()
if(config.allow_Metadata)
if(client)
to_chat(usr, "[src]'s Metainfo:<br>[client.prefs.metadata]")
else
to_chat(usr, "[src] does not have any stored infomation!")
else
to_chat(usr, "OOC Metadata is not supported by this server!")
return
/mob/living/Move(atom/newloc, direct, movetime)
if(buckled && buckled.loc != newloc) //not updating position
if(!buckled.anchored)
@@ -928,15 +912,15 @@
if(forced_look)
. += 3
if(ignorewalk)
. += config.run_speed
. += GLOB.configuration.movement.base_run_speed
else
switch(m_intent)
if(MOVE_INTENT_RUN)
if(drowsyness > 0)
. += 6
. += config.run_speed
. += GLOB.configuration.movement.base_run_speed
if(MOVE_INTENT_WALK)
. += config.walk_speed
. += GLOB.configuration.movement.base_walk_speed
/mob/living/proc/can_use_guns(obj/item/gun/G)
+6 -30
View File
@@ -365,20 +365,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(stat || aiRestorePowerRoutine)
return
if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var
var/file = file2text("config/custom_sprites.txt")
var/lines = splittext(file, "\n")
for(var/line in lines)
// split & clean up
var/list/Entry = splittext(line, ":")
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i])
if(Entry.len < 2 || Entry[1] != "ai") //ignore incorrectly formatted entries or entries that aren't marked for AI
continue
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
custom_sprite = 1
if(ckey in GLOB.configuration.custom_sprites.ai_core_ckeys)
custom_sprite = TRUE
var/display_choices = list(
"Monochrome",
@@ -963,21 +951,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(check_unable())
return
if(!custom_hologram) //Check to see if custom sprite time, checking the appopriate file to change a var
var/file = file2text("config/custom_sprites.txt")
var/lines = splittext(file, "\n")
for(var/line in lines)
// split & clean up
var/list/Entry = splittext(line, ":")
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i])
if(Entry.len < 2 || Entry[1] != "hologram")
continue
if (Entry[2] == ckey) //Custom holograms
custom_hologram = 1 // option is given in hologram menu
if(!custom_hologram)
if(ckey in GLOB.configuration.custom_sprites.ai_hologram_ckeys)
custom_hologram = TRUE
var/input
switch(alert("Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?",,"Crew Member","Unique","Animal"))
@@ -1319,7 +1295,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/proc/open_nearest_door(mob/living/target)
if(!istype(target))
return
if(check_unable(AI_CHECK_WIRELESS))
return
+4 -5
View File
@@ -125,11 +125,10 @@
laws.sort_laws()
/mob/living/silicon/proc/make_laws()
switch(config.default_laws)
if(0)
laws = new /datum/ai_laws/crewsimov()
else
laws = get_random_lawset()
if(GLOB.configuration.general.random_ai_lawset)
laws = get_random_lawset()
else
laws = new /datum/ai_laws/crewsimov()
/mob/living/silicon/proc/get_random_lawset()
var/list/law_options[0]
+4 -16
View File
@@ -122,7 +122,7 @@
. = ..()
. += slowdown
. += 1 //A bit slower than humans, so they're easier to smash
. += config.robot_delay
. += GLOB.configuration.movement.robot_delay
/mob/living/silicon/pai/update_icons()
if(stat == DEAD)
@@ -286,21 +286,9 @@
//check for custom_sprite
if(!custom_sprite)
var/file = file2text("config/custom_sprites.txt")
var/lines = splittext(file, "\n")
for(var/line in lines)
// split & clean up
var/list/Entry = splittext(line, ":")
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i])
if(Entry.len < 2 || Entry[1] != "pai") //ignore incorrectly formatted entries or entries that aren't marked for pAI
continue
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
custom_sprite = 1
my_choices["Custom"] = "[ckey]-pai"
if(ckey in GLOB.configuration.custom_sprites.pai_holoform_ckeys)
custom_sprite = TRUE
my_choices["Custom"] = "[ckey]-pai"
my_choices = possible_chassis.Copy()
if(custom_sprite)
@@ -49,35 +49,6 @@
else
..()
/mob/living/silicon/robot/drone/verb/customize()
set name = "Customize Chassis"
set desc = "Reconfigure your chassis into a customized version."
set category = "Drone"
if(!custom_sprite) //Check to see if custom sprite time, checking the appopriate file to change a var
var/file = file2text("config/custom_sprites.txt")
var/lines = splittext(file, "\n")
for(var/line in lines)
// split & clean up
var/list/Entry = splittext(line, ":")
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i])
if(Entry.len < 2 || Entry[1] != "drone")
continue
if (Entry[2] == ckey) //Custom holograms
custom_sprite = 1 // option is given in hologram menu
if(!custom_sprite)
to_chat(src, "<span class='warning'>Error 404: Custom chassis not found. Revoking customization option.</span>")
else
icon = 'icons/mob/custom_synthetic/custom-synthetic.dmi'
icon_state = "[ckey]-drone"
to_chat(src, "<span class='notice'>You reconfigure your chassis and improve the station through your new aesthetics.</span>")
verbs -= /mob/living/silicon/robot/drone/verb/customize
/mob/living/silicon/robot/drone/get_scooped(mob/living/carbon/grabber)
var/obj/item/holder/H = ..()
if(!istype(H))
@@ -1,3 +1,6 @@
#define DRONE_BUILD_TIME 2 MINUTES
#define MAX_MAINT_DRONES 5
/obj/machinery/drone_fabricator
name = "drone fabricator"
desc = "A large automated factory for producing maintenance drones."
@@ -37,14 +40,14 @@
icon_state = "drone_fab_active"
var/elapsed = world.time - time_last_drone
drone_progress = clamp(round((elapsed / config.drone_build_time) * 100), 0, 100)
drone_progress = clamp(round((elapsed / DRONE_BUILD_TIME) * 100), 0, 100)
if(drone_progress >= 100)
visible_message("[src] voices a strident beep, indicating a drone chassis is prepared.")
/obj/machinery/drone_fabricator/examine(mob/user)
. = ..()
if(produce_drones && drone_progress >= 100 && isobserver(user) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
if(produce_drones && drone_progress >= 100 && isobserver(user) && count_drones() < MAX_MAINT_DRONES)
. += "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
/obj/machinery/drone_fabricator/proc/count_drones()
@@ -58,7 +61,7 @@
if(stat & NOPOWER)
return
if(!produce_drones || !config.allow_drone_spawn || count_drones() >= config.max_maint_drones)
if(!produce_drones || count_drones() >= MAX_MAINT_DRONES)
return
if(!player || !isobserver(player.mob))
@@ -80,10 +83,6 @@
set name = "Join As Drone"
set desc = "If there is a powered, enabled fabricator in the game world with a prepared chassis, join as a maintenance drone."
if(!(config.allow_drone_spawn))
to_chat(src, "<span class='warning'>That verb is not currently permitted.</span>")
return
if(stat != DEAD)
return
@@ -99,7 +98,7 @@
return
var/player_age_check = check_client_age(usr.client, 14) // 14 days to play as a drone
if(player_age_check && config.use_age_restriction_for_antags)
if(player_age_check && GLOB.configuration.gamemode.antag_account_age_restriction)
to_chat(usr, "<span class='warning'>This role is not yet available to you. You need to wait another [player_age_check] days.</span>")
return
@@ -141,7 +140,7 @@
if(DF.stat & NOPOWER || !DF.produce_drones)
continue
if(DF.count_drones() >= config.max_maint_drones)
if(DF.count_drones() >= MAX_MAINT_DRONES)
to_chat(src, "<span class='warning'>There are too many active drones in the world for you to spawn.</span>")
return
@@ -150,3 +149,6 @@
return
to_chat(src, "<span class='warning'>There are no available drone spawn points, sorry.</span>")
#undef DRONE_BUILD_TIME
#undef MAX_MAINT_DRONES
+2 -14
View File
@@ -215,20 +215,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
//Check for custom sprite
if(!custom_sprite)
var/file = file2text("config/custom_sprites.txt")
var/lines = splittext(file, "\n")
for(var/line in lines)
// split & clean up
var/list/Entry = splittext(line, ":")
for(var/i = 1 to Entry.len)
Entry[i] = trim(Entry[i])
if(Entry.len < 2 || Entry[1] != "cyborg") //ignore incorrectly formatted entries or entries that aren't marked for cyborg
continue
if(Entry[2] == ckey) //They're in the list? Custom sprite time, var and icon change required
custom_sprite = 1
if(ckey in GLOB.configuration.custom_sprites.cyborg_ckeys)
custom_sprite = TRUE
if(mmi && mmi.brainmob)
mmi.brainmob.name = newname
@@ -11,7 +11,7 @@
. += speed
if(module_active && istype(module_active,/obj/item/borg/destroyer/mobility))
. -= 3
. += config.robot_delay
. += GLOB.configuration.movement.robot_delay
/mob/living/silicon/robot/mob_negates_gravity()
return magpulse
@@ -139,12 +139,22 @@
update_controls()
/mob/living/simple_animal/bot/New()
/*
HEY! LISTEN!
I see you're poking the the bot/New() proc
Assuming you are converting this to Initialize() [yay], please see my note in
code\game\jobs\job\job.dm | /datum/job/proc/get_access()
Theres a useless check that bugs me but needs to exist because these things New()
-AA07
*/
..()
GLOB.bots_list += src
icon_living = icon_state
icon_dead = icon_state
access_card = new /obj/item/card/id(src)
//This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first.
//This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first.
access_card.access += ACCESS_ROBOTICS
set_custom_texts()
Radio = new/obj/item/radio/headset/bot(src)
@@ -42,6 +42,6 @@
to_chat(user, "<span class='notice'>Someone else already took this spider.</span>")
return
key = user.key
to_chat(src, "<span class='motd'>For more information, check the wiki page: ([config.wikiurl]/index.php/Terror_Spider)</span>")
to_chat(src, "<span class='motd'>For more information, check the wiki page: ([GLOB.configuration.url.wiki_url]/index.php/Terror_Spider)</span>")
for(var/mob/dead/observer/G in GLOB.player_list)
G.show_message("<i>A ghost has taken control of <b>[src]</b>. ([ghost_follow_link(src, ghost=G)]).</i>")
@@ -332,7 +332,7 @@
. = speed
if(forced_look)
. += 3
. += config.animal_delay
. += GLOB.configuration.movement.animal_delay
/mob/living/simple_animal/Stat()
..()
@@ -157,7 +157,7 @@
if(health <= 0) // if damaged, the slime moves twice as slow
. *= 2
. += config.slime_delay
. += GLOB.configuration.movement.slime_delay
/mob/living/simple_animal/slime/update_health_hud()
if(hud_used)
+2 -6
View File
@@ -6,7 +6,7 @@
log_access_in(client)
create_attack_log("<font color='red'>Logged in at [atom_loc_line(get_turf(src))]</font>")
create_log(MISC_LOG, "Logged in")
if(config.log_access)
if(GLOB.configuration.logging.access_logging)
for(var/mob/M in GLOB.player_list)
if(M == src) continue
if( M.key && (M.key != key) )
@@ -16,7 +16,7 @@
if( (M.computer_id == client.computer_id) )
if(matches) matches += " and "
matches += "ID ([client.computer_id])"
if(!config.disable_cid_warn_popup)
if(!GLOB.configuration.general.disable_cid_warning_popup)
spawn() alert("You have logged in already with another key this round, please log out of this one NOW or risk being banned!")
if(matches)
if(M.client)
@@ -68,9 +68,5 @@
for(var/datum/alternate_appearance/AA in viewing_alternate_appearances)
AA.display_to(list(src))
if(!fexists("config/config.txt") || !fexists("config/game_options.txt"))
to_chat(src, "<span class='biggerdanger'>The game config files have not been properly set!\n Please copy ALL files from '/config/example' into the parent folder, '/config'.</span>")
log_world("The game config files have not been properly set! Please copy ALL files from /config/example into the parent folder, /config.")
update_client_colour(0)
update_morgue()
+2 -2
View File
@@ -749,7 +749,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
set name = "Respawn"
set category = "OOC"
if(!GLOB.abandon_allowed)
if(!GLOB.configuration.general.respawn_enabled)
to_chat(usr, "<span class='warning'>Respawning is disabled.</span>")
return
@@ -1007,7 +1007,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
// this function displays the station time in the status panel
/mob/proc/show_stat_station_time()
stat(null, "Round Time: [worldtime2text()]")
stat(null, "Round Time: [worldtime2text()]") // AA TODO: Make this do "Game Time" and "Round Time" with the ROUND_TIME macro
stat(null, "Station Time: [station_time_timestamp()]")
// this function displays the shuttles ETA in the status panel if the shuttle has been called
+1 -1
View File
@@ -79,7 +79,7 @@
/proc/cannotPossess(A)
var/mob/dead/observer/G = A
if(G.has_enabled_antagHUD && config.antag_hud_restricted)
if(G.has_enabled_antagHUD && GLOB.configuration.general.restrict_antag_hud_rejoin)
return 1
return 0
+8 -8
View File
@@ -32,11 +32,11 @@
if(client)
client.playtitlemusic()
if(config.player_overflow_cap && config.overflow_server_url) //Overflow rerouting, if set, forces players to be moved to a different server once a player cap is reached. Less rough than a pure kick.
if(src.client.holder) return //admins are immune to overflow rerouting
if(config.overflow_whitelist.Find(lowertext(src.ckey))) return //Whitelisted people are immune to overflow rerouting.
var/tally = 0
for(var/client/C in GLOB.clients)
tally++
if(tally > config.player_overflow_cap)
src << link(config.overflow_server_url)
//Overflow rerouting, if set, forces players to be moved to a different server once a player cap is reached. Less rough than a pure kick.
if(GLOB.configuration.overflow.reroute_cap && GLOB.configuration.overflow.overflow_server_location)
if(client.holder)
return //admins are immune to overflow rerouting
if(ckey in GLOB.configuration.overflow.overflow_whitelist)
return //Whitelisted people are immune to overflow rerouting.
if(length(GLOB.clients) > GLOB.configuration.overflow.reroute_cap)
src << link(GLOB.configuration.overflow.overflow_server_location)
+5 -5
View File
@@ -214,7 +214,7 @@
return
if(client.prefs.species in GLOB.whitelisted_species)
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
if(!is_alien_whitelisted(src, client.prefs.species))
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
return FALSE
@@ -233,7 +233,7 @@
client.prefs.load_random_character_slot(client)
if(client.prefs.species in GLOB.whitelisted_species)
if(!is_alien_whitelisted(src, client.prefs.species) && config.usealienwhitelist)
if(!is_alien_whitelisted(src, client.prefs.species))
to_chat(src, alert("You are currently not whitelisted to play [client.prefs.species]."))
return FALSE
@@ -257,14 +257,14 @@
if(job.available_in_playtime(client))
return 0
if(config.assistantlimit)
if(GLOB.configuration.jobs.assistant_limit)
if(job.title == "Civilian")
var/count = 0
var/datum/job/officer = SSjobs.GetJob("Security Officer")
var/datum/job/warden = SSjobs.GetJob("Warden")
var/datum/job/hos = SSjobs.GetJob("Head of Security")
count += (officer.current_positions + warden.current_positions + hos.current_positions)
if(job.current_positions > (config.assistantratio * count))
if(job.current_positions > (GLOB.configuration.jobs.assistant_security_ratio * count))
if(count >= 5) // if theres more than 5 security on the station just let assistants join regardless, they should be able to handle the tide
return 1
return 0
@@ -603,7 +603,7 @@
/mob/new_player/proc/is_species_whitelisted(datum/species/S)
if(!S) return 1
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(IS_WHITELISTED in S.species_traits)
return is_alien_whitelisted(src, S.name) || !(IS_WHITELISTED in S.species_traits)
/mob/new_player/get_gender()
if(!client || !client.prefs) ..()
+1 -1
View File
@@ -47,7 +47,7 @@
/mob/proc/say_dead(message)
if(client)
if(!client.holder)
if(!config.dsay_allowed)
if(!GLOB.dsay_enabled)
to_chat(src, "<span class='danger'>Deadchat is globally muted.</span>")
return