5c73331ec2
These are no longer actually "items" in the player's view, but states of the hotbar slots themselves...
21 lines
543 B
Lua
21 lines
543 B
Lua
-- LUALOCALS < ---------------------------------------------------------
|
|
local minetest, nodecore
|
|
= minetest, nodecore
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
local injured = modname .. ":injured"
|
|
nodecore.register_virtual_item(injured, {
|
|
description = "",
|
|
inventory_image = "[combine:1x1",
|
|
hotbar_type = "injury",
|
|
})
|
|
|
|
nodecore.register_healthfx({
|
|
item = injured,
|
|
getqty = function(player)
|
|
return 1 - nodecore.getphealth(player) / 8
|
|
end
|
|
})
|