mirror of
https://github.com/minetest-mods/BobBlocks.git
synced 2025-06-29 22:50:38 +02:00
Version MFF.
This commit is contained in:
14
health.lua
Normal file → Executable file
14
health.lua
Normal file → Executable file
@ -21,7 +21,7 @@ local toggle_healthpack = function (pos, node)
|
||||
if not is_healthgate(node) then return end
|
||||
update_healthpack (pos, node, state)
|
||||
end
|
||||
|
||||
|
||||
local on_healthpack_punched = function (pos, node, puncher)
|
||||
if node.name == 'bobblocks:health_off' or node.name == 'bobblocks:health_on' then
|
||||
update_healthpack(pos, node)
|
||||
@ -51,7 +51,7 @@ minetest.register_node("bobblocks:health_on", {
|
||||
tiles = {"bobblocks_health_on.png"},
|
||||
paramtype2 = "facedir",
|
||||
legacy_facedir_simple = true,
|
||||
light_source = LIGHT_MAX-0,
|
||||
light_source = default.LIGHT_MAX-1,
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
||||
is_ground_content = true,
|
||||
walkable = false,
|
||||
@ -73,20 +73,20 @@ minetest.register_abm(
|
||||
for k, obj in pairs(objs) do
|
||||
minetest.sound_play("bobblocks_health",
|
||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
||||
obj:set_hp(obj:get_hp()+5) -- give 2.5HP
|
||||
minetest.remove_node(pos) -- remove the node after use
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
})
|
||||
|
||||
--- Health
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'NodeItem "bobblocks:health_off" 1',
|
||||
output = "bobblocks:health_off",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
{'node "default:dirt" 1', 'node "default:paper" 1', 'node "default:apple" 2'},
|
||||
|
||||
"default:dirt", "default:paper", "default:apple", "default:apple"
|
||||
},
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user