mirror of
https://github.com/SmallJoker/upgrade_packs.git
synced 2024-08-19 21:04:11 +02:00
43 lines
971 B
Lua
43 lines
971 B
Lua
|
upgrade_packs.register_pack("upgrade_packs:hp_10", "health", {
|
||
|
description = "+10 HP",
|
||
|
strength = 10,
|
||
|
image = "heart.png"
|
||
|
})
|
||
|
|
||
|
local gb = "vessels:glass_bottle"
|
||
|
local ci = "default:copper_ingot"
|
||
|
minetest.register_craft({
|
||
|
output = "upgrade_packs:hp_10",
|
||
|
recipe = {
|
||
|
{ci, gb, ci},
|
||
|
{gb, "", gb},
|
||
|
{ci, gb, ci}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
upgrade_packs.register_pack("upgrade_packs:breath_5", "breath", {
|
||
|
description = "+5 Breath",
|
||
|
strength = 5,
|
||
|
image = "bubble.png"
|
||
|
})
|
||
|
|
||
|
local sb = "vessels:steel_bottle"
|
||
|
local ti = "default:tin_ingot"
|
||
|
minetest.register_craft({
|
||
|
output = "upgrade_packs:breath_5",
|
||
|
recipe = {
|
||
|
{ti, sb, ti},
|
||
|
{sb, "", sb},
|
||
|
{ti, sb, ti}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
-- Take something else from the player. BLOOD AND AIR
|
||
|
minetest.register_on_craft(function(itemstack, player)
|
||
|
local name = itemstack:get_name()
|
||
|
if name == "upgrade_packs:hp_10" then
|
||
|
player:set_hp(player:get_hp() - 5)
|
||
|
elseif name == "upgrade_packs:breath_5" then
|
||
|
player:set_breath(player:get_breath() - 10)
|
||
|
end
|
||
|
end)
|