Adds "Pause after first step" functionality to integrated pAI bots and the AI Eye (#13653)

* adds stumble functionality to pais

* better lastmovement setting

* adds stumble to the AIeye
This commit is contained in:
BobdaBiscuit
2017-01-27 13:20:23 +00:00
committed by Probe1
parent 1f15711d7e
commit 810ca7323e
2 changed files with 7 additions and 0 deletions

View File

@@ -119,9 +119,13 @@ var/global/list/reagents_to_log = list(FUEL, PLASMA, PACID, SACID, AMUTATIONTOXI
/obj/proc/pAImove(mob/living/silicon/pai/user, dir) //called when integrated pAI attempts to move
if(pAImove_delayer.blocked())
user.last_movement=world.time
return 0
else
delayNextpAIMove(getpAIMovementDelay())
if (user.client.prefs.stumble && ((world.time - user.last_movement) > 5) && getpAIMovementDelay() < 2)
delayNextpAIMove(3) //if set, delays the second step when a mob starts moving to attempt to make precise high ping movement easier
user.last_movement=world.time
return 1
/obj/proc/getpAIMovementDelay()

View File

@@ -123,7 +123,10 @@
for(var/i = 0; i < max(user.sprint, initial); i += 20)
var/turf/step = get_turf(get_step(user.eyeobj, direct))
if(step)
if (user.client.prefs.stumble && ((world.time - user.last_movement) > 4))
user.delayNextMove(3) //if set, delays the second step when a mob starts moving to attempt to make precise high ping movement easier
user.eyeobj.forceMove(step)
user.last_movement=world.time
user.cooldown = world.timeofday + 5
if(user.acceleration)