diff --git a/code/__DEFINES/configuration.dm b/code/__DEFINES/configuration.dm index 3034876e36..6b70eb1e0f 100644 --- a/code/__DEFINES/configuration.dm +++ b/code/__DEFINES/configuration.dm @@ -1,6 +1,7 @@ //config files #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_GET_ENTRY(X) global.config.GetEntryDatum(/datum/config_entry/##X) #define CONFIG_MAPS_FILE "maps.txt" diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 4ce0ccf361..ad1f869057 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -193,6 +193,13 @@ stat("[name]:", statclick) /datum/controller/configuration/proc/Get(entry_type) + var/datum/config_entry/E = GetEntryDatum(entry_type) + if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]") + log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]") + return + return E.config_entry_value + +/datum/controller/configuration/proc/GetEntryDatum(entry_type) var/datum/config_entry/E = entry_type var/entry_is_abstract = initial(E.abstract_type) == entry_type if(entry_is_abstract) @@ -200,10 +207,7 @@ E = entries_by_type[entry_type] if(!E) CRASH("Missing config entry for [entry_type]!") - if((E.protection & CONFIG_ENTRY_HIDDEN) && IsAdminAdvancedProcCall() && GLOB.LastAdminCalledProc == "Get" && GLOB.LastAdminCalledTargetRef == "[REF(src)]") - log_admin_private("Config access of [entry_type] attempted by [key_name(usr)]") - return - return E.config_entry_value + return E /datum/controller/configuration/proc/Set(entry_type, new_val) var/datum/config_entry/E = entry_type diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index 6efc9eab12..a3bc47ac91 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -249,6 +249,18 @@ /datum/config_entry/number/movedelay/walk_delay +/datum/config_entry/number/movedelay/sprint_speed_increase + config_entry_value = 1 + +/datum/config_entry/number/movedelay/sprint_buffer_max + config_entry_value = 42 + +/datum/config_entry/number/movedelay/sprint_stamina_cost + config_entry_value = 0.7 + +/datum/config_entry/number/movedelay/sprint_buffer_regen_per_ds + config_entry_value = 0.3 + /////////////////////////////////////////////////Outdated move delay /datum/config_entry/number/outdated_movedelay deprecated_by = /datum/config_entry/keyed_list/multiplicative_movespeed diff --git a/modular_citadel/code/modules/mob/living/carbon/human/human_movement.dm b/modular_citadel/code/modules/mob/living/carbon/human/human_movement.dm index 0b6903c9fe..bd43d96ba4 100644 --- a/modular_citadel/code/modules/mob/living/carbon/human/human_movement.dm +++ b/modular_citadel/code/modules/mob/living/carbon/human/human_movement.dm @@ -12,8 +12,11 @@ /mob/living/carbon/human/movement_delay() . = 0 - if(!resting && m_intent == MOVE_INTENT_RUN && !sprinting) - . += 1 + if(!resting && m_intent == MOVE_INTENT_RUN && sprinting) + var/static/datum/config_entry/number/movedelay/sprint_speed_increase/SSI + if(!SSI) + SSI = CONFIG_GET_ENTRY(number/movedelay/sprint_speed_increase) + . -= SSI.config_entry_value if(wrongdirmovedelay) . += 1 . += ..() diff --git a/modular_citadel/code/modules/mob/living/living.dm b/modular_citadel/code/modules/mob/living/living.dm index 513a80cae0..0caf548196 100644 --- a/modular_citadel/code/modules/mob/living/living.dm +++ b/modular_citadel/code/modules/mob/living/living.dm @@ -17,6 +17,12 @@ var/sprint_stamina_cost = 0.70 //stamina loss per tile while insufficient sprint buffer. //---End +/mob/living/update_config_movespeed() + . = ..() + sprint_buffer_max = CONFIG_GET(number/movedelay/sprint_buffer_max) + sprint_buffer_regen_ds = CONFIG_GET(number/movedelay/sprint_buffer_regen_per_ds) + sprint_stamina_cost = CONFIG_GET(number/movedelay/sprint_stamina_cost) + /mob/living/movement_delay(ignorewalk = 0) . = ..() if(resting)