Implement speed modifiers (#1119)

Because linear addition does not retain proportional relationships! Mulipliers should take care of that, though, surely.
This commit is contained in:
skull132
2016-11-06 15:07:50 +02:00
committed by GitHub
parent ca1f0b51db
commit faf81f15a1
3 changed files with 29 additions and 16 deletions

View File

@@ -142,8 +142,9 @@ var/list/gamemode_cache = list()
//Used for modifying movement speed for mobs.
//Unversal modifiers
var/run_speed = 0
var/walk_speed = 0
var/walk_delay_multiplier = 1
var/run_delay_multiplier = 1
//Mob specific modifiers. NOTE: These will affect different mob types in different ways
var/human_delay = 0
@@ -782,11 +783,15 @@ var/list/gamemode_cache = list()
if("limbs_can_break")
config.limbs_can_break = value
if("run_speed")
config.run_speed = value
if("walk_speed")
config.walk_speed = value
// These should never go to 0 or below. So, we clamp them.
if("walk_delay_multiplier")
config.walk_delay_multiplier = max(0.1, text2num(value))
if("run_delay_multiplier")
config.run_delay_multiplier = max(0.1, text2num(value))
if("human_delay")
config.human_delay = value
if("robot_delay")