mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-06 23:42:27 +00:00
Refactor move/click code
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user