Files
GS13/code/modules/mob/living/living_movement.dm
T
QuoteFox faf0e4fae7 Pixel Shifting for RP
Pixel Shifting for RP
2020-07-04 11:11:31 +01:00

33 lines
991 B
Plaintext

/mob/living/Moved()
. = ..()
update_turf_movespeed(loc)
if(is_shifted)
is_shifted = FALSE
pixel_x = get_standard_pixel_x_offset(lying)
pixel_y = get_standard_pixel_y_offset(lying)
/mob/living/toggle_move_intent()
. = ..()
update_move_intent_slowdown()
/mob/living/update_config_movespeed()
update_move_intent_slowdown()
return ..()
/mob/living/proc/update_move_intent_slowdown()
var/mod = 0
if(m_intent == MOVE_INTENT_WALK)
mod = CONFIG_GET(number/movedelay/walk_delay)
else
//mod = CONFIG_GET(number/movedelay/run_delay)
mod = 1.30
if(!isnum(mod))
mod = 1
add_movespeed_modifier(MOVESPEED_ID_MOB_WALK_RUN_CONFIG_SPEED, TRUE, 100, override = TRUE, multiplicative_slowdown = mod)
/mob/living/proc/update_turf_movespeed(turf/open/T)
if(isopenturf(T) && !is_flying())
add_movespeed_modifier(MOVESPEED_ID_LIVING_TURF_SPEEDMOD, TRUE, 100, override = TRUE, multiplicative_slowdown = T.slowdown)
else
remove_movespeed_modifier(MOVESPEED_ID_LIVING_TURF_SPEEDMOD)