]> git.lizzy.rs Git - Crafter.git/blob - mods/nether/nodes.lua
rebalance ores/pickaxes
[Crafter.git] / mods / nether / nodes.lua
1
2 minetest.register_node("nether:bedrock", {
3     description = "Bedrock",
4     tiles = {"bedrock.png"},
5     groups = {unbreakable = 1, pathable = 1},
6     sounds = main.stoneSound(),
7     is_ground_content = false,
8     --light_source = 14, --debugging
9 })
10
11
12 minetest.register_node("nether:netherrack", {
13     description = "Netherrack",
14     tiles = {"netherrack.png"},
15     groups = {netherrack = 1, pathable = 1},
16     sounds = main.stoneSound(),
17     is_ground_content = false,
18     light_source = 7,
19     drop = {
20                         max_items = 1,
21                         items= {
22                                 {
23                                         rarity = 0,
24                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
25                                         items = {"nether:netherrack"},
26                                 },
27                                 },
28                         },
29 })
30 minetest.register_node("nether:glowstone", {
31     description = "Glowstone",
32     tiles = {"glowstone.png"},
33     groups = {glass = 1, pathable = 1},
34     sounds = main.stoneSound({
35                 footstep = {name = "glass_footstep", gain = 0.4},
36         dug =  {name = "break_glass", gain = 0.4},
37         }),
38     is_ground_content = false,
39     light_source = 12,
40     after_destruct = function(pos, oldnode)
41                 destroy_aether_portal(pos)
42     end,
43     drop = {
44                         max_items = 5,
45                         items= {
46                                 {
47                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
48                                         items = {"nether:glowstone_dust"},
49                                 },
50                                 {
51                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
52                                         items = {"nether:glowstone_dust"},
53                                 },
54                                 {
55                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
56                                         items = {"nether:glowstone_dust"},
57                                 },
58                                 {
59                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
60                                         items = {"nether:glowstone_dust"},
61                                 },
62                                 {
63                                         rarity = 5,
64                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
65                                         items = {"nether:glowstone_dust"},
66                                 },
67                         },
68                 }
69 })
70
71 minetest.register_node("nether:obsidian", {
72     description = "Obsidian",
73     tiles = {"obsidian.png"},
74     groups = {obsidian = 1, pathable = 1},
75     --groups = {stone = 1, pathable = 1}, --leave this here for debug
76     sounds = main.stoneSound(),
77     is_ground_content = false,
78     after_destruct = function(pos, oldnode)
79                 destroy_nether_portal(pos)
80     end,
81     --light_source = 7,
82 })
83
84
85 minetest.register_node("nether:lava", {
86         description = "Lava",
87         drawtype = "liquid",
88         tiles = {
89                 {
90                         name = "lava_source.png",
91                         backface_culling = false,
92                         animation = {
93                                 type = "vertical_frames",
94                                 aspect_w = 16,
95                                 aspect_h = 16,
96                                 length = 2.0,
97                         },
98                 },
99                 {
100                         name = "lava_source.png",
101                         backface_culling = true,
102                         animation = {
103                                 type = "vertical_frames",
104                                 aspect_w = 16,
105                                 aspect_h = 16,
106                                 length = 2.0,
107                         },
108                 },
109         },
110         paramtype = "light",
111         light_source = 13,
112         walkable = false,
113         pointable = false,
114         diggable = false,
115         buildable_to = true,
116         is_ground_content = false,
117         drop = "",
118         drowning = 1,
119         liquidtype = "source",
120         liquid_alternative_flowing = "nether:lavaflow",
121         liquid_alternative_source = "nether:lava",
122         liquid_viscosity = 1,
123         liquid_renewable = true,
124         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
125         groups = {lava = 3, liquid = 2, igniter = 1, fire=1,hurt_inside=1},
126 })
127
128 minetest.register_node("nether:lavaflow", {
129         description = "Flowing Lava",
130         drawtype = "flowingliquid",
131         tiles = {"lava_flow.png"},
132         special_tiles = {
133                 {
134                         name = "lava_flow.png",
135                         backface_culling = false,
136                         animation = {
137                                 type = "vertical_frames",
138                                 aspect_w = 16,
139                                 aspect_h = 16,
140                                 length = 3.3,
141                         },
142                 },
143                 {
144                         name = "lava_flow.png",
145                         backface_culling = true,
146                         animation = {
147                                 type = "vertical_frames",
148                                 aspect_w = 16,
149                                 aspect_h = 16,
150                                 length = 3.3,
151                         },
152                 },
153         },
154         selection_box = {
155             type = "fixed",
156             fixed = {
157                 {0, 0, 0, 0, 0, 0},
158             },
159         },
160         paramtype = "light",
161         paramtype2 = "flowingliquid",
162         light_source = 13,
163         walkable = false,
164         pointable = false,
165         diggable = false,
166         buildable_to = true,
167         is_ground_content = false,
168         drop = "",
169         drowning = 1,
170         liquidtype = "flowing",
171         liquid_alternative_flowing = "nether:lavaflow",
172         liquid_alternative_source = "nether:lava",
173         liquid_viscosity = 1,
174         liquid_renewable = true,
175         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
176         groups = {lava = 3, liquid = 2, igniter = 1, fire=1,hurt_inside=1},
177 })
178
179 local ores = {"redstone_","coal","iron","gold","diamond"}
180 local tool = {"main:woodpick","main:stonepick","main:ironpick","main:goldpick","main:diamondpick"}
181 for id,ore in pairs(ores) do
182
183         if id > 1 then
184                 id = id - 1
185         end
186         local tool_required = {}
187         for i = id,5 do
188                 table.insert(tool_required, tool[i])
189         end
190
191         
192
193         local drops = {
194                         max_items = 1,
195                         items= {
196                                 {
197                                         rarity = 0,
198                                         tools = tool_required,
199                                         items = {"nether:"..ore.."ore"},
200                                 },
201                                 },
202                         }
203         if ore == "diamond" then 
204                 drops = {
205                         max_items = 1,
206                         items= {
207                                 {
208                                         rarity = 0,
209                                         tools = tool_required,
210                                         items = {"main:diamond"},
211                                 },
212                                 },
213                         }
214         elseif ore == "coal" then 
215                 drops = {
216                         max_items = 1,
217                         items= {
218                                 {
219                                         rarity = 0,
220                                         tools = tool_required,
221                                         items = {"main:coal"},
222                                 },
223                                 },
224                         }
225         elseif ore == "redstone_" then
226                 drops = {
227                         max_items = 5,
228                         tools = tool_required,
229                         items= {
230                                 {
231                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
232                                         items = {"redstone:dust"},
233                                 },
234                                 {
235                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
236                                         items = {"redstone:dust"},
237                                 },
238                                 {
239                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
240                                         items = {"redstone:dust"},
241                                 },
242                                 {
243                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
244                                         items = {"redstone:dust"},
245                                 },
246                                 {
247                                         rarity = 5,
248                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
249                                         items = {"redstone:dust"},
250                                 },
251                         },
252                 }
253         end
254         
255         minetest.register_node("nether:"..ore.."ore", {
256                 description = ore:gsub("^%l", string.upper).." Ore",
257                 tiles = {"netherrack.png^"..ore.."ore.png"},
258                 groups = {netherrack = id, pathable = 1, experience = id*2},
259                 sounds = main.stoneSound(),
260                 light_source = 7,
261                 drop = drops,
262                 after_destruct = function(pos, oldnode)
263                         if math.random() > 0.95 then
264                                 minetest.sound_play("tnt_ignite")
265                                 minetest.after(1.5, function(pos)
266                                         tnt(pos,5)
267                                 end,pos)
268                         end
269                 end,
270         })
271 end
272
273 local colorize_ratio = 125
274 minetest.register_node("nether:tree", {
275     description = "Nether Tree",
276     tiles = {"treeCore.png^[colorize:red:"..colorize_ratio,"treeCore.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio},
277     groups = {wood = 1, tree = 1, pathable = 1},
278     sounds = main.woodSound(),
279     --set metadata so treecapitator doesn't destroy houses
280     on_place = function(itemstack, placer, pointed_thing)
281                 if not pointed_thing.type == "node" then
282                         return
283                 end
284                 
285                 local sneak = placer:get_player_control().sneak
286                 local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
287                 if not sneak and noddef.on_rightclick then
288                         minetest.item_place(itemstack, placer, pointed_thing)
289                         return
290                 end
291                 
292                 local pos = pointed_thing.above
293                 minetest.item_place_node(itemstack, placer, pointed_thing)
294                 local meta = minetest.get_meta(pos)
295                 meta:set_string("placed", "true")       
296                 return(itemstack)
297         end,
298         light_source = 7,
299         --treecapitator - move treecapitator into own file using override
300         on_dig = function(pos, node, digger)
301         
302                 --check if wielding axe?
303                 
304                 local meta = minetest.get_meta(pos)
305                 if not meta:contains("placed") then
306                         --remove tree
307                         for y = -6,6 do
308                                 local name = minetest.get_node(vector.new(pos.x,pos.y+y,pos.z)).name
309                                 --print(y)
310                                 if name == "nether:tree" then
311                                         minetest.node_dig(vector.new(pos.x,pos.y+y,pos.z), node, digger)
312                                 end
313                         end
314                 else
315                         minetest.node_dig(pos, node, digger)
316                 end     
317         end
318 })
319
320 minetest.register_node("nether:wood", {
321     description = "Nether Wood",
322     tiles = {"wood.png^[colorize:red:"..colorize_ratio},
323     groups = {wood = 1, pathable = 1},
324     sounds = main.woodSound(),
325     light_source = 7,
326 })
327
328
329 minetest.register_node("nether:leaves", {
330     description = "Nether Leaves",
331     drawtype = "allfaces_optional",
332         waving = 1,
333         walkable = false,
334         climbable = true,
335         paramtype = "light",
336         is_ground_content = false,      
337     tiles = {"leaves.png^[colorize:red:"..colorize_ratio},
338     groups = {leaves = 1, leafdecay = 1},
339     sounds = main.grassSound(),
340     light_source = 7,
341     drop = {
342                 max_items = 1,
343                 items= {
344                  {
345                         -- Only drop if using a tool whose name is identical to one
346                         -- of these.
347                         rarity = 10,
348                         items = {"main:sapling"},
349                         -- Whether all items in the dropped item list inherit the
350                         -- hardware coloring palette color from the dug node.
351                         -- Default is 'false'.
352                         --inherit_color = true,
353                 },
354                 {
355                         -- Only drop if using a tool whose name is identical to one
356                         -- of these.
357                         tools = {"main:shears"},
358                         rarity = 2,
359                         items = {"main:leaves"},
360                         -- Whether all items in the dropped item list inherit the
361                         -- hardware coloring palette color from the dug node.
362                         -- Default is 'false'.
363                         --inherit_color = true,
364                 },
365                 {
366                         -- Only drop if using a tool whose name is identical to one
367                         -- of these.
368                         tools = {"main:shears"},
369                         rarity = 2,
370                         items = {"main:stick"},
371                         -- Whether all items in the dropped item list inherit the
372                         -- hardware coloring palette color from the dug node.
373                         -- Default is 'false'.
374                         --inherit_color = true,
375                 },
376                 {
377                         -- Only drop if using a tool whose name is identical to one
378                         -- of these.
379                         tools = {"main:shears"},
380                         rarity = 6,
381                         items = {"main:apple"}, --golden apples
382                         -- Whether all items in the dropped item list inherit the
383                         -- hardware coloring palette color from the dug node.
384                         -- Default is 'false'.
385                         --inherit_color = true,
386                 },
387                 },
388     },
389 })