Add comments into ai.lua

This commit is contained in:
jordan4ibanez 2021-04-22 20:10:01 -04:00
parent f9a7144b65
commit 991bba0a1d

View file

@ -612,11 +612,12 @@ mobs.mob_step = function(self, dtime)
local attacking = nil local attacking = nil
--scan for players within eyesight
if self.hostile then if self.hostile then
--true for line_of_sight is debug --true for line_of_sight is debug
attacking = mobs.detect_closest_player_within_radius(self,true,self.view_range,self.eye_height) attacking = mobs.detect_closest_player_within_radius(self,true,self.view_range,self.eye_height)
--go get the closest player ROAR >:O --go get the closest player
if attacking then if attacking then
--set initial punch timer --set initial punch timer
@ -650,12 +651,14 @@ mobs.mob_step = function(self, dtime)
end end
end end
--mob is stunned after being hit
if self.pause_timer > 0 then if self.pause_timer > 0 then
self.pause_timer = self.pause_timer - dtime self.pause_timer = self.pause_timer - dtime
--don't break eye contact --don't break eye contact
if self.hostile and self.attacking then if self.hostile and self.attacking then
mobs.set_yaw_while_attacking(self) mobs.set_yaw_while_attacking(self)
end end
--do normal ai
else else
--jump only (like slimes) --jump only (like slimes)
if self.jump_only then if self.jump_only then