summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-10-31 21:37:38 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2016-10-31 21:37:38 +0000
commitc16c083d31242dc79d7dfa581c393fd2affc6d08 (patch)
treeb8e0fd7dc21fd3ed78c2f38a3955ca7e75745e3e /api.lua
parent9d554fc31fb4edebb05b64ab4396aeac738d349c (diff)
on_punch tweaks
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/api.lua b/api.lua
index d6fa261..1c27238 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
--- Mobs Api (30th October 2016)
+-- Mobs Api (31st October 2016)
mobs = {}
mobs.mod = "redo"
@@ -1886,6 +1886,12 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
end
end
+ -- healing
+ if damage <= -1 then
+ self.health = self.health - floor(damage)
+ return
+ end
+
-- print ("Mob Damage is", damage)
-- add weapon wear
@@ -1930,8 +1936,6 @@ if damage >= 1 then
effect(pos, self.blood_amount, self.blood_texture)
end
-end
-
-- do damage
self.health = self.health - floor(damage)
@@ -1976,6 +1980,8 @@ end
self.pause_timer = r
end
+end -- END if damage
+
-- if skittish then run away
if self.runaway == true then