1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-07-02 00:10:21 +02:00

added multiple blood textures

This commit is contained in:
TenPlus1
2018-01-12 19:18:48 +00:00
parent 5751d98ab0
commit 4bf4d42b07
3 changed files with 13 additions and 4 deletions

10
api.lua
View File

@ -2225,7 +2225,15 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
pos.y = pos.y + (-self.collisionbox[2] + self.collisionbox[5]) * .5
effect(pos, self.blood_amount, self.blood_texture, nil, nil, 1, nil)
-- do we have a single blood texture or multiple?
if type(self.blood_texture) == "table" then
local blood = self.blood_texture[random(1, #self.blood_texture)]
effect(pos, self.blood_amount, blood, nil, nil, 1, nil)
else
effect(pos, self.blood_amount, self.blood_texture, nil, nil, 1, nil)
end
end
-- do damage