Style cleaning
This commit is contained in:
parent
d82f60a904
commit
a44a98c44e
@ -90,31 +90,28 @@ xdecor.register("enchantment_table", {
|
|||||||
allow_metadata_inventory_move = function(...) return 0 end
|
allow_metadata_inventory_move = function(...) return 0 end
|
||||||
})
|
})
|
||||||
|
|
||||||
local function capitalize(str)
|
local function capitalize(str) return str:gsub("^%l", string.upper) end
|
||||||
return str:gsub("^%l", string.upper)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Higher number = longer use.
|
-- Higher number = stronger enchant.
|
||||||
local use_factor = 1.2
|
local use_factor = 1.2
|
||||||
-- Higher number = faster dig.
|
|
||||||
local times_subtractor = 0.1
|
local times_subtractor = 0.1
|
||||||
|
|
||||||
function enchanting.register_enchtools()
|
function enchanting.register_enchtools()
|
||||||
local materials = {"steel", "bronze", "mese", "diamond"}
|
local materials = {"steel", "bronze", "mese", "diamond"}
|
||||||
local tools = { {"axe", "choppy"}, {"pick", "cracky"}, {"shovel", "crumbly"} }
|
local tools = { {"axe", "choppy"}, {"pick", "cracky"}, {"shovel", "crumbly"} }
|
||||||
local chants = {"durable", "fast"}
|
local chants = {"durable", "fast"}
|
||||||
for j = 1, #materials do
|
|
||||||
local material = materials[j]
|
|
||||||
for t = 1, #tools do
|
|
||||||
local tool_name = tools[t][1]
|
|
||||||
local original_tool = minetest.registered_tools["default:"..tool_name.."_"..material]
|
|
||||||
local original_groupcaps = original_tool.tool_capabilities.groupcaps
|
|
||||||
local main_groupcap = tools[t][2]
|
|
||||||
|
|
||||||
|
for j = 1, #materials do
|
||||||
|
for t = 1, #tools do
|
||||||
for i = 1, #chants do
|
for i = 1, #chants do
|
||||||
local chant = chants[i]
|
local chant = chants[i]
|
||||||
|
local material = materials[j]
|
||||||
|
local tool_name = tools[t][1]
|
||||||
|
local main_groupcap = tools[t][2]
|
||||||
|
local original_tool = minetest.registered_tools["default:"..tool_name.."_"..material]
|
||||||
|
local original_groupcaps = original_tool.tool_capabilities.groupcaps
|
||||||
local groupcaps = table.copy(original_groupcaps)
|
local groupcaps = table.copy(original_groupcaps)
|
||||||
|
|
||||||
if chant == "durable" then
|
if chant == "durable" then
|
||||||
groupcaps[main_groupcap].uses = original_groupcaps[main_groupcap].uses * use_factor
|
groupcaps[main_groupcap].uses = original_groupcaps[main_groupcap].uses * use_factor
|
||||||
elseif chant == "fast" then
|
elseif chant == "fast" then
|
||||||
@ -136,4 +133,3 @@ function enchanting.register_enchtools()
|
|||||||
end
|
end
|
||||||
|
|
||||||
enchanting.register_enchtools()
|
enchanting.register_enchtools()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user