From 15e449736b14f599bbbfaa54e8252e61f34713ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sat, 29 Jun 2019 23:40:13 +0300 Subject: [PATCH] Make slimes not quite so aggressive --- bundle/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundle/main.lua b/bundle/main.lua index cb9c10e..752dc2d 100644 --- a/bundle/main.lua +++ b/bundle/main.lua @@ -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