From 555609f5c51f416b6e4905848c1d3dac0991f060 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 18 Jun 2014 17:00:33 -0700 Subject: [PATCH] Reset awareness timer when you get a new path that can see me --- moonlight/js/moonlight-skulk.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index c56f23a..b9a8fd6 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -1027,6 +1027,7 @@ var AISprite = function(game, x, y, key, frame) { console.log("I am at the end of my path"); if ( this.canSeeSprite(player, false) == true ) { console.log("I can see the player"); + this.setAwarenessEffect(STATE_ALERTED); this.path_set(player, true); this.path_tween_start(); } else { @@ -1044,6 +1045,7 @@ var AISprite = function(game, x, y, key, frame) { this.path_purge(); this.path_tween_stop(); } else { + x.setAwarenessState(STATE_ALERTED); this.path_tween_start(); } }