diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index adbcd7ca55c..7c1e51134c9 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -47,19 +47,6 @@ var/shuttle_refuel_delay = 12000 - //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 - //IP Intel vars var/ipintel_email var/ipintel_rating_bad = 1 @@ -294,22 +281,6 @@ config.revival_brain_life = value if("auto_toggle_ooc_during_round") config.auto_toggle_ooc_during_round = 1 - if("run_speed") - config.run_speed = value - if("walk_speed") - config.walk_speed = value - if("human_delay") - config.human_delay = value - if("robot_delay") - config.robot_delay = value - if("monkey_delay") - config.monkey_delay = value - if("alien_delay") - config.alien_delay = value - if("slime_delay") - config.slime_delay = value - if("animal_delay") - config.animal_delay = value if("bones_can_break") config.bones_can_break = value if("shuttle_refuel_delay") diff --git a/code/controllers/configuration/configuration_core.dm b/code/controllers/configuration/configuration_core.dm index ed37592dc14..18d2923e763 100644 --- a/code/controllers/configuration/configuration_core.dm +++ b/code/controllers/configuration/configuration_core.dm @@ -27,6 +27,8 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) var/datum/configuration_section/logging_configuration/logging /// Holder for the MC configuration datum var/datum/configuration_section/mc_configuration/mc + /// Holder for the MC configuration datum + var/datum/configuration_section/movement_configuration/movement /// Holder for the overflow configuration datum var/datum/configuration_section/overflow_configuration/overflow /// Holder for the ruins configuration datum @@ -62,6 +64,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) jobs = new() logging = new() mc = new() + movement = new() overflow = new() ruins = new() system = new() @@ -87,6 +90,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new()) jobs.load_data(raw_config_data["job_configuration"]) logging.load_data(raw_config_data["logging_configuration"]) mc.load_data(raw_config_data["mc_configuration"]) + movement.load_data(raw_config_data["movement_configuration"]) overflow.load_data(raw_config_data["overflow_configuration"]) ruins.load_data(raw_config_data["ruin_configuration"]) system.load_data(raw_config_data["system_configuration"]) diff --git a/code/controllers/configuration/sections/movement_configuration.dm b/code/controllers/configuration/sections/movement_configuration.dm new file mode 100644 index 00000000000..1f647b94e8a --- /dev/null +++ b/code/controllers/configuration/sections/movement_configuration.dm @@ -0,0 +1,26 @@ +/// Config holder for values relating to mob movement speeds +/datum/configuration_section/movement_configuration + /// Base run speed before modifiers + var/base_run_speed = 1 + /// Base walk speed before modifiers + var/base_walk_speed = 4 + /// Move delay for humanoids + var/human_delay = 1.5 + /// Move delay for cyborgs + var/robot_delay = 2.5 + /// Move delay for xenomorphs + var/alien_delay = 1.5 + /// Move delay for slimes (xenobio, not slimepeople) + var/slime_delay = 1.5 + /// Move delay for other simple animals + var/animal_delay = 2.5 + +/datum/configuration_section/movement_configuration/load_data(list/data) + // Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line + CONFIG_LOAD_NUM(base_run_speed, data["base_run_speed"]) + CONFIG_LOAD_NUM(base_walk_speed, data["base_walk_speed"]) + CONFIG_LOAD_NUM(human_delay, data["human_delay"]) + CONFIG_LOAD_NUM(robot_delay, data["robot_delay"]) + CONFIG_LOAD_NUM(alien_delay, data["alien_delay"]) + CONFIG_LOAD_NUM(slime_delay, data["slime_delay"]) + CONFIG_LOAD_NUM(animal_delay, data["animal_delay"]) diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index e94d0772f67..0345dca3b7f 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -24,7 +24,7 @@ var/oldloc = loc step(src, direction) if(oldloc != loc) - addtimer(CALLBACK(src, .proc/ResetMoveDelay), config.walk_speed) + addtimer(CALLBACK(src, .proc/ResetMoveDelay), GLOB.configuration.movement.base_walk_speed) else move_delay = FALSE diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 63d2b012c41..0d94b7cdf4c 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index cd7f743fa8f..6c05cfcd0a2 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -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) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 23f4d829d43..e7e16827ab3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -928,15 +928,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) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index a8c9dab4e62..9ddbaf61a03 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -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) diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index f3a946a9d50..b5fd0a1b1c8 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -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 diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 7a34f746728..f5c812e7d83 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -332,7 +332,7 @@ . = speed if(forced_look) . += 3 - . += config.animal_delay + . += GLOB.configuration.movement.animal_delay /mob/living/simple_animal/Stat() ..() diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 9941e59373b..551a588247d 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -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) diff --git a/code/modules/power/treadmill.dm b/code/modules/power/treadmill.dm index c9ded5798f4..2ffc4f301f4 100644 --- a/code/modules/power/treadmill.dm +++ b/code/modules/power/treadmill.dm @@ -72,9 +72,9 @@ if(MOVE_INTENT_RUN) if(M.drowsyness > 0) mob_speed += 6 - mob_speed += config.run_speed - 1 + mob_speed += GLOB.configuration.movement.base_run_speed - 1 if(MOVE_INTENT_WALK) - mob_speed += config.walk_speed - 1 + mob_speed += GLOB.configuration.movement.base_run_speed - 1 mob_speed = BASE_MOVE_DELAY / max(1, BASE_MOVE_DELAY + mob_speed) speed = min(speed + inertia * mob_speed, mob_speed) continue diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 5a83bce5536..61a3cd3169a 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -375,7 +375,7 @@ if(istype(O, /obj/vehicle)) var/obj/vehicle/V = O - var/vehicle_speed_mod = config.run_speed + var/vehicle_speed_mod = GLOB.configuration.movement.base_run_speed if(V.vehicle_move_delay <= vehicle_speed_mod) to_chat(user, "[V] can't be made any faster!") return ..() diff --git a/code/modules/vehicle/ambulance.dm b/code/modules/vehicle/ambulance.dm index 702b8e97201..87323fc2042 100644 --- a/code/modules/vehicle/ambulance.dm +++ b/code/modules/vehicle/ambulance.dm @@ -92,7 +92,7 @@ bed = null . = ..() if(bed && get_dist(oldloc, loc) <= 2) - bed.Move(oldloc, get_dir(bed, oldloc), (last_move_diagonal? 2 : 1) * (vehicle_move_delay + config.human_delay)) + bed.Move(oldloc, get_dir(bed, oldloc), (last_move_diagonal? 2 : 1) * (vehicle_move_delay + GLOB.configuration.movement.human_delay)) bed.dir = Dir if(bed.has_buckled_mobs()) for(var/m in bed.buckled_mobs) diff --git a/code/modules/vehicle/vehicle.dm b/code/modules/vehicle/vehicle.dm index 9ed335a6bc1..0d9d002496d 100644 --- a/code/modules/vehicle/vehicle.dm +++ b/code/modules/vehicle/vehicle.dm @@ -160,7 +160,7 @@ unbuckle_mob(user) return - var/delay = (last_move_diagonal? 2 : 1) * (vehicle_move_delay + config.human_delay) + var/delay = (last_move_diagonal? 2 : 1) * (vehicle_move_delay + GLOB.configuration.movement.human_delay) if(world.time < last_vehicle_move + delay) return last_vehicle_move = world.time diff --git a/config/example/config.toml b/config/example/config.toml index c02ab02261d..519a5c5c057 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -551,8 +551,6 @@ base_walk_speed = 4 human_delay = 1.5 # Move delay for cyborgs robot_delay = 2.5 -# Move delay for monkeys (and other primitives) -monkey_delay = 1.5 # Move delay for xenomorphs alien_delay = 1.5 # Move delay for slimes (xenobio, not slimepeople) diff --git a/paradise.dme b/paradise.dme index 5e1c2eec440..3f836906e04 100644 --- a/paradise.dme +++ b/paradise.dme @@ -196,6 +196,7 @@ #include "code\controllers\configuration\sections\job_configuration.dm" #include "code\controllers\configuration\sections\logging_configuration.dm" #include "code\controllers\configuration\sections\mc_configuration.dm" +#include "code\controllers\configuration\sections\movement_configuration.dm" #include "code\controllers\configuration\sections\overflow_configuration.dm" #include "code\controllers\configuration\sections\ruin_configuration.dm" #include "code\controllers\configuration\sections\system_configuration.dm"