This commit is contained in:
Mantar 2024-01-03 19:43:47 -08:00 committed by GitHub
commit 9622a9d99c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -2,6 +2,10 @@
-- Mob Meta --
--------------
-- Visual Harm 1ndicator check
local use_vh1 = minetest.get_modpath("visual_harm_1ndicators")
-- Math --
local pi = math.pi
@ -239,6 +243,9 @@ function mob:hurt(health)
if self.protected then return end
self.hp = self.hp - math.ceil(health)
if self.hp < 0 then self.hp = 0 end
if use_vh1 then
VH1.update_bar(self.object, self.hp, self.max_health)
end
end
-- Add HP to mob
@ -249,6 +256,9 @@ function mob:heal(health)
if self.hp > self.max_health then
self.hp = self.max_health
end
if use_vh1 then
VH1.update_bar(self.object, self.hp, self.max_health)
end
end
-- Return position at center of mobs hitbox

View file

@ -1,2 +1,3 @@
name = creatura
description = A performant, semi-modular mob API
optional_depends = visual_harm_1ndicators