combined tool creation functions, fixed zircon texture path

and normalized the fudged values for now (still not using accurate
values, but at least works better and applies to uses value for all
tools)
master
Jacob Gustafson 2017-02-12 01:12:10 -05:00
parent a610094d2c
commit 4aa962749f
2 changed files with 35 additions and 90 deletions

View File

@ -55,7 +55,7 @@ minetest.register_craftitem( "birthstones:topaz", {
}) })
minetest.register_craftitem( "birthstones:zircon", { minetest.register_craftitem( "birthstones:zircon", {
description = "Zircon", description = "Zircon",
inventory_image = "Zircon.png", inventory_image = "birthstones_zircon.png",
on_place_on_ground = minetest.craftitem_place_item, on_place_on_ground = minetest.craftitem_place_item,
}) })

123
tools.lua
View File

@ -1,14 +1,14 @@
-- START OF FUNCTIONS -- START OF FUNCTIONS
-- (START OF INIT IS FURTHER DOWN) -- (START OF INIT IS FURTHER DOWN)
local function registerpickrecipe(name, durability, time1, time2, time3, maxlev) local function create_tools_for_material(name, display_name, uses_vs_env, time1, time2, time3, maxlev)
minetest.register_tool("birthstones:pick_" .. string.lower(name), { minetest.register_tool("birthstones:pick_" .. string.lower(name), {
description = name .. " Pickaxe", description = display_name .. " Pickaxe",
inventory_image = "birthstones_tool_" .. string.lower(name) .. "pick.png", inventory_image = "birthstones_tool_" .. string.lower(name) .. "pick.png",
tool_capabilities = { tool_capabilities = {
max_drop_level=0, max_drop_level=0,
groupcaps={ groupcaps={
cracky={times={[1]=time1, [2]=time2, [3]=time3}, uses=durability, maxlevel=maxlev} cracky={times={[1]=time1, [2]=time2, [3]=time3}, uses=uses_vs_env, maxlevel=maxlev}
} }
}, },
}) })
@ -21,13 +21,13 @@ minetest.register_craft({
} }
}) })
minetest.register_tool("birthstones:axe_" .. string.lower(name), { minetest.register_tool("birthstones:axe_" .. string.lower(name), {
description = name .. " Axe", description = display_name .. " Axe",
inventory_image = "birthstones_tool_" .. string.lower(name) .. "axe.png", inventory_image = "birthstones_tool_" .. string.lower(name) .. "axe.png",
tool_capabilities = { tool_capabilities = {
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
choppy={times={[1]=time1/2.0, [2]=time2/2.0, [3]=time3/2.0}, uses=30, maxlevel=maxlev}, choppy={times={[1]=time1/2.0, [2]=time2/2.0, [3]=time3/2.0}, uses=uses_vs_env, maxlevel=maxlev},
fleshy={times={[2]=time2, [3]=time3}, uses=40, maxlevel=maxlev} fleshy={times={[2]=time2, [3]=time3}, uses=uses_vs_env/3*4, maxlevel=maxlev}
} }
}, },
}) })
@ -40,14 +40,14 @@ minetest.register_craft({
} }
}) })
minetest.register_tool("birthstones:shovel_" .. string.lower(name), { minetest.register_tool("birthstones:shovel_" .. string.lower(name), {
description = name .. " Shovel", description = display_name .. " Shovel",
inventory_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png", inventory_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png",
wield_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png^[transformR90", wield_image = "birthstones_tool_" .. string.lower(name) .. "shovel.png^[transformR90",
tool_capabilities = { tool_capabilities = {
full_punch_interval = 1.0, full_punch_interval = 1.0,
max_drop_level=1, max_drop_level=1,
groupcaps={ groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=uses_vs_env, maxlevel=3},
}, },
damage_groups = {fleshy=4}, damage_groups = {fleshy=4},
}, },
@ -61,22 +61,18 @@ minetest.register_craft({
{'', 'default:stick'} {'', 'default:stick'}
} }
}) })
end
local function registerswordrecipe(name)
minetest.register_tool("birthstones:sword_" .. string.lower(name), { minetest.register_tool("birthstones:sword_" .. string.lower(name), {
description = name .. " Pickaxe", description = display_name .. " Sword",
inventory_image = "birthstones_tool_" .. string.lower(name) .. "pick.png", inventory_image = "birthstones_tool_" .. string.lower(name) .. "pick.png",
tool_capabilities = { tool_capabilities = {
full_punch_interval = 0.9, full_punch_interval = 0.7,
max_drop_level=3, max_drop_level=1,
groupcaps={ groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3}, snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=uses_vs_env/3*4, maxlevel=3},
}, },
damage_groups = {fleshy=5}, damage_groups = {fleshy=8},
}, },
sound = {breaks = "default_tool_breaks"}, sound = {breaks = "default_tool_breaks"},
}) })
minetest.register_craft({ minetest.register_craft({
output = "birthstones:sword_" .. string.lower(name), output = "birthstones:sword_" .. string.lower(name),
@ -86,81 +82,30 @@ minetest.register_craft({
{'', 'default:stick'} {'', 'default:stick'}
} }
}) })
end end
-- END OF FUNCTIONS -- END OF FUNCTIONS
-- START OF INIT -- START OF INIT
registerswordrecipe("Alexandrite") -- default:diamond:
registerswordrecipe("Amethyst") -- sword uses=40
registerswordrecipe("Aquamarine") -- pick uses=30
-- NOTE: Diamond is done manually below so as to be named White Diamond -- default:stone:
registerswordrecipe("Emerald") -- sword uses=20
registerswordrecipe("Garnet") -- pick uses=20
registerswordrecipe("Opal") -- name, display_name, uses_vs_env, time1, time2, time3, maxlev
registerswordrecipe("Peridot") --uses_vs_env: normal use (bonus is added for fleshy target)
registerswordrecipe("Ruby") create_tools_for_material("Alexandrite", "Alexandrite", 17, 3.2, 1.40, 0.90, 1)
registerswordrecipe("Sapphire") create_tools_for_material("Amethyst", "Amethyst", 17, 3.2, 1.40, 0.90, 1)
registerswordrecipe("Topaz") create_tools_for_material("Aquamarine", "Aquamarine", 15, 3.2, 1.40, 0.90, 1)
registerswordrecipe("Zircon") create_tools_for_material("Diamond", "White Diamond", 30, 4.5, 1.8, 1.3, 3)
create_tools_for_material("Emerald", "Emerald", 27, 4.2, 1.6, 1.2, 2)
minetest.register_tool("birthstones:sword_diamond", { create_tools_for_material("Garnet", "Garnet", 22, 4.0, 1.5, 1.0, 1)
description = "White Diamond Sword", create_tools_for_material("Opal", "Opal", 19, 3.5, 1.6, 1.5, 2)
inventory_image = "birthstones_tool_diamondsword.png", create_tools_for_material("Peridot", "Peridot", 24, 4.0, 1.5, 1.0, 1)
tool_capabilities = { create_tools_for_material("Ruby", "Ruby", 27, 4.2, 1.6, 1.2, 2)
full_punch_interval = 0.7, create_tools_for_material("Sapphire", "Sapphire", 27, 4.2, 1.6, 1.2, 1)
max_drop_level=1, create_tools_for_material("Topaz", "Topaz", 25, 4.1, 1.6, 1.05, 1)
groupcaps={ create_tools_for_material("Zircon", "Zircon", 30, 4.1, 1.6, 1.05, 1)
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:sword_diamond",
recipe = {
{'', 'birthstones:diamond'},
{'', 'birthstones:diamond'},
{'', 'default:stick'}
}
})
minetest.register_tool("birthstones:shovel_diamond", {
description = "White Diamond Shovel",
inventory_image = "birthstones_tool_diamondshovel.png",
wield_image = "birthstones_tool_diamondshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=4},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_craft({
output = "birthstones:shovel_diamond",
recipe = {
{'', 'birthstones:diamond'},
{'', 'default:stick'},
{'', 'default:stick'}
}
})
-- name, durability, time1, time2, time3, maxlev
registerpickrecipe("Alexandrite", 30, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Amethyst", 30, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Aquamarine", 25, 3.2, 1.40, 0.90, 1)
registerpickrecipe("Diamond", 50, 4.5, 1.8, 1.3, 3)
registerpickrecipe("Emerald", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("Garnet", 35, 4.0, 1.5, 1.0, 1)
registerpickrecipe("Opal", 32, 3.5, 1.6, 1.5, 2)
registerpickrecipe("Peridot", 34, 4.0, 1.5, 1.0, 1)
registerpickrecipe("Ruby", 40, 4.2, 1.6, 1.2, 2)
registerpickrecipe("Sapphire", 40, 4.2, 1.6, 1.2, 1)
registerpickrecipe("Topaz", 38, 4.1, 1.6, 1.05, 1)
registerpickrecipe("Zircon", 50, 4.1, 1.6, 1.05, 1)