From 03246da32a8452e6a76ccf2f7f97cda4472d1d29 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 17 Oct 2017 18:21:38 -0400 Subject: skirl hostility --- xml/entities.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xml/entities.xml') diff --git a/xml/entities.xml b/xml/entities.xml index 67f4fc2..16bee0f 100644 --- a/xml/entities.xml +++ b/xml/entities.xml @@ -80,6 +80,10 @@ countdown = 0 update = function() + if (velx < 0 and math.abs(selfx - playerx) < 150) then + aggro = 1 + end + if (countdown == 0) then countdown = math.random(3000, 5000) velx = math.random(-1, 1) * 0.005 @@ -88,7 +92,15 @@ end hostile = function() + if (playerx <= selfx) then + velx = -0.01 + else + velx = 0.01 + end + if (math.abs(playerx - selfx) < 50) then + attack(selfx, selfy) + end end @@ -110,6 +122,7 @@ + countdown = 0 onetime = 0 -- cgit v1.2.3