summer/occhiali.lua

38 lines
1.1 KiB
Lua
Raw Normal View History

2024-06-28 15:44:25 +03:00
local Occhiali_list = {
{ "Red Occhiali", "red" },
{ "Orange Occhiali", "orange" },
{ "Black Occhiali", "black" },
{ "Yellow Occhiali", "yellow" },
{ "Green Occhiali", "green" },
{ "Blue Occhiali", "blue" },
{ "Jam Occhiali", "jam" },
{ "Violet Occhiali", "violet" },
2024-06-28 15:44:25 +03:00
}
for i in ipairs(Occhiali_list) do
local Occhialidesc = Occhiali_list[i][1]
local colour = Occhiali_list[i][2]
minetest.register_alias("occhiali" .. colour .. "", "summer:occhiali" .. colour .. "")
if minetest.get_modpath("summer") then
local stats = {
Occhialidesc = { name = Occhialidesc, armor = 1.8, heal = 0, use = 650 },
}
--[[local mats = {
2024-06-28 15:44:25 +03:00
fibra="cannabis:fibra_ingot",
tessuto="cannabis:tessuto_ingot",
foglie="cannabis:foglie_ingot",
high="cannabis:high_performance_ingot",
}]]
for k, v in pairs(stats) do
minetest.register_tool("summer:occhiali_" .. colour .. "", {
description = Occhialidesc,
tiles = "occhiali_" .. colour .. ".png",
inventory_image = "occhiali_" .. colour .. "_inv.png",
groups = { armor_head = math.floor(5 * v.armor), armor_heal = v.heal, armor_use = v.use },
wear = 0,
})
end
end
2024-06-28 15:44:25 +03:00
end