mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-03-01 02:44:38 +01:00
Mobs: Respect fall_damage_add_percent
@ -2518,7 +2518,14 @@ local falling = function(self, pos)
|
|||||||
|
|
||||||
if d > 5 then
|
if d > 5 then
|
||||||
|
|
||||||
self.health = self.health - floor(d - 5)
|
local add = minetest.get_item_group(self.standing_on, "fall_damage_add_percent")
|
||||||
|
local damage = d - 5
|
||||||
|
if add ~= 0 then
|
||||||
|
damage = damage + damage * (add/100)
|
||||||
|
end
|
||||||
|
damage = floor(damage)
|
||||||
|
if damage > 0 then
|
||||||
|
self.health = self.health - damage
|
||||||
|
|
||||||
effect(pos, 5, "tnt_smoke.png", 1, 2, 2, nil)
|
effect(pos, 5, "tnt_smoke.png", 1, 2, 2, nil)
|
||||||
|
|
||||||
@ -2526,6 +2533,7 @@ local falling = function(self, pos)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.old_y = self.object:get_pos().y
|
self.old_y = self.object:get_pos().y
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user