mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-26 10:00:22 +01:00
put spindlestems with goblin caps, make them always grow red when near those
This commit is contained in:
parent
c20e3918ef
commit
271a9441f4
@ -60,6 +60,8 @@ if minetest.get_modpath("df_farming") then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local c_red = minetest.get_content_id("df_trees:spindlestem_cap_red")
|
||||||
|
|
||||||
local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, data_param2)
|
local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, data_param2)
|
||||||
local ystride = area.ystride
|
local ystride = area.ystride
|
||||||
if abs_cracks < 0.1 then
|
if abs_cracks < 0.1 then
|
||||||
@ -72,6 +74,8 @@ local goblin_cap_cavern_floor = function(abs_cracks, vert_rand, vi, area, data,
|
|||||||
end
|
end
|
||||||
if math.random() < 0.1 then
|
if math.random() < 0.1 then
|
||||||
df_caverns.place_shrub(vi+ystride, area, data, data_param2, goblin_cap_shrublist)
|
df_caverns.place_shrub(vi+ystride, area, data, data_param2, goblin_cap_shrublist)
|
||||||
|
elseif math.random() < 0.02 then
|
||||||
|
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2, c_red)
|
||||||
elseif math.random() < 0.015 then
|
elseif math.random() < 0.015 then
|
||||||
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
||||||
end
|
end
|
||||||
|
@ -108,6 +108,8 @@ local mushroom_cavern_floor = function(abs_cracks, vert_rand, vi, area, data, da
|
|||||||
df_trees.spawn_tower_cap_vm(vi+ystride, area, data)
|
df_trees.spawn_tower_cap_vm(vi+ystride, area, data)
|
||||||
elseif math.random() < 0.01 then
|
elseif math.random() < 0.01 then
|
||||||
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
df_trees.spawn_goblin_cap_vm(vi+ystride, area, data)
|
||||||
|
elseif math.random() < 0.02 then
|
||||||
|
df_trees.spawn_spindlestem_vm(vi+ystride, area, data, data_param2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -9,7 +9,7 @@ minetest.register_node("df_trees:goblin_cap_stem", {
|
|||||||
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
||||||
tiles = {"dfcaverns_goblin_cap_stem.png"},
|
tiles = {"dfcaverns_goblin_cap_stem.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ minetest.register_node("df_trees:goblin_cap", {
|
|||||||
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
||||||
tiles = {"dfcaverns_goblin_cap.png"},
|
tiles = {"dfcaverns_goblin_cap.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, goblin_cap = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ minetest.register_node("df_trees:goblin_cap_gills", {
|
|||||||
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
_doc_items_usagehelp = df_trees.doc.goblin_cap_usage,
|
||||||
tiles = {"dfcaverns_goblin_cap_gills.png"},
|
tiles = {"dfcaverns_goblin_cap_gills.png"},
|
||||||
is_ground_content = true,
|
is_ground_content = true,
|
||||||
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
|
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, goblin_cap = 1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
|
@ -37,8 +37,8 @@ local stem_on_place = function(itemstack, placer, pointed_thing)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local new_param2
|
local new_param2
|
||||||
-- check if pointing at an existing stalactite
|
-- check if pointing at an existing spindlestem
|
||||||
if minetest.get_item_group(under.name, "spindlestem") ~= 0 then
|
if minetest.get_item_group(under.name, "spindlestem") > 0 then
|
||||||
new_param2 = under.param2
|
new_param2 = under.param2
|
||||||
else
|
else
|
||||||
new_param2 = math.random(0,3)
|
new_param2 = math.random(0,3)
|
||||||
@ -143,7 +143,7 @@ local register_spindlestem_type = function(item_suffix, colour_name, colour_code
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
on_place = stal_on_place,
|
on_place = stem_on_place,
|
||||||
on_timer = function(pos, elapsed)
|
on_timer = function(pos, elapsed)
|
||||||
local above = vector.add(pos, {x=0,y=1,z=0})
|
local above = vector.add(pos, {x=0,y=1,z=0})
|
||||||
local node_above = minetest.get_node(above)
|
local node_above = minetest.get_node(above)
|
||||||
@ -244,7 +244,7 @@ minetest.register_node("df_trees:spindlestem_seedling", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
on_place = stal_on_place,
|
on_place = stem_on_place,
|
||||||
on_construct = seedling_construct,
|
on_construct = seedling_construct,
|
||||||
|
|
||||||
on_timer = function(pos, elapsed)
|
on_timer = function(pos, elapsed)
|
||||||
@ -310,6 +310,10 @@ get_spindlestem_cap_type = function(pos)
|
|||||||
if pos.y > -100 then
|
if pos.y > -100 then
|
||||||
return c_white
|
return c_white
|
||||||
end
|
end
|
||||||
|
if minetest.find_node_near(pos, 15, "group:goblin_cap") then
|
||||||
|
return c_red
|
||||||
|
end
|
||||||
|
|
||||||
local iron = minetest.find_node_near(pos, 5, {"default:stone_with_iron", "default:steelblock"})
|
local iron = minetest.find_node_near(pos, 5, {"default:stone_with_iron", "default:steelblock"})
|
||||||
local copper = minetest.find_node_near(pos, 5, {"default:stone_with_copper", "default:copperblock"})
|
local copper = minetest.find_node_near(pos, 5, {"default:stone_with_copper", "default:copperblock"})
|
||||||
local mese = minetest.find_node_near(pos, 5, {"default:stone_with_mese", "default:mese"})
|
local mese = minetest.find_node_near(pos, 5, {"default:stone_with_mese", "default:mese"})
|
||||||
|
Loading…
Reference in New Issue
Block a user