Refactor move/click code

This commit is contained in:
Aronai Sieyes
2020-05-15 10:49:27 -04:00
parent 6571a10ad4
commit a8f3a0a7a0
40 changed files with 520 additions and 582 deletions

View File

@@ -194,7 +194,7 @@
. = ..()
to_chat(src,"<b>You are \the [src].</b> [player_msg]")
/mob/living/simple_mob/SelfMove(turf/n, direct)
/mob/living/simple_mob/SelfMove(turf/n, direct, movetime)
var/turf/old_turf = get_turf(src)
var/old_dir = dir
. = ..()
@@ -212,9 +212,9 @@
return ..()
*/
/mob/living/simple_mob/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
. = ..()
tally = movement_cooldown
. += movement_cooldown
if(force_max_speed)
return -3
@@ -223,25 +223,25 @@
if(!isnull(M.haste) && M.haste == TRUE)
return -3
if(!isnull(M.slowdown))
tally += M.slowdown
. += M.slowdown
// Turf related slowdown
var/turf/T = get_turf(src)
if(T && T.movement_cost && !hovering) // Flying mobs ignore turf-based slowdown. Aquatic mobs ignore water slowdown, and can gain bonus speed in it.
if(istype(T,/turf/simulated/floor/water) && aquatic_movement)
tally -= aquatic_movement - 1
. -= aquatic_movement - 1
else
tally += T.movement_cost
. += T.movement_cost
if(purge)//Purged creatures will move more slowly. The more time before their purge stops, the slower they'll move.
if(tally <= 0)
tally = 1
tally *= purge
if(. <= 0)
. = 1
. *= purge
if(m_intent == "walk")
tally *= 1.5
. *= 1.5
return tally+config.animal_delay
. += config.animal_delay
/mob/living/simple_mob/Stat()