mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-21 14:53:16 -04:00
default: Loop over the tool registrations.
v2: Move the translation support from the tables to the loops. v3: Set tool.groups before minetest.register_tool. v4: Only set tool.groups to {} once per loop.
This commit is contained in:
parent
fb18a5b20d
commit
1b1d40d148
1 changed files with 197 additions and 350 deletions
|
@ -24,383 +24,230 @@ minetest.register_item(":", {
|
||||||
-- Picks
|
-- Picks
|
||||||
--
|
--
|
||||||
|
|
||||||
minetest.register_tool("default:pick_wood", {
|
local tool_pick = {
|
||||||
description = S("Wooden Pickaxe"),
|
wood = {
|
||||||
inventory_image = "default_tool_woodpick.png",
|
desc = "Wooden Pickaxe",
|
||||||
tool_capabilities = {
|
punch = 1.2, drop = 0, damage = 2,
|
||||||
full_punch_interval = 1.2,
|
cap = {times={[3]=1.60}, uses=10, maxlevel=1},
|
||||||
max_drop_level=0,
|
groups = {flammable = 2},
|
||||||
groupcaps={
|
|
||||||
cracky = {times={[3]=1.60}, uses=10, maxlevel=1},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=2},
|
|
||||||
},
|
},
|
||||||
sound = {breaks = "default_tool_breaks"},
|
stone = {
|
||||||
groups = {pickaxe = 1, flammable = 2}
|
desc = "Stone Pickaxe",
|
||||||
})
|
punch = 1.3, drop = 0, damage = 3,
|
||||||
|
cap = {times={[2]=2.0, [3]=1.00}, uses=20, maxlevel=1},
|
||||||
|
},
|
||||||
|
bronze = {
|
||||||
|
desc = "Bronze Pickaxe",
|
||||||
|
punch = 1.0, drop = 1, damage = 4,
|
||||||
|
cap = {times={[1]=4.50, [2]=1.80, [3]=0.90}, uses=20, maxlevel=2},
|
||||||
|
},
|
||||||
|
steel = {
|
||||||
|
desc = "Steel Pickaxe",
|
||||||
|
punch = 1.0, drop = 1, damage = 4,
|
||||||
|
cap = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
|
||||||
|
},
|
||||||
|
mese = {
|
||||||
|
desc = "Mese Pickaxe",
|
||||||
|
punch = 0.9, drop = 3, damage = 5,
|
||||||
|
cap = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},
|
||||||
|
},
|
||||||
|
diamond = {
|
||||||
|
desc = "Diamond Pickaxe",
|
||||||
|
punch = 0.9, drop = 3, damage = 5,
|
||||||
|
cap = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_tool("default:pick_stone", {
|
for mat, tool in pairs(tool_pick) do
|
||||||
description = S("Stone Pickaxe"),
|
tool.groups = tool.groups or {}
|
||||||
inventory_image = "default_tool_stonepick.png",
|
tool.groups.pickaxe = 1
|
||||||
tool_capabilities = {
|
minetest.register_tool("default:pick_".. mat, {
|
||||||
full_punch_interval = 1.3,
|
description = S(tool.desc),
|
||||||
max_drop_level=0,
|
inventory_image = "default_tool_".. mat .."pick.png",
|
||||||
groupcaps={
|
tool_capabilities = {
|
||||||
cracky = {times={[2]=2.0, [3]=1.00}, uses=20, maxlevel=1},
|
full_punch_interval = tool.punch,
|
||||||
|
max_drop_level = tool.drop,
|
||||||
|
groupcaps={
|
||||||
|
cracky = tool.cap,
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy = tool.damage},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=3},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
},
|
groups = tool.groups
|
||||||
sound = {breaks = "default_tool_breaks"},
|
})
|
||||||
groups = {pickaxe = 1}
|
end
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:pick_bronze", {
|
|
||||||
description = S("Bronze Pickaxe"),
|
|
||||||
inventory_image = "default_tool_bronzepick.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
cracky = {times={[1]=4.50, [2]=1.80, [3]=0.90}, uses=20, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {pickaxe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:pick_steel", {
|
|
||||||
description = S("Steel Pickaxe"),
|
|
||||||
inventory_image = "default_tool_steelpick.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {pickaxe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:pick_mese", {
|
|
||||||
description = S("Mese Pickaxe"),
|
|
||||||
inventory_image = "default_tool_mesepick.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.9,
|
|
||||||
max_drop_level=3,
|
|
||||||
groupcaps={
|
|
||||||
cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=5},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {pickaxe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:pick_diamond", {
|
|
||||||
description = S("Diamond Pickaxe"),
|
|
||||||
inventory_image = "default_tool_diamondpick.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.9,
|
|
||||||
max_drop_level=3,
|
|
||||||
groupcaps={
|
|
||||||
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=5},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {pickaxe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Shovels
|
-- Shovels
|
||||||
--
|
--
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_wood", {
|
local tool_shovel = {
|
||||||
description = S("Wooden Shovel"),
|
wood = {
|
||||||
inventory_image = "default_tool_woodshovel.png",
|
desc = "Wooden Shovel",
|
||||||
wield_image = "default_tool_woodshovel.png^[transformR90",
|
punch = 1.2, drop = 0, damage = 2,
|
||||||
tool_capabilities = {
|
cap = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=10, maxlevel=1},
|
||||||
full_punch_interval = 1.2,
|
groups = {flammable = 2},
|
||||||
max_drop_level=0,
|
|
||||||
groupcaps={
|
|
||||||
crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=10, maxlevel=1},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=2},
|
|
||||||
},
|
},
|
||||||
sound = {breaks = "default_tool_breaks"},
|
stone = {
|
||||||
groups = {shovel = 1, flammable = 2}
|
desc = "Stone Shovel",
|
||||||
})
|
punch = 1.4, drop = 0, damage = 2,
|
||||||
|
cap = {times={[1]=1.80, [2]=1.20, [3]=0.50}, uses=20, maxlevel=1},
|
||||||
|
},
|
||||||
|
bronze = {
|
||||||
|
desc = "Bronze Shovel",
|
||||||
|
punch = 1.2, drop = 1, damage = 3,
|
||||||
|
cap = {times={[1]=1.65, [2]=1.05, [3]=0.45}, uses=25, maxlevel=2},
|
||||||
|
},
|
||||||
|
steel = {
|
||||||
|
desc = "Steel Shovel",
|
||||||
|
punch = 1.1, drop = 1, damage = 3,
|
||||||
|
cap = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2},
|
||||||
|
},
|
||||||
|
mese = {
|
||||||
|
desc = "Mese Shovel",
|
||||||
|
punch = 1.0, drop = 3, damage = 4,
|
||||||
|
cap = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3},
|
||||||
|
},
|
||||||
|
diamond = {
|
||||||
|
desc = "Diamond Shovel",
|
||||||
|
punch = 1.0, drop = 1, damage = 4,
|
||||||
|
cap = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_stone", {
|
for mat, tool in pairs(tool_shovel) do
|
||||||
description = S("Stone Shovel"),
|
tool.groups = tool.groups or {}
|
||||||
inventory_image = "default_tool_stoneshovel.png",
|
tool.groups.shovel = 1
|
||||||
wield_image = "default_tool_stoneshovel.png^[transformR90",
|
minetest.register_tool("default:shovel_".. mat, {
|
||||||
tool_capabilities = {
|
description = S(tool.desc),
|
||||||
full_punch_interval = 1.4,
|
inventory_image = "default_tool_".. mat .."shovel.png",
|
||||||
max_drop_level=0,
|
wield_image = "default_tool_".. mat .."shovel.png^[transformR90",
|
||||||
groupcaps={
|
tool_capabilities = {
|
||||||
crumbly = {times={[1]=1.80, [2]=1.20, [3]=0.50}, uses=20, maxlevel=1},
|
full_punch_interval = tool.punch,
|
||||||
|
max_drop_level = tool.drop,
|
||||||
|
groupcaps={
|
||||||
|
crumbly = tool.cap,
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy = tool.damage},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=2},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
},
|
groups = tool.groups
|
||||||
sound = {breaks = "default_tool_breaks"},
|
})
|
||||||
groups = {shovel = 1}
|
end
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_bronze", {
|
|
||||||
description = S("Bronze Shovel"),
|
|
||||||
inventory_image = "default_tool_bronzeshovel.png",
|
|
||||||
wield_image = "default_tool_bronzeshovel.png^[transformR90",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.1,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
crumbly = {times={[1]=1.65, [2]=1.05, [3]=0.45}, uses=25, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=3},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {shovel = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_steel", {
|
|
||||||
description = S("Steel Shovel"),
|
|
||||||
inventory_image = "default_tool_steelshovel.png",
|
|
||||||
wield_image = "default_tool_steelshovel.png^[transformR90",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.1,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=3},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {shovel = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_mese", {
|
|
||||||
description = S("Mese Shovel"),
|
|
||||||
inventory_image = "default_tool_meseshovel.png",
|
|
||||||
wield_image = "default_tool_meseshovel.png^[transformR90",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=3,
|
|
||||||
groupcaps={
|
|
||||||
crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {shovel = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:shovel_diamond", {
|
|
||||||
description = S("Diamond Shovel"),
|
|
||||||
inventory_image = "default_tool_diamondshovel.png",
|
|
||||||
wield_image = "default_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"},
|
|
||||||
groups = {shovel = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Axes
|
-- Axes
|
||||||
--
|
--
|
||||||
|
|
||||||
minetest.register_tool("default:axe_wood", {
|
local tool_axe = {
|
||||||
description = S("Wooden Axe"),
|
wood = {
|
||||||
inventory_image = "default_tool_woodaxe.png",
|
desc = "Wooden Axe",
|
||||||
tool_capabilities = {
|
punch = 1.0, drop = 0, damage = 2,
|
||||||
full_punch_interval = 1.0,
|
cap = {times={[2]=3.00, [3]=1.60}, uses=10, maxlevel=1},
|
||||||
max_drop_level=0,
|
groups = {flammable = 2},
|
||||||
groupcaps={
|
|
||||||
choppy = {times={[2]=3.00, [3]=1.60}, uses=10, maxlevel=1},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=2},
|
|
||||||
},
|
},
|
||||||
sound = {breaks = "default_tool_breaks"},
|
stone = {
|
||||||
groups = {axe = 1, flammable = 2}
|
desc = "Stone Axe",
|
||||||
})
|
punch = 1.2, drop = 0, damage = 3,
|
||||||
|
cap = {times={[1]=3.00, [2]=2.00, [3]=1.30}, uses=20, maxlevel=1},
|
||||||
|
},
|
||||||
|
bronze = {
|
||||||
|
desc = "Bronze Axe",
|
||||||
|
punch = 1.0, drop = 1, damage = 4,
|
||||||
|
cap = {times={[1]=2.75, [2]=1.70, [3]=1.15}, uses=20, maxlevel=2},
|
||||||
|
},
|
||||||
|
steel = {
|
||||||
|
desc = "Steel Axe",
|
||||||
|
punch = 1.0, drop = 1, damage = 4,
|
||||||
|
cap = {times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2},
|
||||||
|
},
|
||||||
|
mese = {
|
||||||
|
desc = "Mese Axe",
|
||||||
|
punch = 0.9, drop = 1, damage = 6,
|
||||||
|
cap = {times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3},
|
||||||
|
},
|
||||||
|
diamond = {
|
||||||
|
desc = "Diamond Axe",
|
||||||
|
punch = 0.9, drop = 1, damage = 7,
|
||||||
|
cap = {times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=3},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_tool("default:axe_stone", {
|
for mat, tool in pairs(tool_axe) do
|
||||||
description = S("Stone Axe"),
|
tool.groups = tool.groups or {}
|
||||||
inventory_image = "default_tool_stoneaxe.png",
|
tool.groups.axe = 1
|
||||||
tool_capabilities = {
|
minetest.register_tool("default:axe_".. mat, {
|
||||||
full_punch_interval = 1.2,
|
description = S(tool.desc),
|
||||||
max_drop_level=0,
|
inventory_image = "default_tool_".. mat .."axe.png",
|
||||||
groupcaps={
|
tool_capabilities = {
|
||||||
choppy={times={[1]=3.00, [2]=2.00, [3]=1.30}, uses=20, maxlevel=1},
|
full_punch_interval = tool.punch,
|
||||||
|
max_drop_level = tool.drop,
|
||||||
|
groupcaps={
|
||||||
|
choppy = tool.cap,
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy = tool.damage},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=3},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
},
|
groups = tool.groups
|
||||||
sound = {breaks = "default_tool_breaks"},
|
})
|
||||||
groups = {axe = 1}
|
end
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:axe_bronze", {
|
|
||||||
description = S("Bronze Axe"),
|
|
||||||
inventory_image = "default_tool_bronzeaxe.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
choppy={times={[1]=2.75, [2]=1.70, [3]=1.15}, uses=20, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {axe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:axe_steel", {
|
|
||||||
description = S("Steel Axe"),
|
|
||||||
inventory_image = "default_tool_steelaxe.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=4},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {axe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:axe_mese", {
|
|
||||||
description = S("Mese Axe"),
|
|
||||||
inventory_image = "default_tool_meseaxe.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.9,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=6},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {axe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:axe_diamond", {
|
|
||||||
description = S("Diamond Axe"),
|
|
||||||
inventory_image = "default_tool_diamondaxe.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.9,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=7},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {axe = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Swords
|
-- Swords
|
||||||
--
|
--
|
||||||
|
|
||||||
minetest.register_tool("default:sword_wood", {
|
local tool_sword = {
|
||||||
description = S("Wooden Sword"),
|
wood = {
|
||||||
inventory_image = "default_tool_woodsword.png",
|
desc = "Wooden Sword",
|
||||||
tool_capabilities = {
|
punch = 1.0, drop = 0, damage = 2,
|
||||||
full_punch_interval = 1,
|
cap = {times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
|
||||||
max_drop_level=0,
|
groups = {flammable = 2},
|
||||||
groupcaps={
|
|
||||||
snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=2},
|
|
||||||
},
|
},
|
||||||
sound = {breaks = "default_tool_breaks"},
|
stone = {
|
||||||
groups = {sword = 1, flammable = 2}
|
desc = "Stone Sword",
|
||||||
})
|
punch = 1.2, drop = 0, damage = 4,
|
||||||
|
cap = {times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1},
|
||||||
|
},
|
||||||
|
bronze = {
|
||||||
|
desc = "Bronze Sword",
|
||||||
|
punch = 0.8, drop = 1, damage = 6,
|
||||||
|
cap = {times={[1]=2.75, [2]=1.30, [3]=0.375}, uses=25, maxlevel=2},
|
||||||
|
},
|
||||||
|
steel = {
|
||||||
|
desc = "Steel Sword",
|
||||||
|
punch = 0.8, drop = 1, damage = 6,
|
||||||
|
cap = {times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
|
||||||
|
},
|
||||||
|
mese = {
|
||||||
|
desc = "Mese Sword",
|
||||||
|
punch = 0.7, drop = 1, damage = 7,
|
||||||
|
cap = {times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
|
||||||
|
},
|
||||||
|
diamond = {
|
||||||
|
desc = "Diamond Sword",
|
||||||
|
punch = 0.7, drop = 1, damage = 8,
|
||||||
|
cap = {times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_tool("default:sword_stone", {
|
for mat, tool in pairs(tool_sword) do
|
||||||
description = S("Stone Sword"),
|
tool.groups = tool.groups or {}
|
||||||
inventory_image = "default_tool_stonesword.png",
|
tool.groups.sword = 1
|
||||||
tool_capabilities = {
|
minetest.register_tool("default:sword_".. mat, {
|
||||||
full_punch_interval = 1.2,
|
description = S(tool.desc),
|
||||||
max_drop_level=0,
|
inventory_image = "default_tool_".. mat .."sword.png",
|
||||||
groupcaps={
|
tool_capabilities = {
|
||||||
snappy={times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1},
|
full_punch_interval = tool.punch,
|
||||||
|
max_drop_level = tool.drop,
|
||||||
|
groupcaps={
|
||||||
|
snappy = tool.cap,
|
||||||
|
},
|
||||||
|
damage_groups = {fleshy = tool.damage},
|
||||||
},
|
},
|
||||||
damage_groups = {fleshy=4},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
},
|
groups = tool.groups
|
||||||
sound = {breaks = "default_tool_breaks"},
|
})
|
||||||
groups = {sword = 1}
|
end
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:sword_bronze", {
|
|
||||||
description = S("Bronze Sword"),
|
|
||||||
inventory_image = "default_tool_bronzesword.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.8,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
snappy={times={[1]=2.75, [2]=1.30, [3]=0.375}, uses=25, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=6},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {sword = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:sword_steel", {
|
|
||||||
description = S("Steel Sword"),
|
|
||||||
inventory_image = "default_tool_steelsword.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.8,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=6},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {sword = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:sword_mese", {
|
|
||||||
description = S("Mese Sword"),
|
|
||||||
inventory_image = "default_tool_mesesword.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.7,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=7},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {sword = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("default:sword_diamond", {
|
|
||||||
description = S("Diamond Sword"),
|
|
||||||
inventory_image = "default_tool_diamondsword.png",
|
|
||||||
tool_capabilities = {
|
|
||||||
full_punch_interval = 0.7,
|
|
||||||
max_drop_level=1,
|
|
||||||
groupcaps={
|
|
||||||
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
|
|
||||||
},
|
|
||||||
damage_groups = {fleshy=8},
|
|
||||||
},
|
|
||||||
sound = {breaks = "default_tool_breaks"},
|
|
||||||
groups = {sword = 1}
|
|
||||||
})
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Register Craft Recipies
|
-- Register Craft Recipies
|
||||||
|
|
Loading…
Add table
Reference in a new issue