82 lines
2.4 KiB
Lua
82 lines
2.4 KiB
Lua
|
minetest.register_node("magical_potion:medicine_small", {
|
||
|
description = "Small bottle of Medicine",
|
||
|
drawtype = "plantlike",
|
||
|
tiles = {"medicine_bottle_small.png"},
|
||
|
wield_image = "medicine_bottle_small.png",
|
||
|
paramtype = "light",
|
||
|
stack_max = 1,
|
||
|
is_ground_content = false,
|
||
|
walkable = false,
|
||
|
selection_box = {
|
||
|
type = "fixed",
|
||
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
|
||
|
},
|
||
|
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
|
||
|
sounds = default.node_sound_glass_defaults(),
|
||
|
inventory_image = "medicine_bottle_small.png",
|
||
|
on_use = function(itemstack, player)
|
||
|
local health = player:get_hp();
|
||
|
player:set_hp(health+5)
|
||
|
if minetest.get_modpath("vessels") then
|
||
|
player:get_inventory():add_item("main", "vessels:glass_bottle")
|
||
|
end
|
||
|
itemstack:take_item(1)
|
||
|
return itemstack
|
||
|
end,
|
||
|
})
|
||
|
|
||
|
minetest.register_node("magical_potion:medicine_big", {
|
||
|
description = "Big bottle of Medicine",
|
||
|
drawtype = "plantlike",
|
||
|
tiles = {"medicine_bottle_big.png"},
|
||
|
wield_image = "medicine_bottle_big.png",
|
||
|
paramtype = "light",
|
||
|
stack_max = 1,
|
||
|
is_ground_content = false,
|
||
|
walkable = false,
|
||
|
selection_box = {
|
||
|
type = "fixed",
|
||
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
|
||
|
},
|
||
|
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
|
||
|
sounds = default.node_sound_glass_defaults(),
|
||
|
inventory_image = "medicine_bottle_big.png",
|
||
|
on_use = function(itemstack, player)
|
||
|
local health = player:get_hp();
|
||
|
player:set_hp(health+10)
|
||
|
if minetest.get_modpath("vessels") then
|
||
|
player:get_inventory():add_item("main", "vessels:glass_bottle")
|
||
|
end
|
||
|
itemstack:take_item(1)
|
||
|
return itemstack
|
||
|
end,
|
||
|
})
|
||
|
|
||
|
minetest.register_node("magical_potion:medicine_huge", {
|
||
|
description = "Huge bottle of Medicine",
|
||
|
drawtype = "plantlike",
|
||
|
tiles = {"medicine_bottle_huge.png"},
|
||
|
wield_image = "medicine_bottle_huge.png",
|
||
|
paramtype = "light",
|
||
|
stack_max = 1,
|
||
|
is_ground_content = false,
|
||
|
walkable = false,
|
||
|
selection_box = {
|
||
|
type = "fixed",
|
||
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25}
|
||
|
},
|
||
|
groups = {vessel=1,dig_immediate=3,attached_node=1, potion=1},
|
||
|
sounds = default.node_sound_glass_defaults(),
|
||
|
inventory_image = "medicine_bottle_huge.png",
|
||
|
on_use = function(itemstack, player)
|
||
|
local health = player:get_hp();
|
||
|
player:set_hp(health+20)
|
||
|
itemstack:replace("vessels:glass_bottle")
|
||
|
if minetest.get_modpath("vessels") then
|
||
|
player:get_inventory():add_item("main", "vessels:glass_bottle")
|
||
|
end
|
||
|
itemstack:take_item(1)
|
||
|
return itemstack
|
||
|
end,
|
||
|
})
|