Make slimes not quite so aggressive

This commit is contained in:
Juhani Krekelä 2019-06-29 23:40:13 +03:00
parent 3303c52fbc
commit 15e449736b
1 changed files with 2 additions and 2 deletions

View File

@ -608,8 +608,8 @@ function moveSlimes()
local to_player_dx = player_x - slime.x
local to_player_dy = player_y - slime.y
if math.abs(to_player_dx) + math.abs(to_player_dy) <= 7 then
-- If at max 7 moves away from player, book for it
if math.abs(to_player_dx) + math.abs(to_player_dy) <= 7 and math.random() < 0.7 then
-- If at max 7 moves away from player, book for it (likely)
if math.abs(to_player_dx) > math.abs(to_player_dy) then
-- Needs to move more in the horizontal direction → move horizontally
if to_player_dx < 0 then