Camas/mods/jewels/jewels.lua

332 lines
9.8 KiB
Lua
Raw Normal View History

--
-- Jeweled tool defs
--
2019-08-28 17:31:41 +02:00
local S = minetest.get_translator("jewels")
-- Automatic jeweling on specific tools
2020-01-31 05:25:28 +01:00
-- Adjectives:
-- * Swift: lower dig speed
-- * Harming: more damage
-- * Durable: more uses
-- * Ranged: higher range
local tool_types = {
pick = {
steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Steel Pickaxe"),
digspeed = -0.1,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Steel Pickaxe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_pick_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 1,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Steel Pickaxe"),
uses = 3,
},
},
carbon_steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Carbon Steel Pickaxe"),
digspeed = -0.13,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Carbon Steel Pickaxe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_pick_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 2,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Carbon Steel Pickaxe"),
uses = 5,
},
},
bronze = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Bronze Pickaxe"),
digspeed = -0.14,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Bronze Pickaxe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_pick_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 3,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Bronze Pickaxe"),
uses = 6,
},
},
},
shovel = {
steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Steel Shovel"),
digspeed = -0.1,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Steel Shovel"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shovel_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 1,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Steel Shovel"),
uses = 3,
},
},
carbon_steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Carbon Steel Shovel"),
digspeed = -0.13,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Carbon Steel Shovel"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shovel_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 2,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Carbon Steel Shovel"),
uses = 5,
},
},
bronze = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Bronze Shovel"),
digspeed = -0.14,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Bronze Shovel"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shovel_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 3,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Bronze Shovel"),
uses = 6,
},
},
},
axe = {
steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Steel Axe"),
digspeed = -0.1,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Steel Axe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_axe_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 2,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Steel Axe"),
uses = 3,
},
},
carbon_steel = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Carbon Steel Axe"),
digspeed = -0.13,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Carbon Steel Axe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_axe_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 3,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Carbon Steel Axe"),
uses = 5,
},
},
bronze = {
digspeed = {
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Bronze Axe"),
digspeed = -0.14,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Bronze Axe"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_axe_damage.png",
2017-05-18 19:40:40 +02:00
fleshy = 4,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Bronze Axe"),
uses = 6,
},
},
},
spear = {
steel = {
reach = {
overlay = "jewels_jeweled_spear_reach.png",
overlay_wield = "jewels_jeweled_spear_reach.png^[transformR90",
description = S("Extended Jewel Steel Spear"),
2019-09-21 23:39:31 +02:00
range = 1,
},
damage = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_spear_damage.png",
overlay_wield = "jewels_jeweled_spear_damage.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Steel Spear"),
2017-05-18 19:40:40 +02:00
fleshy = 3,
},
uses = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_handle_uses.png",
overlay_wield = "jewels_jeweled_handle_uses.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Steel Spear"),
uses = 3,
},
},
carbon_steel = {
reach = {
description = S("Extended Jewel Carbon Steel Spear"),
overlay = "jewels_jeweled_spear_reach.png",
overlay_wield = "jewels_jeweled_spear_reach.png^[transformR90",
2019-09-21 23:39:31 +02:00
range = 2,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Carbon Steel Spear"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_spear_damage.png",
overlay_wield = "jewels_jeweled_spear_damage.png^[transformR90",
2017-05-18 19:40:40 +02:00
fleshy = 4,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Carbon Steel Spear"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_handle_uses.png",
overlay_wield = "jewels_jeweled_handle_uses.png^[transformR90",
uses = 5,
},
},
bronze = {
reach = {
description = S("Extended Jewel Bronze Spear"),
overlay = "jewels_jeweled_spear_reach.png",
overlay_wield = "jewels_jeweled_spear_reach.png^[transformR90",
2019-09-21 23:39:31 +02:00
range = 2,
},
damage = {
2020-01-31 05:25:28 +01:00
description = S("Harming Jewel Bronze Spear"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_spear_damage.png",
overlay_wield = "jewels_jeweled_spear_damage.png^[transformR90",
2017-05-18 19:40:40 +02:00
fleshy = 5,
},
uses = {
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Bronze Spear"),
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_handle_uses.png",
overlay_wield = "jewels_jeweled_handle_uses.png^[transformR90",
uses = 6,
},
},
},
2019-09-24 04:06:17 +02:00
shears = {
steel = {
digspeed = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_digspeed.png",
overlay_wield = "jewels_jeweled_shears_digspeed.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Steel Shears"),
2019-09-24 04:06:17 +02:00
digspeed = -0.1,
},
uses = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_uses.png",
overlay_wield = "jewels_jeweled_shears_uses.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Steel Shears"),
2019-09-24 04:06:17 +02:00
uses = 3,
},
},
carbon_steel = {
digspeed = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_digspeed.png",
overlay_wield = "jewels_jeweled_shears_digspeed.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Carbon Steel Shears"),
2019-09-24 04:06:17 +02:00
digspeed = -0.13,
},
uses = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_uses.png",
overlay_wield = "jewels_jeweled_shears_uses.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Carbon Steel Shears"),
2019-09-24 04:06:17 +02:00
uses = 5,
},
},
bronze = {
digspeed = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_digspeed.png",
overlay_wield = "jewels_jeweled_shears_digspeed.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Swift Jewel Bronze Shears"),
2019-09-24 04:06:17 +02:00
digspeed = -0.14,
},
uses = {
2020-01-31 07:33:08 +01:00
overlay = "jewels_jeweled_shears_uses.png",
overlay_wield = "jewels_jeweled_shears_uses.png^[transformR90",
2020-01-31 05:25:28 +01:00
description = S("Durable Jewel Bronze Shears"),
2019-09-24 04:06:17 +02:00
uses = 6,
},
},
}
}
for tool_name, tool_def in pairs(tool_types) do
for material_name, material_def in pairs(tool_def) do
for jewel_name, jewel_def in pairs(material_def) do
local description = jewel_def.description
local overlay = jewel_def.overlay
local overlay_wield = jewel_def.overlay_wield
jewel_def.description = nil
jewel_def.overlay = nil
jewel_def.overlay_wield = nil
2020-01-31 07:33:08 +01:00
if not overlay then
if jewel_name == "damage" then
overlay = "jewels_jeweled_handle_damage.png"
elseif jewel_name == "uses" then
overlay = "jewels_jeweled_handle_uses.png"
end
end
jewels.register_jewel(
"default:" .. tool_name .. "_" .. material_name,
"jewels:" .. tool_name .. "_" .. material_name .. "_" .. jewel_name,
{
stats = jewel_def,
description = description,
overlay = overlay,
overlay_wield = overlay_wield,
}
)
end
end
end
2015-10-19 20:46:45 +02:00
-- Broadswords
jewels.register_jewel(
"default:broadsword",
"jewels:broadsword_jeweled_pommel",
{
2020-01-31 05:25:28 +01:00
description = S("Pommel Jewel Broadsword"),
2015-10-19 20:46:45 +02:00
overlay = "jewels_jeweled_pommel.png",
stats = {
fleshy = 2,
}
})
2015-10-19 20:46:45 +02:00
jewels.register_jewel(
"jewels:broadsword_jeweled_pommel",
"jewels:broadsword_jeweled_pommel_and_guard",
{
2020-01-31 05:25:28 +01:00
description = S("Pommel&Guard Jewel Broadsword"),
2015-10-19 20:46:45 +02:00
overlay = "jewels_jeweled_guard.png",
stats = {
range = 1,
}
})
2015-10-19 20:46:45 +02:00
jewels.register_jewel(
"jewels:broadsword_jeweled_pommel_and_guard",
"jewels:serrated_broadsword",
{
2020-01-31 05:25:28 +01:00
description = S("Serrated Jewel Broadsword"),
2015-10-19 20:46:45 +02:00
overlay = "jewels_jeweled_blade.png",
stats = {
fleshy = 2,
range = 1,
}
})
2015-10-19 20:46:45 +02:00
default.log("jewels", "loaded")