diff options
Diffstat (limited to 'xml/entities.xml')
-rw-r--r-- | xml/entities.xml | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/xml/entities.xml b/xml/entities.xml index fda45b4..67f4fc2 100644 --- a/xml/entities.xml +++ b/xml/entities.xml @@ -86,9 +86,13 @@ end countdown = countdown - 1 end + + hostile = function() + + end </Wander> - <!--<Aggro arena="arena.xml" /> - <Trigger />--> + <Aggro/> + <!--<Trigger />--> <Drop> <item name="Arrow" min="3" max="5" /> </Drop> @@ -108,8 +112,18 @@ <Name value="birb" /> <Wander> countdown = 0 + onetime = 0 update = function() + if (onetime == 0) then + onetime = 1 + selfy = playery + 300 + end + + if (math.abs(selfx - playerx) <= 150) then + aggro = 1 + end + if (countdown == 0) then countdown = math.random(3000, 5000) if (velx >= 0) then @@ -123,7 +137,38 @@ end countdown = countdown - 1 end + + dipping = 0 + oldy = 0 + + hostile = function() + if (dipping == 1) then + if (selfy >= oldy) then + dipping = 0 + aggro = 0 + vely = 0 + onetime = 0 + else + vely = vely + 0.0006 + if (math.abs(vely) < 0.01) then + attack(selfx, selfy) + end + end + else + if (selfy - playery > 200) then + if (playerx >= selfx) then + velx = 0.01 + else + velx = -0.01 + end + dipping = 1 + oldy = selfy + vely = -.2 + end + end + end </Wander> + <Aggro/> </birb> <structure> |