Add translator credits
[minetest_mtg_plus.git] / ladders.lua
blob020e8447511be4b72bc68a981763caee0d61f9d1
1 local S = minetest.get_translator("mtg_plus")
3 local metal_sounds, wood_sounds
4 if default.node_sound_metal_defaults then
5 metal_sounds = default.node_sound_metal_defaults()
6 else
7 metal_sounds = default.node_sound_stone_defaults()
8 end
9 wood_sounds = default.node_sound_wood_defaults()
11 -- Ladders
12 minetest.register_node("mtg_plus:ladder_papyrus", {
13 description = S("Papyrus Ladder"),
14 _doc_items_longdesc = S("A particulary strong piece of ladder which allows you to move vertically."),
15 drawtype = "signlike",
16 tiles = {"mtg_plus_ladder_papyrus.png"},
17 inventory_image = "mtg_plus_ladder_papyrus.png",
18 wield_image = "mtg_plus_ladder_papyrus.png",
19 paramtype = "light",
20 paramtype2 = "wallmounted",
21 sunlight_propagates = true,
22 walkable = false,
23 climbable = true,
24 is_ground_content = false,
25 selection_box = { type = "wallmounted", },
26 groups = { snappy = 2, choppy = 1, flammable = 2 },
27 sounds = default.node_sound_leaves_defaults(),
30 minetest.register_craft({
31 output = "mtg_plus:ladder_papyrus 2",
32 recipe = { {"default:papyrus", "", "default:papyrus"},
33 {"farming:string", "default:papyrus", "farming:string"},
34 {"default:papyrus", "", "default:papyrus"}},
37 minetest.register_craft({
38 type = "fuel",
39 recipe = "mtg_plus:ladder_papyrus",
40 burntime = 2,
43 local simple_ladders = {
44 { "gold", "metal", S("Golden Ladder"), "default:gold_ingot", { cracky = 3 }, true },
45 { "bronze", "metal", S("Bronze Ladder"), "default:bronze_ingot", { cracky = 2 } },
46 { "copper", "metal", S("Copper Ladder"), "default:copper_ingot", { cracky = 2 } },
47 { "tin", "metal", S("Tin Ladder"), "default:tin_ingot", { cracky = 2 } },
48 { "aspen_wood", "wood", S("Aspen Wood Ladder"), "default:aspen_wood", { choppy = 3, flammable = 1 }, nil, 5 },
49 { "acacia_wood", "wood", S("Acacia Wood Ladder"), "default:acacia_wood", { choppy = 3, flammable = 1 }, nil, 8 },
50 { "pine_wood", "wood", S("Pine Wood Ladder"), "default:pine_wood", { choppy = 3, flammable = 1 }, nil, 6 },
51 { "junglewood", "wood", S("Jungle Wood Ladder"), "default:junglewood", { choppy = 3, flammable = 1 }, nil, 9 },
52 { "goldwood", "wood", S("Goldwood Ladder"), "mtg_plus:goldwood", { choppy = 2 }, true },
55 for m=1, #simple_ladders do
56 local ladder = simple_ladders[m]
57 local longdesc
58 if ladder[6] then
59 longdesc = S("A luxurious piece of ladder which allows you to move vertically.")
60 else
61 longdesc = S("A piece of ladder which allows you to move vertically.")
62 end
63 if ladder[2] == "metal" then
64 sounds = metal_sounds
65 else
66 sounds = wood_sounds
67 end
68 minetest.register_node("mtg_plus:ladder_"..ladder[1], {
69 description = ladder[3],
70 _doc_items_longdesc = longdesc,
71 drawtype = "signlike",
72 tiles = {"mtg_plus_ladder_"..ladder[1]..".png"},
73 inventory_image = "mtg_plus_ladder_"..ladder[1]..".png",
74 wield_image = "mtg_plus_ladder_"..ladder[1]..".png",
75 paramtype = "light",
76 paramtype2 = "wallmounted",
77 sunlight_propagates = true,
78 walkable = false,
79 climbable = true,
80 is_ground_content = false,
81 selection_box = { type = "wallmounted", },
82 groups = ladder[5],
83 sounds = sounds,
85 if ladder[2] == "metal" then
86 minetest.register_craft({
87 output = "mtg_plus:ladder_"..ladder[1].." 15",
88 recipe = {
89 {ladder[4], "", ladder[4]},
90 {ladder[4], ladder[4], ladder[4]},
91 {ladder[4], "", ladder[4]},
94 else
95 minetest.register_craft({
96 output = "mtg_plus:ladder_"..ladder[1].." 9",
97 recipe = {
98 {"group:stick", "", "group:stick"},
99 {"group:stick", ladder[4], "group:stick"},
100 {"group:stick", "", "group:stick"},
103 if ladder[7] ~= nil then
104 minetest.register_craft({
105 type = "fuel",
106 recipe = "mtg_plus:ladder_"..ladder[1],
107 burntime = ladder[7],
113 -- Tweak the default ladder
114 minetest.override_item("default:ladder_wood", { description = S("Apple Wood Ladder") })
115 minetest.register_craft({
116 output = "default:ladder_wood 9",
117 recipe = {
118 {"group:stick", "", "group:stick"},
119 {"group:stick", "default:wood", "group:stick"},
120 {"group:stick", "", "group:stick"},
124 -- The default stick-only recipe for default ladder will be intentionally kept for
125 -- convenience.