2019-10-13 11:37:36 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-10-13 12:57:57 -04:00
|
|
|
local minetest, nodecore
|
|
|
|
= minetest, nodecore
|
2019-10-13 11:37:36 -04:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
|
|
|
local injured = modname .. ":injured"
|
2020-02-24 21:45:13 -05:00
|
|
|
nodecore.register_virtual_item(injured, {
|
2020-03-25 08:58:31 -04:00
|
|
|
description = "Injury",
|
2020-02-24 21:45:13 -05:00
|
|
|
inventory_image = modname .. "_injured.png"
|
2019-10-13 11:37:36 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
nodecore.register_healthfx({
|
|
|
|
item = injured,
|
2019-10-13 12:57:57 -04:00
|
|
|
getqty = function(player)
|
2020-02-19 19:48:51 -05:00
|
|
|
return 1 - nodecore.getphealth(player) / 8
|
2019-10-13 11:37:36 -04:00
|
|
|
end
|
|
|
|
})
|