mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 18:11:47 +00:00
Makes editing movements delay configs have an effect again (#32530)
This commit is contained in:
committed by
duncathan salt
parent
d3df913402
commit
45c5e63206
@@ -163,9 +163,20 @@ CONFIG_DEF(flag/ooc_during_round)
|
|||||||
CONFIG_DEF(flag/emojis)
|
CONFIG_DEF(flag/emojis)
|
||||||
|
|
||||||
CONFIG_DEF(number/run_delay) //Used for modifying movement speed for mobs.
|
CONFIG_DEF(number/run_delay) //Used for modifying movement speed for mobs.
|
||||||
|
var/static/value_cache = 0
|
||||||
|
|
||||||
|
CONFIG_TWEAK(number/run_delay/ValidateAndSet())
|
||||||
|
. = ..()
|
||||||
|
if(.)
|
||||||
|
value_cache = value
|
||||||
|
|
||||||
CONFIG_DEF(number/walk_delay)
|
CONFIG_DEF(number/walk_delay)
|
||||||
|
var/static/value_cache = 0
|
||||||
|
|
||||||
|
CONFIG_TWEAK(number/walk_delay/ValidateAndSet())
|
||||||
|
. = ..()
|
||||||
|
if(.)
|
||||||
|
value_cache = value
|
||||||
|
|
||||||
CONFIG_DEF(number/human_delay) //Mob specific modifiers. NOTE: These will affect different mob types in different ways
|
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/robot_delay)
|
||||||
|
|||||||
@@ -15,18 +15,20 @@
|
|||||||
delivery_icon = "deliverybox"
|
delivery_icon = "deliverybox"
|
||||||
anchorable = FALSE
|
anchorable = FALSE
|
||||||
var/move_speed_multiplier = 1
|
var/move_speed_multiplier = 1
|
||||||
var/move_delay = 0
|
var/move_delay = FALSE
|
||||||
var/egged = 0
|
var/egged = 0
|
||||||
|
|
||||||
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
|
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
|
||||||
if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
|
if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
|
||||||
return
|
return
|
||||||
move_delay = 1
|
move_delay = TRUE
|
||||||
if(step(src, direction))
|
if(step(src, direction))
|
||||||
spawn(CONFIG_GET(number/walk_delay) * move_speed_multiplier)
|
addtimer(CALLBACK(src, .proc/ResetMoveDelay), CONFIG_GET(number/walk_delay) * move_speed_multiplier)
|
||||||
move_delay = 0
|
|
||||||
else
|
else
|
||||||
move_delay = 0
|
ResetMoveDelay()
|
||||||
|
|
||||||
|
/obj/structure/closet/cardboard/proc/ResetMoveDelay()
|
||||||
|
move_delay = FALSE
|
||||||
|
|
||||||
/obj/structure/closet/cardboard/open()
|
/obj/structure/closet/cardboard/open()
|
||||||
if(opened || !can_open())
|
if(opened || !can_open())
|
||||||
|
|||||||
@@ -479,21 +479,21 @@
|
|||||||
if(isopenturf(loc) && !is_flying())
|
if(isopenturf(loc) && !is_flying())
|
||||||
var/turf/open/T = loc
|
var/turf/open/T = loc
|
||||||
. += T.slowdown
|
. += T.slowdown
|
||||||
var/static/config_run_delay
|
var/static/datum/config_entry/number/run_delay/config_run_delay
|
||||||
var/static/config_walk_delay
|
var/static/datum/config_entry/number/walk_delay/config_walk_delay
|
||||||
if(isnull(config_run_delay))
|
if(isnull(config_run_delay))
|
||||||
config_run_delay = CONFIG_GET(number/run_delay)
|
config_run_delay = CONFIG_GET(number/run_delay)
|
||||||
config_walk_delay = CONFIG_GET(number/walk_delay)
|
config_walk_delay = CONFIG_GET(number/walk_delay)
|
||||||
if(ignorewalk)
|
if(ignorewalk)
|
||||||
. += config_run_delay
|
. += config_run_delay.value_cache
|
||||||
else
|
else
|
||||||
switch(m_intent)
|
switch(m_intent)
|
||||||
if(MOVE_INTENT_RUN)
|
if(MOVE_INTENT_RUN)
|
||||||
if(drowsyness > 0)
|
if(drowsyness > 0)
|
||||||
. += 6
|
. += 6
|
||||||
. += config_run_delay
|
. += config_run_delay.value_cache
|
||||||
if(MOVE_INTENT_WALK)
|
if(MOVE_INTENT_WALK)
|
||||||
. += config_walk_delay
|
. += config_walk_delay.value_cache
|
||||||
|
|
||||||
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
|
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
|
||||||
if(!has_gravity())
|
if(!has_gravity())
|
||||||
|
|||||||
Reference in New Issue
Block a user