mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-21 07:42:21 +00:00
Movement configuration
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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"])
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, "<span class='warning'>[V] can't be made any faster!</span>")
|
||||
return ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user