mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-25 01:30:17 +01:00
add basic growth system
This commit is contained in:
parent
08d85dd655
commit
0104dcbb90
237
plants.lua
237
plants.lua
@ -14,7 +14,7 @@ minetest.register_node("dfcaverns:dead_fungus", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1},
|
groups = {flammable=4, oddly_breakable_by_hand=1, plant = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -22,46 +22,67 @@ minetest.register_node("dfcaverns:dead_fungus", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:dead_fungus",
|
||||||
|
burntime = 2
|
||||||
|
})
|
||||||
|
|
||||||
|
local register_seed = function(name, description, image, stage_one)
|
||||||
local register_seed = function(name, description, image)
|
local def = {
|
||||||
minetest.register_node("dfcaverns:"..name, {
|
|
||||||
description = description,
|
description = description,
|
||||||
tiles = {image},
|
tiles = {image},
|
||||||
inventory_image = image,
|
inventory_image = image,
|
||||||
drawtype = "signlike",
|
drawtype = "signlike",
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1},
|
|
||||||
paramtype = "light",
|
|
||||||
paramtype2 = "wallmounted",
|
paramtype2 = "wallmounted",
|
||||||
|
groups = {flammable=4, oddly_breakable_by_hand=1},
|
||||||
|
_dfcaverns_next_stage = stage_one,
|
||||||
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:"..name, def)
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:"..name,
|
||||||
|
burntime = 1
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local register_grow_abm = function(names, interval, chance)
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = names,
|
||||||
|
interval = interval,
|
||||||
|
chance = chance,
|
||||||
|
action = function(pos, node)
|
||||||
|
pos.y = pos.y-1
|
||||||
|
if minetest.get_node(pos).name ~= "farming:soil_wet" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local node_def = minetest.registered_nodes[node.name]
|
||||||
|
local next_stage = node_def._dfcaverns_next_stage
|
||||||
|
if next_stage then
|
||||||
|
local next_def = minetest.registered_nodes[next_stage]
|
||||||
|
pos.y = pos.y+1
|
||||||
|
minetest.swap_node(pos, {name=next_stage, param2 = next_def.place_param2 or node.param2})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Cave wheat
|
-- Cave wheat
|
||||||
|
|
||||||
-- stalks. White
|
-- stalks. White
|
||||||
|
|
||||||
--farming.register_plant("dfcaverns:cave_wheat", {
|
local wheat_names = {}
|
||||||
-- description = "Cave wheat seed",
|
|
||||||
-- paramtype2 = "meshoptions",
|
|
||||||
-- inventory_image = "dfcaverns_cave_wheat_seed.png",
|
|
||||||
-- steps = 8,
|
|
||||||
-- minlight = 0,
|
|
||||||
-- maxlight = 8,
|
|
||||||
-- fertility = {"grassland", "desert"},
|
|
||||||
-- groups = {flammable = 4},
|
|
||||||
-- place_param2 = 3,
|
|
||||||
--})
|
|
||||||
|
|
||||||
|
|
||||||
local register_cave_wheat = function(number)
|
local register_cave_wheat = function(number)
|
||||||
minetest.register_node("dfcaverns:cave_wheat_"..tostring(number), {
|
local def = {
|
||||||
description = S("Cave Wheat"),
|
description = S("Cave Wheat"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
paramtype2 = "meshoptions",
|
paramtype2 = "meshoptions",
|
||||||
@ -72,71 +93,126 @@ local register_cave_wheat = function(number)
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
drop = {
|
||||||
|
max_items = 1,
|
||||||
|
items = {
|
||||||
|
{
|
||||||
|
items = {'dfcaverns:cave_wheat_seed 2', 'dfcaverns:cave_wheat'},
|
||||||
|
rarity = 9-number,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
items = {'dfcaverns:cave_wheat_seed 1', 'dfcaverns:cave_wheat'},
|
||||||
|
rarity = 9-number,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
items = {'dfcaverns:cave_wheat_seed'},
|
||||||
|
rarity = 9-number,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if number < 8 then
|
||||||
|
def._dfcaverns_next_stage = "dfcaverns:cave_wheat_"..tostring(number+1)
|
||||||
|
table.insert(wheat_names, "dfcaverns:cave_wheat_"..tostring(number))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:cave_wheat_"..tostring(number), def)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,8 do
|
for i = 1,8 do
|
||||||
register_cave_wheat(i)
|
register_cave_wheat(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_seed("cave_wheat_seed", S("Cave Wheat Seed"), "dfcaverns_cave_wheat_seed.png")
|
register_seed("cave_wheat_seed", S("Cave Wheat Seed"), "dfcaverns_cave_wheat_seed.png", "dfcaverns:cave_wheat_1")
|
||||||
|
table.insert(wheat_names, "dfcaverns:cave_wheat_seed")
|
||||||
|
|
||||||
|
register_grow_abm(wheat_names, 10, 1)
|
||||||
|
|
||||||
minetest.register_craftitem("dfcaverns:cave_wheat", {
|
minetest.register_craftitem("dfcaverns:cave_wheat", {
|
||||||
description = S("Cave Wheat"),
|
description = S("Cave Wheat"),
|
||||||
inventory_image = "dfcaverns_cave_wheat.png",
|
inventory_image = "dfcaverns_cave_wheat.png",
|
||||||
stack_max = 99,
|
stack_max = 99,
|
||||||
})
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:cave_wheat",
|
||||||
|
burntime = 2
|
||||||
|
})
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Dimple cup
|
-- Dimple cup
|
||||||
|
|
||||||
-- royal blue
|
-- royal blue
|
||||||
|
|
||||||
|
local dimple_names = {}
|
||||||
|
|
||||||
local register_dimple_cup = function(number)
|
local register_dimple_cup = function(number)
|
||||||
minetest.register_node("dfcaverns:dimple_cups_"..tostring(number), {
|
local def = {
|
||||||
description = S("Dimple Cups"),
|
description = S("Dimple Cup"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
tiles = {"dfcaverns_dimple_cups_"..tostring(number)..".png"},
|
tiles = {"dfcaverns_dimple_cup_"..tostring(number)..".png"},
|
||||||
inventory_image = "dfcaverns_dimple_cups_"..tostring(number)..".png",
|
inventory_image = "dfcaverns_dimple_cup_"..tostring(number)..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if number < 4 then
|
||||||
|
def._dfcaverns_next_stage = "dfcaverns:dimple_cup_"..tostring(number+1)
|
||||||
|
table.insert(dimple_names, "dfcaverns:dimple_cup_"..tostring(number))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:dimple_cup_"..tostring(number), def)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,4 do
|
for i = 1,4 do
|
||||||
register_dimple_cup(i)
|
register_dimple_cup(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_seed("dimple_cup_seed", S("Dimple Cup Spores"), "dfcaverns_dimple_cups_seed.png")
|
register_seed("dimple_cup_seed", S("Dimple Cup Spores"), "dfcaverns_dimple_cup_seed.png", "dfcaverns:dimple_cup_1")
|
||||||
|
table.insert(dimple_names, "dfcaverns:dimple_cup_seed")
|
||||||
|
|
||||||
|
register_grow_abm(dimple_names, 10, 1)
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Pig tail
|
-- Pig tail
|
||||||
|
|
||||||
-- Twisting stalks. Gray
|
-- Twisting stalks. Gray
|
||||||
|
|
||||||
|
local pig_tail_names = {}
|
||||||
|
|
||||||
local register_pig_tail = function(number)
|
local register_pig_tail = function(number)
|
||||||
minetest.register_node("dfcaverns:pig_tails_"..tostring(number), {
|
local def = {
|
||||||
description = S("Pig Tails"),
|
description = S("Pig Tail"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
paramtype2 = "meshoptions",
|
paramtype2 = "meshoptions",
|
||||||
place_param2 = 3,
|
place_param2 = 3,
|
||||||
tiles = {"dfcaverns_pigtails_"..tostring(number)..".png"},
|
tiles = {"dfcaverns_pig_tail_"..tostring(number)..".png"},
|
||||||
inventory_image = "dfcaverns_pigtails_"..tostring(number)..".png",
|
inventory_image = "dfcaverns_pig_tail_"..tostring(number)..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if number < 8 then
|
||||||
|
def._dfcaverns_next_stage = "dfcaverns:pig_tail_"..tostring(number+1)
|
||||||
|
table.insert(pig_tail_names, "dfcaverns:pig_tail_"..tostring(number))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:pig_tail_"..tostring(number), def)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,8 do
|
for i = 1,8 do
|
||||||
register_pig_tail(i)
|
register_pig_tail(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_seed("pig_tail_seed", S("Pig Tail Spore"), "dfcaverns_pigtail_seed.png")
|
register_seed("pig_tail_seed", S("Pig Tail Spore"), "dfcaverns_pig_tail_seed.png", "dfcaverns:pig_tail_1")
|
||||||
|
table.insert(pig_tail_names, "dfcaverns:pig_tail_seed")
|
||||||
|
|
||||||
|
register_grow_abm(pig_tail_names, 10, 1)
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Plump helmet
|
-- Plump helmet
|
||||||
@ -152,10 +228,12 @@ minetest.register_node("dfcaverns:plump_helmet_spawn", {
|
|||||||
tiles = {
|
tiles = {
|
||||||
"dfcaverns_plump_helmet_cap.png",
|
"dfcaverns_plump_helmet_cap.png",
|
||||||
},
|
},
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11, plant = 1},
|
||||||
|
_dfcaverns_next_stage = "dfcaverns:plump_helmet_1",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
walkable = false,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -167,7 +245,6 @@ minetest.register_node("dfcaverns:plump_helmet_spawn", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("dfcaverns:plump_helmet_1", {
|
minetest.register_node("dfcaverns:plump_helmet_1", {
|
||||||
description = S("Plump Helmet"),
|
description = S("Plump Helmet"),
|
||||||
tiles = {
|
tiles = {
|
||||||
@ -175,10 +252,12 @@ minetest.register_node("dfcaverns:plump_helmet_1", {
|
|||||||
"dfcaverns_plump_helmet_cap.png",
|
"dfcaverns_plump_helmet_cap.png",
|
||||||
"dfcaverns_plump_helmet_cap.png^[lowpart:5:dfcaverns_plump_helmet_stem.png",
|
"dfcaverns_plump_helmet_cap.png^[lowpart:5:dfcaverns_plump_helmet_stem.png",
|
||||||
},
|
},
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11, plant = 1},
|
||||||
|
_dfcaverns_next_stage = "dfcaverns:plump_helmet_2",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
walkable = false,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -199,10 +278,12 @@ minetest.register_node("dfcaverns:plump_helmet_2", {
|
|||||||
"dfcaverns_plump_helmet_cap.png",
|
"dfcaverns_plump_helmet_cap.png",
|
||||||
"dfcaverns_plump_helmet_cap.png^[lowpart:15:dfcaverns_plump_helmet_stem.png",
|
"dfcaverns_plump_helmet_cap.png^[lowpart:15:dfcaverns_plump_helmet_stem.png",
|
||||||
},
|
},
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11, plant = 1},
|
||||||
|
_dfcaverns_next_stage = "dfcaverns:plump_helmet_3",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
walkable = false,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -222,10 +303,12 @@ minetest.register_node("dfcaverns:plump_helmet_3", {
|
|||||||
"dfcaverns_plump_helmet_cap.png",
|
"dfcaverns_plump_helmet_cap.png",
|
||||||
"dfcaverns_plump_helmet_cap.png^[lowpart:35:dfcaverns_plump_helmet_stem.png",
|
"dfcaverns_plump_helmet_cap.png^[lowpart:35:dfcaverns_plump_helmet_stem.png",
|
||||||
},
|
},
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11, plant = 1},
|
||||||
|
_dfcaverns_next_stage = "dfcaverns:plump_helmet_4",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
walkable = false,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -245,10 +328,11 @@ minetest.register_node("dfcaverns:plump_helmet_4", {
|
|||||||
"dfcaverns_plump_helmet_cap.png",
|
"dfcaverns_plump_helmet_cap.png",
|
||||||
"dfcaverns_plump_helmet_cap.png^[lowpart:40:dfcaverns_plump_helmet_stem.png",
|
"dfcaverns_plump_helmet_cap.png^[lowpart:40:dfcaverns_plump_helmet_stem.png",
|
||||||
},
|
},
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11, plant = 1},
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
walkable = false,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
@ -262,6 +346,34 @@ minetest.register_node("dfcaverns:plump_helmet_4", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local plump_names = {"dfcaverns:plump_helmet_spawn", "dfcaverns:plump_helmet_1", "dfcaverns:plump_helmet_2", "dfcaverns:plump_helmet_3"}
|
||||||
|
register_grow_abm(plump_names, 10, 1)
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:plump_helmet_spawn",
|
||||||
|
burntime = 1
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:plump_helmet_1",
|
||||||
|
burntime = 2
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:plump_helmet_2",
|
||||||
|
burntime = 3
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:plump_helmet_3",
|
||||||
|
burntime = 4
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:plump_helmet_4",
|
||||||
|
burntime = 5
|
||||||
|
})
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Quarry Bush
|
-- Quarry Bush
|
||||||
@ -269,8 +381,10 @@ minetest.register_node("dfcaverns:plump_helmet_4", {
|
|||||||
-- Gray leaves
|
-- Gray leaves
|
||||||
-- Produces rock nuts
|
-- Produces rock nuts
|
||||||
|
|
||||||
|
local quarry_names = {}
|
||||||
|
|
||||||
local register_quarry_bush = function(number)
|
local register_quarry_bush = function(number)
|
||||||
minetest.register_node("dfcaverns:quarry_bush_"..tostring(number), {
|
local def = {
|
||||||
description = S("Quarry Bush"),
|
description = S("Quarry Bush"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
paramtype2 = "meshoptions",
|
paramtype2 = "meshoptions",
|
||||||
@ -281,20 +395,35 @@ local register_quarry_bush = function(number)
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if number < 5 then
|
||||||
|
def._dfcaverns_next_stage = "dfcaverns:quarry_bush_"..tostring(number+1)
|
||||||
|
table.insert(quarry_names, "dfcaverns:quarry_bush_"..tostring(number))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:quarry_bush_"..tostring(number), def)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,5 do
|
for i = 1,5 do
|
||||||
register_quarry_bush(i)
|
register_quarry_bush(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_seed("quarry_bush_seed", S("Rock Nuts"), "dfcaverns_rock_nuts.png")
|
register_seed("quarry_bush_seed", S("Rock Nuts"), "dfcaverns_rock_nuts.png", "dfcaverns:quarry_bush_1")
|
||||||
|
table.insert(quarry_names, "dfcaverns:quarry_bush_seed")
|
||||||
|
|
||||||
|
register_grow_abm(quarry_names, 10, 1)
|
||||||
|
|
||||||
minetest.register_craftitem("dfcaverns:quarry_bush_leaves", {
|
minetest.register_craftitem("dfcaverns:quarry_bush_leaves", {
|
||||||
description = S("Quarry Bush Leaves"),
|
description = S("Quarry Bush Leaves"),
|
||||||
inventory_image = "dfcaverns_quarry_bush_leaves.png",
|
inventory_image = "dfcaverns_quarry_bush_leaves.png",
|
||||||
stack_max = 99,
|
stack_max = 99,
|
||||||
})
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "dfcaverns:quarry_bush_leaves",
|
||||||
|
burntime = 4
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
@ -302,21 +431,33 @@ minetest.register_craftitem("dfcaverns:quarry_bush_leaves", {
|
|||||||
|
|
||||||
-- Round shape, red
|
-- Round shape, red
|
||||||
|
|
||||||
|
local sweet_names = {}
|
||||||
|
|
||||||
local register_sweet_pod = function(number)
|
local register_sweet_pod = function(number)
|
||||||
minetest.register_node("dfcaverns:sweet_pods_"..tostring(number), {
|
local def = {
|
||||||
description = S("Sweet Pods"),
|
description = S("Sweet Pod"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
tiles = {"dfcaverns_sweet_pods_"..tostring(number)..".png"},
|
tiles = {"dfcaverns_sweet_pod_"..tostring(number)..".png"},
|
||||||
inventory_image = "dfcaverns_sweet_pods_"..tostring(number)..".png",
|
inventory_image = "dfcaverns_sweet_pod_"..tostring(number)..".png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
groups = {flammable=4, oddly_breakable_by_hand=1, light_sensitive_fungus = 11},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if number < 6 then
|
||||||
|
def._dfcaverns_next_stage = "dfcaverns:sweet_pod_"..tostring(number+1)
|
||||||
|
table.insert(sweet_names, "dfcaverns:sweet_pod_"..tostring(number))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_node("dfcaverns:sweet_pod_"..tostring(number), def)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i = 1,6 do
|
for i = 1,6 do
|
||||||
register_sweet_pod(i)
|
register_sweet_pod(i)
|
||||||
end
|
end
|
||||||
|
|
||||||
register_seed("sweet_pod_seed", S("Sweet Pod Spores"), "dfcaverns_sweet_pod_seed.png")
|
register_seed("sweet_pod_seed", S("Sweet Pod Spores"), "dfcaverns_sweet_pod_seed.png", "dfcaverns:sweet_pod_1")
|
||||||
|
table.insert(sweet_names, "dfcaverns:sweet_pod_seed")
|
||||||
|
|
||||||
|
register_grow_abm(sweet_names, 10, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user