Fix fleshy group on enchanted swords
This commit is contained in:
parent
83b54537ce
commit
64c26e2d25
@ -125,7 +125,7 @@ function enchanting.register_enchtools()
|
|||||||
local original_damage_groups = original_tool.tool_capabilities.damage_groups
|
local original_damage_groups = original_tool.tool_capabilities.damage_groups
|
||||||
local original_groupcaps = original_tool.tool_capabilities.groupcaps
|
local original_groupcaps = original_tool.tool_capabilities.groupcaps
|
||||||
local groupcaps = table.copy(original_groupcaps)
|
local groupcaps = table.copy(original_groupcaps)
|
||||||
local fleshy
|
local fleshy = original_damage_groups.fleshy
|
||||||
|
|
||||||
if c == "durable" and k <= 3 then
|
if c == "durable" and k <= 3 then
|
||||||
groupcaps[t[2]].uses = original_groupcaps[t[2]].uses * use_factor
|
groupcaps[t[2]].uses = original_groupcaps[t[2]].uses * use_factor
|
||||||
@ -134,15 +134,15 @@ function enchanting.register_enchtools()
|
|||||||
groupcaps[t[2]].times[i] = original_groupcaps[t[2]].times[i] - times_subtractor
|
groupcaps[t[2]].times[i] = original_groupcaps[t[2]].times[i] - times_subtractor
|
||||||
end
|
end
|
||||||
elseif c == "sharp" and k == 4 then
|
elseif c == "sharp" and k == 4 then
|
||||||
fleshy = original_damage_groups.fleshy + sharp_factor
|
fleshy = fleshy + sharp_factor
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_tool(string.format("xdecor:enchanted_%s_%s_%s", t[1], m, c), {
|
minetest.register_tool("xdecor:enchanted_"..t[1].."_"..m.."_"..c, {
|
||||||
description = string.format("Enchanted %s %s (%s)", cap(m), cap(t[1]), cap(c)),
|
description = string.format("Enchanted %s %s (%s)", cap(m), cap(t[1]), cap(c)),
|
||||||
inventory_image = original_tool.inventory_image.."^[colorize:violet:50",
|
inventory_image = original_tool.inventory_image.."^[colorize:violet:50",
|
||||||
wield_image = original_tool.wield_image,
|
wield_image = original_tool.wield_image,
|
||||||
groups = {not_in_creative_inventory=1},
|
groups = {not_in_creative_inventory=1},
|
||||||
tool_capabilities = {groupcaps = groupcaps, damage_groups = fleshy}
|
tool_capabilities = {groupcaps = groupcaps, damage_groups = {fleshy = fleshy}}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -185,7 +185,7 @@ for _, name in pairs(n) do
|
|||||||
groups[k] = v end
|
groups[k] = v end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node(string.format(":%s:%s_%s", mod, name, d[1]), {
|
minetest.register_node(":"..mod..":"..name.."_"..d[1], {
|
||||||
description = ndef.description.." "..d[1]:gsub("^%l", string.upper),
|
description = ndef.description.." "..d[1]:gsub("^%l", string.upper),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
Loading…
Reference in New Issue
Block a user